Skip to content

Commit

Permalink
deploy: c54d30e
Browse files Browse the repository at this point in the history
  • Loading branch information
maminrayej committed Sep 4, 2024
1 parent e95652e commit 25c6ca4
Show file tree
Hide file tree
Showing 39 changed files with 259 additions and 185 deletions.
2 changes: 1 addition & 1 deletion crates/doc/search-index.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,8 @@
<a href="#348" id="348">348</a>
<a href="#349" id="349">349</a>
<a href="#350" id="350">350</a>
<a href="#351" id="351">351</a>
<a href="#352" id="352">352</a>
</pre></div><pre class="rust"><code><span class="kw">use </span>std::{path::Path, sync::Arc};

<span class="kw">use </span>anyhow::Context;
Expand Down Expand Up @@ -416,6 +418,8 @@
#[derivative(Debug)]
</span><span class="kw">pub struct </span>BinaryPackage {
<span class="kw">pub </span>id: PackageId,
<span class="doccomment">/// Includes the ids of all the packages in the tree
</span><span class="kw">pub </span>package_ids: Vec&lt;PackageId&gt;,

<span class="kw">pub </span>when_cached: <span class="prelude-ty">Option</span>&lt;u128&gt;,
<span class="doccomment">/// The name of the [`BinaryPackageCommand`] which is this package&#39;s
Expand Down
2 changes: 2 additions & 0 deletions crates/doc/src/wasmer_wasix/runners/wasi.rs.html
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,7 @@
<a href="#444" id="444">444</a>
<a href="#445" id="445">445</a>
<a href="#446" id="446">446</a>
<a href="#447" id="447">447</a>
</pre></div><pre class="rust"><code><span class="doccomment">//! WebC container support for running WASI modules

</span><span class="kw">use </span>std::{path::PathBuf, sync::Arc};
Expand Down Expand Up @@ -688,6 +689,7 @@
<span class="kw">let </span>container_fs = <span class="kw">if let </span><span class="prelude-val">Some</span>(pkg) = pkg {
builder.add_webc(pkg.clone());
builder.set_module_hash(pkg.hash());
builder.include_packages(pkg.package_ids.clone());
<span class="prelude-val">Some</span>(Arc::clone(<span class="kw-2">&amp;</span>pkg.webc_fs))
} <span class="kw">else </span>{
<span class="prelude-val">None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,8 @@
<a href="#627" id="627">627</a>
<a href="#628" id="628">628</a>
<a href="#629" id="629">629</a>
<a href="#630" id="630">630</a>
<a href="#631" id="631">631</a>
</pre></div><pre class="rust"><code><span class="kw">use </span>std::{
collections::{BTreeMap, HashMap, HashSet},
fmt::Debug,
Expand Down Expand Up @@ -671,6 +673,7 @@
) -&gt; <span class="prelude-ty">Result</span>&lt;BinaryPackage, Error&gt; {
<span class="kw">let </span><span class="kw-2">mut </span>containers = fetch_dependencies(loader, <span class="kw-2">&amp;</span>resolution.package, <span class="kw-2">&amp;</span>resolution.graph).<span class="kw">await</span><span class="question-mark">?</span>;
containers.insert(resolution.package.root_package.clone(), root.clone());
<span class="kw">let </span>package_ids = containers.keys().cloned().collect();
<span class="kw">let </span>fs = filesystem(<span class="kw-2">&amp;</span>containers, <span class="kw-2">&amp;</span>resolution.package, root_is_local_dir)<span class="question-mark">?</span>;

<span class="kw">let </span>root = <span class="kw-2">&amp;</span>resolution.package.root_package;
Expand All @@ -681,6 +684,7 @@

<span class="kw">let </span>loaded = BinaryPackage {
id: root.clone(),
package_ids,
when_cached: <span class="kw">crate</span>::syscalls::platform_clock_time_get(
wasmer_wasix_types::wasi::Snapshot0Clockid::Monotonic,
<span class="number">1_000_000</span>,
Expand Down
46 changes: 45 additions & 1 deletion crates/doc/src/wasmer_wasix/state/builder.rs.html
Original file line number Diff line number Diff line change
Expand Up @@ -1260,10 +1260,32 @@
<a href="#1260" id="1260">1260</a>
<a href="#1261" id="1261">1261</a>
<a href="#1262" id="1262">1262</a>
<a href="#1263" id="1263">1263</a>
<a href="#1264" id="1264">1264</a>
<a href="#1265" id="1265">1265</a>
<a href="#1266" id="1266">1266</a>
<a href="#1267" id="1267">1267</a>
<a href="#1268" id="1268">1268</a>
<a href="#1269" id="1269">1269</a>
<a href="#1270" id="1270">1270</a>
<a href="#1271" id="1271">1271</a>
<a href="#1272" id="1272">1272</a>
<a href="#1273" id="1273">1273</a>
<a href="#1274" id="1274">1274</a>
<a href="#1275" id="1275">1275</a>
<a href="#1276" id="1276">1276</a>
<a href="#1277" id="1277">1277</a>
<a href="#1278" id="1278">1278</a>
<a href="#1279" id="1279">1279</a>
<a href="#1280" id="1280">1280</a>
<a href="#1281" id="1281">1281</a>
<a href="#1282" id="1282">1282</a>
<a href="#1283" id="1283">1283</a>
<a href="#1284" id="1284">1284</a>
</pre></div><pre class="rust"><code><span class="doccomment">//! Builder system for configuring a [`WasiState`] and creating it.

</span><span class="kw">use </span>std::{
collections::HashMap,
collections::{HashMap, HashSet},
path::{Path, PathBuf},
sync::Arc,
};
Expand All @@ -1272,6 +1294,7 @@
<span class="kw">use </span>thiserror::Error;
<span class="kw">use </span>virtual_fs::{ArcFile, FileSystem, FsError, TmpFileSystem, VirtualFile};
<span class="kw">use </span>wasmer::{AsStoreMut, Extern, Imports, Instance, Module, Store};
<span class="kw">use </span>wasmer_config::package::PackageId;

<span class="attr">#[cfg(feature = <span class="string">&quot;journal&quot;</span>)]
</span><span class="kw">use </span><span class="kw">crate</span>::journal::{DynJournal, SnapshotTrigger};
Expand Down Expand Up @@ -1331,6 +1354,8 @@
<span class="doccomment">/// List of webc dependencies to be injected.
</span><span class="kw">pub</span>(<span class="kw">super</span>) uses: Vec&lt;BinaryPackage&gt;,

<span class="kw">pub</span>(<span class="kw">super</span>) included_packages: HashSet&lt;PackageId&gt;,

<span class="kw">pub</span>(<span class="kw">super</span>) module_hash: <span class="prelude-ty">Option</span>&lt;ModuleHash&gt;,

<span class="doccomment">/// List of host commands to map into the WASI instance.
Expand Down Expand Up @@ -1585,6 +1610,21 @@
<span class="self">self
</span>}

<span class="doccomment">/// Adds a package that is already included in the [`WasiEnvBuilder`] filesystem.
/// These packages will not be merged to the final filesystem since they are already included.
</span><span class="kw">pub fn </span>include_package(<span class="kw-2">&amp;mut </span><span class="self">self</span>, pkg_id: PackageId) -&gt; <span class="kw-2">&amp;mut </span><span class="self">Self </span>{
<span class="self">self</span>.included_packages.insert(pkg_id);
<span class="self">self
</span>}

<span class="doccomment">/// Adds packages that is already included in the [`WasiEnvBuilder`] filesystem.
/// These packages will not be merged to the final filesystem since they are already included.
</span><span class="kw">pub fn </span>include_packages(<span class="kw-2">&amp;mut </span><span class="self">self</span>, pkg_ids: <span class="kw">impl </span>IntoIterator&lt;Item = PackageId&gt;) -&gt; <span class="kw-2">&amp;mut </span><span class="self">Self </span>{
<span class="self">self</span>.included_packages.extend(pkg_ids.into_iter());

<span class="self">self
</span>}

<span class="doccomment">/// Adds a list of other containers this module inherits from.
///
/// This will make all of the container&#39;s files and commands available to the
Expand Down Expand Up @@ -2103,6 +2143,10 @@
wasi_fs.set_current_dir(s);
}

<span class="kw">for </span>id <span class="kw">in </span><span class="kw-2">&amp;</span><span class="self">self</span>.included_packages {
wasi_fs.has_unioned.lock().unwrap().insert(id.clone());
}

<span class="kw">let </span>state = WasiState {
fs: wasi_fs,
secret: rand::thread_rng().gen::&lt;[u8; <span class="number">32</span>]&gt;(),
Expand Down
6 changes: 3 additions & 3 deletions crates/doc/src/wasmer_wasix/state/env.rs.html
Original file line number Diff line number Diff line change
Expand Up @@ -2401,9 +2401,9 @@
<span class="macro">tracing::trace!</span>(package=%pkg.id, <span class="string">&quot;merging package dependency into wasi environment&quot;</span>);
<span class="kw">let </span>root_fs = <span class="kw-2">&amp;</span><span class="self">self</span>.state.fs.root_fs;

<span class="comment">// We first need to copy any files in the package over to the
// main file system
</span><span class="kw">if let </span><span class="prelude-val">Err</span>(e) = InlineWaker::block_on(root_fs.merge(<span class="kw-2">&amp;</span>pkg.webc_fs)) {
<span class="comment">// We first need to merge the filesystem in the package into the
// main file system, if it has not been merged already.
</span><span class="kw">if let </span><span class="prelude-val">Err</span>(e) = InlineWaker::block_on(<span class="self">self</span>.state.fs.conditional_union(pkg)) {
<span class="macro">tracing::warn!</span>(
error = <span class="kw-2">&amp;</span>e <span class="kw">as </span><span class="kw-2">&amp;</span><span class="kw">dyn </span>std::error::Error,
<span class="string">&quot;Unable to merge the package&#39;s filesystem into the main one&quot;</span>,
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `binary_package` mod in crate `wasmer_wasix`."><title>wasmer_wasix::bin_factory::binary_package - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../static.files/rustdoc-fa3bb1812debf86c.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="wasmer_wasix" data-themes="" data-resource-suffix="" data-rustdoc-version="1.74.1 (a28077b28 2023-12-04)" data-channel="1.74.1" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="../../../static.files/main-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="icon" href="https://wasmer.io/images/icons/favicon-32x32.png"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="logo-container" href="../../../wasmer_wasix/index.html"><img src="https://github.com/wasmerio.png?size=200" alt="logo"></a></nav><nav class="sidebar"><a class="logo-container" href="../../../wasmer_wasix/index.html"><img src="https://github.com/wasmerio.png?size=200" alt="logo"></a><h2 class="location"><a href="#">Module binary_package</a></h2><div class="sidebar-elems"><section><ul class="block"><li><a href="#structs">Structs</a></li></ul></section></div></nav><main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Module <a href="../../index.html">wasmer_wasix</a>::<wbr><a href="../index.html">bin_factory</a>::<wbr><a class="mod" href="#">binary_package</a><button id="copy-path" title="Copy item path to clipboard"><img src="../../../static.files/clipboard-7571035ce49a181d.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="src" href="../../../src/wasmer_wasix/bin_factory/binary_package.rs.html#1-350">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>&#x2212;</span>]</button></span></div><h2 id="structs" class="small-section-header"><a href="#structs">Structs</a></h2><ul class="item-table"><li><div class="item-name"><a class="struct" href="struct.BinaryPackage.html" title="struct wasmer_wasix::bin_factory::binary_package::BinaryPackage">BinaryPackage</a></div><div class="desc docblock-short">A WebAssembly package that has been loaded into memory.</div></li><li><div class="item-name"><a class="struct" href="struct.BinaryPackageCommand.html" title="struct wasmer_wasix::bin_factory::binary_package::BinaryPackageCommand">BinaryPackageCommand</a></div></li></ul></section></div></main></body></html>
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `binary_package` mod in crate `wasmer_wasix`."><title>wasmer_wasix::bin_factory::binary_package - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Regular-018c141bf0843ffd.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/FiraSans-Medium-8f9a781e4970d388.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2"><link rel="stylesheet" href="../../../static.files/normalize-76eba96aa4d2e634.css"><link rel="stylesheet" href="../../../static.files/rustdoc-fa3bb1812debf86c.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="wasmer_wasix" data-themes="" data-resource-suffix="" data-rustdoc-version="1.74.1 (a28077b28 2023-12-04)" data-channel="1.74.1" data-search-js="search-8be46b629f5f14a8.js" data-settings-js="settings-74424d7eec62a23e.js" ><script src="../../../static.files/storage-fec3eaa3851e447d.js"></script><script defer src="../../../static.files/main-c5bd66d33317d69f.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-5d8b3c7633ad77ba.css"></noscript><link rel="icon" href="https://wasmer.io/images/icons/favicon-32x32.png"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="logo-container" href="../../../wasmer_wasix/index.html"><img src="https://github.com/wasmerio.png?size=200" alt="logo"></a></nav><nav class="sidebar"><a class="logo-container" href="../../../wasmer_wasix/index.html"><img src="https://github.com/wasmerio.png?size=200" alt="logo"></a><h2 class="location"><a href="#">Module binary_package</a></h2><div class="sidebar-elems"><section><ul class="block"><li><a href="#structs">Structs</a></li></ul></section></div></nav><main><div class="width-limiter"><nav class="sub"><form class="search-form"><span></span><input class="search-input" name="search" aria-label="Run search in the documentation" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../static.files/wheel-7b819b6101059cd0.svg"></a></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1>Module <a href="../../index.html">wasmer_wasix</a>::<wbr><a href="../index.html">bin_factory</a>::<wbr><a class="mod" href="#">binary_package</a><button id="copy-path" title="Copy item path to clipboard"><img src="../../../static.files/clipboard-7571035ce49a181d.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="src" href="../../../src/wasmer_wasix/bin_factory/binary_package.rs.html#1-352">source</a> · <button id="toggle-all-docs" title="collapse all docs">[<span>&#x2212;</span>]</button></span></div><h2 id="structs" class="small-section-header"><a href="#structs">Structs</a></h2><ul class="item-table"><li><div class="item-name"><a class="struct" href="struct.BinaryPackage.html" title="struct wasmer_wasix::bin_factory::binary_package::BinaryPackage">BinaryPackage</a></div><div class="desc docblock-short">A WebAssembly package that has been loaded into memory.</div></li><li><div class="item-name"><a class="struct" href="struct.BinaryPackageCommand.html" title="struct wasmer_wasix::bin_factory::binary_package::BinaryPackageCommand">BinaryPackageCommand</a></div></li></ul></section></div></main></body></html>
Loading

0 comments on commit 25c6ca4

Please sign in to comment.