Skip to content
This repository was archived by the owner on Jun 14, 2023. It is now read-only.

Commit f128812

Browse files
authored
Update wapm dependencies (#184)
* Update wapm dependencies * Manually update dependencies This reduces the total number of dependencies by ~80-100 * Update reqwest for update notifications too * Clean up merge, fix tempdir upgrade mistake
1 parent 256f95f commit f128812

File tree

15 files changed

+862
-901
lines changed

15 files changed

+862
-901
lines changed

Cargo.lock

Lines changed: 815 additions & 841 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,50 +11,42 @@ license = "MIT"
1111
atty = "0.2"
1212
billboard = { version = "0.1.0", optional = true }
1313
chrono = { version = "0.4", features = ["serde"] }
14-
colored = "1.8"
14+
colored = { version = "1.8", optional = true }
1515
dirs = "1"
16-
dotenv = "0.13.0"
17-
dunce = "1.0.0"
1816
failure = "*"
19-
fern = {version = "0.5", features = ["colored"]}
17+
fern = {version = "0.6", features = ["colored"]}
2018
flate2 = "1.0.7"
21-
fs_extra = "1"
22-
graphql_client = "0.7.0"
23-
indicatif = "0.11"
19+
graphql_client = "0.8.0"
2420
lazy_static = "1.3"
2521
license-exprs = "1.4.0"
2622
log = "0.4"
2723
maplit = { version = "1", optional = true }
28-
minisign = "0.5.9"
29-
path-slash = "0.1.1"
24+
minisign = "0.5"
3025
prettytable-rs = "0.8.0"
3126
regex = "1"
32-
reqwest = {version = "0.9.12", features = ["default-tls-vendored"]}
33-
rpassword = "3.0.0"
34-
rusqlite = {version = "0.18", features = ["bundled"]}
35-
semver = "0.9"
27+
reqwest = {version = "0.10", features = ["native-tls-vendored", "blocking", "json", "gzip"]}
28+
rpassword = "4"
29+
rusqlite = {version = "0.21", features = ["bundled"]}
30+
semver = { version = "0.9", features = ["serde"] }
3631
sentry = {version = "0.15", optional = true, features = ["with_failure", "with_panic", "with_backtrace"]}
3732
serde = "1.0"
3833
serde_derive = "1.0"
3934
serde_json = "1.0"
4035
structopt = { version = "0.3", features = ["color"] }
4136
tar = "0.4"
42-
tempdir = "0.3"
37+
tempfile = "3"
4338
time = "0.1"
4439
toml = "0.5.6"
45-
toml-query = "0.9.2"
46-
url = "1.7"
47-
walrus = "0.5"
40+
url = "2"
4841
wasm-interface = { path = "lib/wasm-interface" }
49-
wasmparser = "0.39.2"
42+
wasmparser = "0.51.4"
5043
whoami = "0.5"
51-
zstd = "0.4"
5244
dialoguer = "0.4.0"
5345
hex = { version = "0.4", optional = true }
5446
blake3 = { version = "0.1.0", optional = true }
5547

5648
[dev-dependencies]
57-
tempdir = "0.3"
49+
tempfile = "3"
5850

5951
[workspace]
6052
members = [
@@ -65,7 +57,7 @@ members = [
6557
[features]
6658
default = ["packagesigning"]
6759
telemetry = ["sentry"]
68-
update-notifications= ["billboard"]
60+
update-notifications= ["billboard", "colored"]
6961
prehash-module = ["hex", "blake3"]
7062
packagesigning = []
7163
integration_tests = ["maplit"]

lib/wasm-interface/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ bincode = { version = "1", optional = true }
1212
either = "1.5"
1313
nom = "5"
1414
serde = { version = "1", features = ["derive"] }
15-
wasmparser = { version = "0.32", optional = true }
15+
wasmparser = { version = "0.51.4", optional = true }
1616

1717
[dev-dependencies]
1818
wabt = "0.7"

src/commands/execute.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,6 @@ pub fn execute(opt: ExecuteOpt) -> Result<(), failure::Error> {
300300
&opt.pre_opened_directories,
301301
&opt.args,
302302
prehashed_cache_key,
303-
&default_wax_command_name_formatter,
304303
)?;
305304
return Ok(());
306305
}
@@ -553,7 +552,6 @@ fn run(
553552
pre_opened_directories,
554553
args,
555554
prehashed_cache_key,
556-
&default_wax_command_name_formatter,
557555
);
558556
}
559557
FindCommandResult::Error(e) => return Err(e),
@@ -599,7 +597,3 @@ fn get_wax_cooldown() -> i32 {
599597
.map(|c| c.wax_cooldown)
600598
.unwrap_or(config::wax_default_cooldown())
601599
}
602-
603-
fn default_wax_command_name_formatter(command_name: &str) -> String {
604-
format!("wax {}", command_name)
605-
}

src/commands/publish.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,12 @@ pub fn publish(publish_opts: PublishOpt) -> Result<(), failure::Error> {
116116
// TODO:
117117
PublishError::NoModule)?;
118118
let archive_name = "package.tar.gz".to_string();
119-
let archive_dir = tempdir::TempDir::new("wapm_package")?;
120-
let archive_path = archive_dir.as_ref().join(&archive_name);
119+
let archive_dir = tempfile::TempDir::new()?;
120+
fs::create_dir(archive_dir.path().join("wapm_package"))?;
121+
let archive_path = archive_dir
122+
.as_ref()
123+
.join("wapm_package")
124+
.join(&archive_name);
121125
let mut compressed_archive = fs::File::create(&archive_path).unwrap();
122126
let mut gz_enc = GzEncoder::new(&mut compressed_archive, Compression::default());
123127

src/commands/run.rs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,9 @@ pub fn run(run_options: RunOpt) -> Result<(), failure::Error> {
7575
&run_options.pre_opened_directories,
7676
&args,
7777
prehashed_cache_key,
78-
&default_wapm_command_name_formatter,
7978
)
8079
}
8180

82-
fn default_wapm_command_name_formatter(command_name: &str) -> String {
83-
format!("wapm run {}", command_name)
84-
}
85-
8681
pub(crate) fn do_run(
8782
run_dir: PathBuf,
8883
source_path_buf: PathBuf,
@@ -92,7 +87,6 @@ pub(crate) fn do_run(
9287
pre_opened_directories: &[String],
9388
args: &[OsString],
9489
prehashed_cache_key: Option<String>,
95-
command_name_formatter: &dyn Fn(&str) -> String,
9690
) -> Result<(), failure::Error> {
9791
debug!(
9892
"Running module located at {:?}",
@@ -130,13 +124,11 @@ pub(crate) fn do_run(
130124
.collect();
131125

132126
let mut disable_command_rename = false;
133-
let mut rename_commands_to_raw_command_name = false;
134127

135128
match ManifestResult::find_in_directory(&manifest_dir) {
136129
ManifestResult::Manifest(manifest) => {
137130
disable_command_rename = manifest.package.disable_command_rename;
138-
rename_commands_to_raw_command_name =
139-
manifest.package.rename_commands_to_raw_command_name;
131+
manifest.package.rename_commands_to_raw_command_name;
140132
if let Some(ref fs) = manifest.fs {
141133
// todo: normalize (rm `:` and newline, etc) these paths if we haven't yet
142134
for (guest_path, host_path) in fs.iter() {
@@ -235,15 +227,14 @@ mod test {
235227
#[test]
236228
fn create_run_command_vec() {
237229
let args: Vec<OsString> = vec![OsString::from("arg1"), OsString::from("arg2")];
238-
let tmp_dir = tempdir::TempDir::new("create_run_command_vec").unwrap();
230+
let tmp_dir = tempfile::TempDir::new().unwrap();
239231
let dir = tmp_dir.path();
240232
let wapm_module_dir = dir.join(
241233
[PACKAGES_DIR_NAME, "_", "[email protected]"]
242234
.iter()
243235
.collect::<PathBuf>(),
244236
);
245237
fs::create_dir_all(&wapm_module_dir).unwrap();
246-
// calling dunce here to help wih comparing paths on different platforms
247238
let expected_dir: PathBuf = wapm_module_dir.clone();
248239
let expected_dir = expected_dir.join("foo_entry.wasm");
249240
let expected_command = vec![

src/commands/validate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ pub fn validate_manifest_and_modules(pkg_path: PathBuf) -> Result<(), failure::E
3737
gz.read_to_end(&mut archive_data)
3838
.map_err(|e| format_err!("Failed to read archive data: {}", e.to_string()))?;
3939

40-
let temp_out_dir = tempdir::TempDir::new("temp")
40+
let temp_out_dir = tempfile::TempDir::new()
4141
.map_err(|e| format_err!("Could not create temporary directory: {}", e.to_string()))?;
4242
let out_dir = temp_out_dir.path();
4343
let mut archive = Archive::new(archive_data.as_slice());

src/config.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ mod test {
302302

303303
#[test]
304304
fn get_non_existent_config() {
305-
let tmp_dir = tempdir::TempDir::new("get_non_existent_config").unwrap();
305+
let tmp_dir = tempfile::TempDir::new().unwrap();
306306
// set the env var to our temp dir
307307
std::env::set_var(
308308
GLOBAL_CONFIG_FOLDER_ENV_VAR,
@@ -320,7 +320,7 @@ mod test {
320320

321321
#[test]
322322
fn get_global_config() {
323-
let tmp_dir = tempdir::TempDir::new("get_global_config").unwrap();
323+
let tmp_dir = tempfile::TempDir::new().unwrap();
324324
let manifest_absolute_path = tmp_dir.path().join(GLOBAL_CONFIG_FILE_NAME);
325325
let mut file = File::create(&manifest_absolute_path).unwrap();
326326
let config = Config::default();

src/data/manifest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ mod dependency_tests {
288288

289289
#[test]
290290
fn add_new_dependency() {
291-
let tmp_dir = tempdir::TempDir::new("add_new_dependency").unwrap();
291+
let tmp_dir = tempfile::TempDir::new().unwrap();
292292
let manifest_path = tmp_dir.path().join(MANIFEST_FILE_NAME);
293293
let mut file = File::create(&manifest_path).unwrap();
294294
let wapm_toml = toml! {

src/database.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ mod test {
124124

125125
#[test]
126126
fn data_version_was_updated() {
127-
let tmp_dir = tempdir::TempDir::new("DB").unwrap().path().to_owned();
127+
let tmp_dir = tempfile::TempDir::new().unwrap().path().to_owned();
128128
let mut conn = Connection::open(tmp_dir).unwrap();
129129
if let Err(MigrationError::MigrationNumberDoesNotExist { .. }) =
130130
apply_migration(&mut conn, CURRENT_DATA_VERSION)

0 commit comments

Comments
 (0)