Skip to content

Commit

Permalink
Merge pull request #3494 from wasmerio/update-wasmer-toml
Browse files Browse the repository at this point in the history
Update wasmer-toml version
  • Loading branch information
fschutt authored Jan 19, 2023
2 parents d9073b0 + a33cb20 commit 54b34a3
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 8 deletions.
6 changes: 4 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion lib/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ dirs = { version = "4.0" }
serde_json = { version = "1.0" }
target-lexicon = { version = "0.12", features = ["std"] }
prettytable-rs = "0.9.0"
wasmer-toml = "0.5.0"
wasmer-toml = "0.6.0"
indexmap = "1.9.2"
walkdir = "2.3.2"
regex = "1.6.0"
toml = "0.5.9"
Expand Down
3 changes: 2 additions & 1 deletion lib/cli/src/commands/init.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use anyhow::Context;
use cargo_metadata::{CargoOpt, MetadataCommand};
use clap::Parser;
use indexmap::IndexMap;
use std::collections::HashMap;
use std::path::Path;
use std::path::PathBuf;
Expand Down Expand Up @@ -204,7 +205,7 @@ impl Init {
}
}

fn get_filesystem_mapping(include: &[String]) -> Option<HashMap<String, PathBuf>> {
fn get_filesystem_mapping(include: &[String]) -> Option<IndexMap<String, PathBuf>> {
if include.is_empty() {
return None;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/cli/src/commands/publish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ fn construct_tar_gz(
}

// bundle the package filesystem
let default = std::collections::HashMap::default();
let default = indexmap::IndexMap::default();
for (_alias, path) in manifest.fs.as_ref().unwrap_or(&default).iter() {
let normalized_path = normalize_path(cwd, path);
let path_metadata = normalized_path.metadata().map_err(|_| {
Expand Down
8 changes: 6 additions & 2 deletions lib/cli/src/commands/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use crate::suggestions::suggest_function_exports;
use crate::warning;
use anyhow::{anyhow, Context, Result};
use clap::Parser;
use std::collections::HashMap;
use std::ops::Deref;
use std::path::PathBuf;
use std::str::FromStr;
Expand Down Expand Up @@ -121,7 +120,12 @@ impl RunWithPathBuf {

#[cfg(feature = "wasi")]
{
let default = HashMap::default();
// See https://github.com/wasmerio/wasmer/issues/3492 -
// we need IndexMap to have a stable ordering for the [fs] mapping,
// otherwise overlapping filesystem mappings might not work
// since we want to control the order of mounting directories from the
// wasmer.toml file
let default = indexmap::IndexMap::default();
let fs = manifest.fs.as_ref().unwrap_or(&default);
for (alias, real_dir) in fs.iter() {
let real_dir = self_clone.path.join(&real_dir);
Expand Down
2 changes: 1 addition & 1 deletion lib/registry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ serde_json = "1.0.85"
url = "2.3.1"
thiserror = "1.0.37"
toml = "0.5.9"
wasmer-toml = "0.5.0"
wasmer-toml = "0.6.0"
tar = "0.4.38"
flate2 = "1.0.24"
semver = "1.0.14"
Expand Down

0 comments on commit 54b34a3

Please sign in to comment.