Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update wasmer --version logic, integrate wapm-cli #3215

Merged
merged 94 commits into from
Oct 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
6cd80f4
Update clap, rewrite main CLI logic
fschutt Oct 4, 2022
771e1e3
Added `RunWithoutFile` to prepare downloading + GraphQL schema
fschutt Oct 4, 2022
d74419d
Don't panic when trying to run wasmer run [package]
fschutt Oct 4, 2022
ba8b13c
Add spinner when installing package
fschutt Oct 4, 2022
3b15e75
Add GraphQL querying
fschutt Oct 4, 2022
83c50d3
Add code for querying GraphQL
fschutt Oct 4, 2022
af01356
Implement wasmer -vV
fschutt Oct 4, 2022
6c57e1e
Finished adding wasmer -vV and --help messages
fschutt Oct 4, 2022
4bf7c43
Query packages correctly from wapm registry and debug error msg
fschutt Oct 5, 2022
2c1cf2e
Implemented "did you mean" functionality
fschutt Oct 5, 2022
374494e
Install packages correctly
fschutt Oct 6, 2022
efdb1f4
cargo fmt
fschutt Oct 6, 2022
8178673
Fail on ambigouus package name
fschutt Oct 6, 2022
0068d79
Do not re-download already-downloaded package
fschutt Oct 6, 2022
2414d44
Merge branch 'master' into wasmer-vv
fschutt Oct 6, 2022
2640a6d
Pass filesystem mappings from wapm.toml to --mapdir
fschutt Oct 6, 2022
5238c8e
Fix errors in debug mode, implement getenv / setenv on emscripten
fschutt Oct 6, 2022
3be8640
Added --env flags for emscripten target, debugged PYTHONHOME
fschutt Oct 6, 2022
da1e295
Fix error in listing local packages
fschutt Oct 7, 2022
50733a5
Try adding support for pkg_fs
fschutt Oct 7, 2022
a6d9e3e
Map every single directory on emscripten
fschutt Oct 7, 2022
7edfd68
cargo fmt
fschutt Oct 7, 2022
e696d78
cargo update
fschutt Oct 7, 2022
7147694
Fix "make lint"
fschutt Oct 7, 2022
0194f8e
cargo fmt
fschutt Oct 7, 2022
862b155
Always set WASMER_BUILD_GIT_HASH
fschutt Oct 7, 2022
b1c3f33
cargo fmt
fschutt Oct 7, 2022
5bc1914
Try fixing errors when parsing CLI args: todo: undo clap migration
fschutt Oct 7, 2022
5fe8167
Downgrade to clap v3
fschutt Oct 9, 2022
5161078
cargo fmt
fschutt Oct 9, 2022
d0372d5
Fix last changes from upgrading to clap v4
fschutt Oct 9, 2022
5b16e05
Fix issue in chrono dependency
fschutt Oct 9, 2022
0ed3be1
Fix clippy issues
fschutt Oct 9, 2022
df047b0
Impl Debug for Binfmt
fschutt Oct 9, 2022
6eade9b
Fix issue in Binfmt::debug
fschutt Oct 9, 2022
25c4fd4
Fix issue with CLI run command not finding PathBuf to wasm file
fschutt Oct 10, 2022
6f15d1a
Fix build issue on linux-musl
fschutt Oct 10, 2022
03fe253
Fix CI
fschutt Oct 10, 2022
5b72f97
Add option to auto-install packages by command name ("wasmer ls")
fschutt Oct 10, 2022
8f29862
Refactor creating SpinnerHandle
fschutt Oct 11, 2022
5a2d45a
Merge remote-tracking branch 'origin/master' into wasmer-vv
fschutt Oct 11, 2022
8d0fbbb
Update Cargo.lock
fschutt Oct 11, 2022
f763887
Merge branch 'master' into wasmer-vv
fschutt Oct 11, 2022
471fd36
Rework main CLI command flow into smaller functions
fschutt Oct 13, 2022
9e278c3
Fix make lint
fschutt Oct 13, 2022
0da844d
CLI: use `get_subcommands()` instead of manual definition
fschutt Oct 13, 2022
600dc2d
Replace package parsing with regex
fschutt Oct 13, 2022
a1548ec
Use split_once instead of split().nth(1)
fschutt Oct 13, 2022
7419be1
Merge RunWithoutFile and Run
fschutt Oct 13, 2022
04b5c43
Lazy-return string on Error
fschutt Oct 13, 2022
b96f354
Drop unnecessary loop labels
fschutt Oct 13, 2022
b4e84c0
Use `unwrap_or(name)`
fschutt Oct 13, 2022
9455b6b
Nit: update version == Some(&v.version)
fschutt Oct 13, 2022
be8689a
Merge branch 'master' into wasmer-vv
fschutt Oct 13, 2022
5f831fc
Fix make lint
fschutt Oct 13, 2022
2c3f164
Use anyhow::ensure
fschutt Oct 13, 2022
f5eb1cb
Added timeout of 5 minutes for re-querying packages from registry
fschutt Oct 14, 2022
f8f33a8
Add --force install method (download packages without cooldown)
fschutt Oct 14, 2022
f8151e1
Merge branch 'master' into wasmer-vv
fschutt Oct 14, 2022
d518173
Fix CI on Linux
fschutt Oct 14, 2022
ef1bc7b
Fix "make lint"
fschutt Oct 14, 2022
b5bf287
Fix CI on Linux again
fschutt Oct 14, 2022
68a55c2
Merge branch 'master' into wasmer-vv
fschutt Oct 17, 2022
a960498
Add unit test and fix problems when installing package
fschutt Oct 17, 2022
db16c20
Rework "wasmer list"
fschutt Oct 17, 2022
7c05da0
Fix issue when running wasmer/wit-pack and wabt
fschutt Oct 18, 2022
0f59d59
Fix "make lint"
fschutt Oct 18, 2022
1a398c4
Fix more wasmer run UX bugs
fschutt Oct 18, 2022
fd5fa25
Do not auto-download packages if the execution failed
fschutt Oct 18, 2022
0c8b40e
Merge branch 'master' into wasmer-vv
fschutt Oct 18, 2022
d6719b7
Add (failing) integration test for wasmer run
fschutt Oct 18, 2022
3dcd2a6
Add support for specifying registry in CLI arg
fschutt Oct 18, 2022
5b165b6
Fix execution of python/python with wrong directory mapping
fschutt Oct 18, 2022
f761ddc
Make python/python run
fschutt Oct 18, 2022
1f59a5c
Run packages via specifying directory instead of package name
fschutt Oct 19, 2022
7487249
Merge branch 'master' into wasmer-vv
fschutt Oct 19, 2022
3de6286
Fix "make lint"
fschutt Oct 19, 2022
b887a83
Fix integration test, add option to run directory with wapm.toml
fschutt Oct 19, 2022
8eec46a
Fix "make lint"
fschutt Oct 19, 2022
2f61896
Add integration test for running directory
fschutt Oct 19, 2022
d89db1f
Fix bug when running file with directory
fschutt Oct 19, 2022
69cd380
Fix issue with wasmer run not working correctly
fschutt Oct 19, 2022
71e7ee1
Fix CI
fschutt Oct 19, 2022
ab4b001
Fix integration test
fschutt Oct 20, 2022
fcc7962
Debug failing test on linux-musl
fschutt Oct 20, 2022
e57b7bb
Ran rustfmt
Oct 21, 2022
b0ba0f6
Merge branch 'master' into wasmer-vv
fschutt Oct 24, 2022
81350bc
Adress review comments
fschutt Oct 24, 2022
acb529a
Disable segfaulting unit test on linux-musl
fschutt Oct 24, 2022
9b0ac57
Fix failing unit test (refactor)
fschutt Oct 24, 2022
90ab3e6
Properly disable unit test on -musl
fschutt Oct 24, 2022
9e4b445
Disable test_wasmer_run_works on musl due to failing network access
fschutt Oct 24, 2022
9a54036
Merge branch 'master' into wasmer-vv
Oct 25, 2022
e268ad1
Merge branch 'master' into wasmer-vv
fschutt Oct 25, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
874 changes: 785 additions & 89 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ members = [
"lib/c-api/tests/wasmer-c-api-test-runner",
"lib/c-api/examples/wasmer-capi-examples-runner",
"lib/types",
"lib/registry",
"tests/wasi-wast",
"tests/lib/wast",
"tests/lib/compiler-test-derive",
Expand Down
13 changes: 13 additions & 0 deletions lib/c-api/examples/assets/qjs-wapm.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[package]
name = "adamz/qjs"
version = "0.0.1"
description = "https://github.com/bellard/quickjs"
license = "MIT"

[[command]]
name = "qjs"
module = "qjs"

[[module]]
name = "qjs"
source = "qjs.wasm"
13 changes: 12 additions & 1 deletion lib/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,14 @@ wasmer-wasi-experimental-io-devices = { version = "=3.0.0-beta.2", path = "../wa
wasmer-wast = { version = "=3.0.0-beta.2", path = "../../tests/lib/wast", optional = true }
wasmer-cache = { version = "=3.0.0-beta.2", path = "../cache", optional = true }
wasmer-types = { version = "=3.0.0-beta.2", path = "../types" }
wasmer-registry = { version = "=3.0.0-beta.2", path = "../registry" }
wasmer-object = { version = "=3.0.0-beta.2", path = "../object", optional = true }
wasmer-vfs = { version = "=3.0.0-beta.2", path = "../vfs", default-features = false, features = ["host-fs"] }
atty = "0.2"
colored = "2.0"
anyhow = "1.0"
clap = { version = "3.1", features = ["derive"] }
spinner = "0.5.0"
clap = { version = "3.2.22", features = ["derive"] }
# For the function names autosuggestion
distance = "0.4"
# For the inspect subcommand
Expand All @@ -56,6 +58,15 @@ http_req = { version="^0.8", default-features = false, features = ["rust-tls"],
dirs = { version = "4.0", optional = true }
serde_json = { version = "1.0", optional = true }
target-lexicon = { version = "0.12", features = ["std"] }
prettytable-rs = "0.9.0"
wapm-toml = "0.1.2"
walkdir = "2.3.2"
regex = "1.6.0"
toml = "0.5.9"
url = "2.3.1"

[build-dependencies]
chrono = { version = "^0.4", default-features = false, features = [ "std", "clock" ] }

[target.'cfg(target_os = "linux")'.dependencies]
unix_mode = "0.1.3"
Expand Down
26 changes: 24 additions & 2 deletions lib/cli/build.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,26 @@
use chrono::prelude::*;
use std::process::Command;

pub fn main() {
println!("cargo:rerun-if-changed=build.rs");
println!("cargo:rerun-if-env-changed=WASMER_INSTALL_PREFIX");
fschutt marked this conversation as resolved.
Show resolved Hide resolved
// Set WASMER_GIT_HASH
let git_hash = Command::new("git")
.args(&["rev-parse", "HEAD"])
.output()
.ok()
.and_then(|output| String::from_utf8(output.stdout).ok())
.unwrap_or_default();
println!("cargo:rustc-env=WASMER_BUILD_GIT_HASH={}", git_hash);

if git_hash.len() > 5 {
println!(
"cargo:rustc-env=WASMER_BUILD_GIT_HASH_SHORT={}",
&git_hash[..5]
);
} else {
println!("cargo:rustc-env=WASMER_BUILD_GIT_HASH_SHORT=??????");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only thing I'm unsure about - for some reason the git hash is not available on -musl, not sure if it's 100% necessary, this is more of a quick hack

}

let utc: DateTime<Utc> = Utc::now();
let date = utc.format("%Y-%m-%d").to_string();
println!("cargo:rustc-env=WASMER_BUILD_DATE={}", date);
}
Loading