Merge branch 'master' into fix-master-red-2

This commit is contained in:
Felix Schütt
2023-01-19 18:53:38 +01:00
committed by GitHub
6 changed files with 16 additions and 8 deletions

View File

@@ -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"

View File

@@ -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;
@@ -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;
}

View File

@@ -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(|_| {

View File

@@ -8,7 +8,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;
#[cfg(feature = "cache")]
@@ -124,7 +123,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);