repo stringlengths 5 53 | pr_number int32 1 321k | task_type stringclasses 2
values | issue_text stringlengths 0 81.2k | pr_title stringlengths 1 319 | pr_body stringlengths 0 105k | base_sha stringlengths 40 40 | head_sha stringlengths 40 40 | gold_diff stringlengths 0 202M | changed_files listlengths 0 100 | review_threads listlengths 0 100 | test_patch stringlengths 0 23.4M | merged bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
wasmerio/wasmer | 6,658 | issue_to_patch | feat(V8): enable some WASIX tests on Windows | The PR enables testing V8 for the compiler tests and some of the WASIX tests (note `wasixcc` does not support Windows yet).
A proper enabling of the V8 for wasmer-cli will come in a subsequent PR.
Issue: #6121 | 822170748615cc1e378b0063c6e70dc9091056e4 | 53dc199bd69b2dc378a856952b691cb64a911f61 | diff --git a/Makefile b/Makefile
index 187f70dc8a5b..1fad24bd5858 100644
--- a/Makefile
+++ b/Makefile
@@ -220,6 +220,10 @@ endif
compilers := $(strip $(compilers))
build_compilers := $(strip $(build_compilers) $(compilers))
+ifeq ($(IS_WINDOWS), 1)
+ build_compilers := $(filter-out llvm,$(build_compilers))
+endif
... | [
"Makefile",
"lib/api/build.rs",
"lib/wasix/Cargo.toml",
"lib/wasix/tests/wasm_tests/mod.rs",
"lib/wasix/tests/wasm_tests/runner.rs",
"lib/wasix/tests/wasm_tests/wasi_fyi/fs_sandbox_symlink.rs",
"lib/wasix/tests/wasm_tests/wasi_fyi/ported_readlink.rs",
"tests/lib/wast/src/wast.rs"
] | [
{
"comment": "Removing the Windows short-circuit makes these fixture-based WASIX integration tests run on Windows, but the harness currently relies on Unix tooling (e.g., `bash` in `run_build_script`) and will also error on symlink fixtures (`copy_symlink` bails on non-Unix). This will cause `cargo test`/`make ... | diff --git a/lib/wasix/tests/wasm_tests/mod.rs b/lib/wasix/tests/wasm_tests/mod.rs
index dea874f7b8b3..db1d9db8e70b 100644
--- a/lib/wasix/tests/wasm_tests/mod.rs
+++ b/lib/wasix/tests/wasm_tests/mod.rs
@@ -119,6 +119,7 @@ struct MappedDirectory {
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Engine {
Cr... | true | |
wasmerio/wasmer | 6,658 | comment_to_fix | feat(V8): enable some WASIX tests on Windows | Removing the Windows short-circuit makes these fixture-based WASIX integration tests run on Windows, but the harness currently relies on Unix tooling (e.g., `bash` in `run_build_script`) and will also error on symlink fixtures (`copy_symlink` bails on non-Unix). This will cause `cargo test`/`make test-all` to fail on W... | 822170748615cc1e378b0063c6e70dc9091056e4 | 53dc199bd69b2dc378a856952b691cb64a911f61 | diff --git a/lib/wasix/tests/wasm_tests/mod.rs b/lib/wasix/tests/wasm_tests/mod.rs
index dea874f7b8b3..db1d9db8e70b 100644
--- a/lib/wasix/tests/wasm_tests/mod.rs
+++ b/lib/wasix/tests/wasm_tests/mod.rs
@@ -119,6 +119,7 @@ struct MappedDirectory {
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Engine {
Cr... | [
"lib/wasix/tests/wasm_tests/mod.rs"
] | [
{
"comment": "Removing the Windows short-circuit makes these fixture-based WASIX integration tests run on Windows, but the harness currently relies on Unix tooling (e.g., `bash` in `run_build_script`) and will also error on symlink fixtures (`copy_symlink` bails on non-Unix). This will cause `cargo test`/`make ... | true | ||
wasmerio/wasmer | 6,660 | issue_to_patch | fix(cargo): publish | b14f2e731c0c9c426496b0703caf0a2933e2eba4 | 5a8150144438b2ada347b6d02a5ea658e89b8bc6 | diff --git a/lib/swift/Cargo.toml b/lib/swift/Cargo.toml
index f41cee14d500..c8da5cc93c1c 100644
--- a/lib/swift/Cargo.toml
+++ b/lib/swift/Cargo.toml
@@ -19,6 +19,7 @@ virtual-fs = { path = "../virtual-fs", version = "=0.702.0-alpha.3", default-fea
"webc-fs",
] }
wasmer = { version = "=7.2.0-alpha.3", path = "../... | [
"lib/swift/Cargo.toml",
"lib/wasix/Cargo.toml"
] | [
{
"comment": "`exclude = [\"tests/wasm_tests/**\"]` will also exclude the `tests/wasm_tests/mod.rs` file referenced by the explicit `[[test]]` target below. That makes the packaged crate inconsistent (and can cause `cargo test --features sys-thread` to fail for consumers, or even `cargo package`/`cargo publish`... | true | |||
wasmerio/wasmer | 6,660 | comment_to_fix | fix(cargo): publish | `exclude = ["tests/wasm_tests/**"]` will also exclude the `tests/wasm_tests/mod.rs` file referenced by the explicit `[[test]]` target below. That makes the packaged crate inconsistent (and can cause `cargo test --features sys-thread` to fail for consumers, or even `cargo package`/`cargo publish` verification to error d... | b14f2e731c0c9c426496b0703caf0a2933e2eba4 | 5a8150144438b2ada347b6d02a5ea658e89b8bc6 | diff --git a/lib/wasix/Cargo.toml b/lib/wasix/Cargo.toml
index c7f7a156bd11..173cc4ccda58 100644
--- a/lib/wasix/Cargo.toml
+++ b/lib/wasix/Cargo.toml
@@ -11,6 +11,7 @@ homepage.workspace = true
license.workspace = true
repository.workspace = true
rust-version.workspace = true
+exclude = ["tests/wasm_tests/*/**"]
... | [
"lib/wasix/Cargo.toml"
] | [
{
"comment": "`exclude = [\"tests/wasm_tests/**\"]` will also exclude the `tests/wasm_tests/mod.rs` file referenced by the explicit `[[test]]` target below. That makes the packaged crate inconsistent (and can cause `cargo test --features sys-thread` to fail for consumers, or even `cargo package`/`cargo publish`... | true | ||
wasmerio/wasmer | 6,640 | issue_to_patch | perf(vm): thread-local cache for on_wasm_stack coroutine stacks | The hot path in on_wasm_stack pops and pushes coroutine stacks through a global crossbeam_queue::SegQueue. On a tight loop of typed Wasm calls, the atomic CAS on every pop/push dominates the call: SegQueue::pop ~23% and SegQueue::push ~17% of total cycles measured via perf record on a single-export bench.
Add a thre... | b14f2e731c0c9c426496b0703caf0a2933e2eba4 | 76a3ce2751c2d60577f93aa302bf68a740343816 | diff --git a/Cargo.toml b/Cargo.toml
index 160f7e61b8f3..3dce0c299e26 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -446,6 +446,10 @@ harness = false
name = "import_functions"
harness = false
+[[bench]]
+name = "typed_call"
+harness = false
+
[[example]]
name = "early-exit"
path = "examples/early_exit.rs"
diff --g... | [
"Cargo.toml",
"benches/typed_call.rs",
"lib/vm/src/trap/traphandlers.rs"
] | [
{
"comment": "In a re-entrant/nested `on_wasm_stack` call on the same thread, the outer call has already taken the TLS slot (now `None`), so the inner call's `release_stack` will place its stack into the TLS slot. When the outer call then completes and tries to `release_stack`, it will displace the inner's stac... | true | ||
wasmerio/wasmer | 6,640 | comment_to_fix | perf(vm): thread-local cache for on_wasm_stack coroutine stacks | In a re-entrant/nested `on_wasm_stack` call on the same thread, the outer call has already taken the TLS slot (now `None`), so the inner call's `release_stack` will place its stack into the TLS slot. When the outer call then completes and tries to `release_stack`, it will displace the inner's stack to the global `STACK... | b14f2e731c0c9c426496b0703caf0a2933e2eba4 | 76a3ce2751c2d60577f93aa302bf68a740343816 | diff --git a/lib/vm/src/trap/traphandlers.rs b/lib/vm/src/trap/traphandlers.rs
index 015c8b6c8d6e..8022c52211a9 100644
--- a/lib/vm/src/trap/traphandlers.rs
+++ b/lib/vm/src/trap/traphandlers.rs
@@ -88,22 +88,85 @@ pub fn get_stack_size() -> usize {
}
/// Pool of pre-allocated coroutine stacks to avoid repeated mma... | [
"lib/vm/src/trap/traphandlers.rs"
] | [
{
"comment": "In a re-entrant/nested `on_wasm_stack` call on the same thread, the outer call has already taken the TLS slot (now `None`), so the inner call's `release_stack` will place its stack into the TLS slot. When the outer call then completes and tries to `release_stack`, it will displace the inner's stac... | true | ||
wasmerio/wasmer | 6,640 | comment_to_fix | perf(vm): thread-local cache for on_wasm_stack coroutine stacks | This test (and `tls_stack_caches_after_first_call`) leaves no explicit cleanup of `TLS_STACK` on the test-runner thread for the first test, and the cleanup in `tls_stack_caches_after_first_call` (line 1490) only clears the slot — the stack is dropped rather than returned to the pool. Since tests share threads in the de... | b14f2e731c0c9c426496b0703caf0a2933e2eba4 | 76a3ce2751c2d60577f93aa302bf68a740343816 | diff --git a/lib/vm/src/trap/traphandlers.rs b/lib/vm/src/trap/traphandlers.rs
index 015c8b6c8d6e..8022c52211a9 100644
--- a/lib/vm/src/trap/traphandlers.rs
+++ b/lib/vm/src/trap/traphandlers.rs
@@ -88,22 +88,85 @@ pub fn get_stack_size() -> usize {
}
/// Pool of pre-allocated coroutine stacks to avoid repeated mma... | [
"lib/vm/src/trap/traphandlers.rs"
] | [
{
"comment": "This test (and `tls_stack_caches_after_first_call`) leaves no explicit cleanup of `TLS_STACK` on the test-runner thread for the first test, and the cleanup in `tls_stack_caches_after_first_call` (line 1490) only clears the slot — the stack is dropped rather than returned to the pool. Since tests s... | true | ||
wasmerio/wasmer | 6,640 | comment_to_fix | perf(vm): thread-local cache for on_wasm_stack coroutine stacks | This test holds `GLOBAL_STATE` lock on the main thread while the spawned thread runs `on_wasm_stack`. If `on_wasm_stack` (or any code it transitively calls) ever tries to acquire `GLOBAL_STATE`, this will deadlock. It's fine today, but consider releasing the lock before `handle.join()` or documenting why the spawned th... | b14f2e731c0c9c426496b0703caf0a2933e2eba4 | 76a3ce2751c2d60577f93aa302bf68a740343816 | diff --git a/lib/vm/src/trap/traphandlers.rs b/lib/vm/src/trap/traphandlers.rs
index 015c8b6c8d6e..8022c52211a9 100644
--- a/lib/vm/src/trap/traphandlers.rs
+++ b/lib/vm/src/trap/traphandlers.rs
@@ -88,22 +88,85 @@ pub fn get_stack_size() -> usize {
}
/// Pool of pre-allocated coroutine stacks to avoid repeated mma... | [
"lib/vm/src/trap/traphandlers.rs"
] | [
{
"comment": "This test holds `GLOBAL_STATE` lock on the main thread while the spawned thread runs `on_wasm_stack`. If `on_wasm_stack` (or any code it transitively calls) ever tries to acquire `GLOBAL_STATE`, this will deadlock. It's fine today, but consider releasing the lock before `handle.join()` or document... | true | ||
wasmerio/wasmer | 6,645 | issue_to_patch | tests: run WASI FYI with Singlepass as well | Issue: #6566 | caf909f12ce8124141fb1d32c12c51ad8b335e20 | bc88c5b739b1e248f932478a656af484454f8d0d | diff --git a/lib/wasix/Cargo.toml b/lib/wasix/Cargo.toml
index 170d5b8c05f8..8c28641d1ac7 100644
--- a/lib/wasix/Cargo.toml
+++ b/lib/wasix/Cargo.toml
@@ -233,6 +233,7 @@ journal = ["tokio/fs", "wasmer-journal/log-file"]
# Deprecated. Kept it for compatibility
compiler = []
+singlepass = ["wasmer/singlepass"]
v8 =... | [
"lib/wasix/Cargo.toml",
"lib/wasix/tests/wasm_tests/mod.rs",
"lib/wasix/tests/wasm_tests/runner.rs"
] | [
{
"comment": "`OsStr` is imported unconditionally but only used inside `#[cfg(feature = \"singlepass\")]` blocks. When the `singlepass` feature is disabled this becomes an unused import and will fail under the repo's `-D unused-imports`/clippy settings.",
"path": "lib/wasix/tests/wasm_tests/mod.rs",
"hu... | diff --git a/lib/wasix/tests/wasm_tests/mod.rs b/lib/wasix/tests/wasm_tests/mod.rs
index d64104af823c..d0ea4b788c9e 100644
--- a/lib/wasix/tests/wasm_tests/mod.rs
+++ b/lib/wasix/tests/wasm_tests/mod.rs
@@ -40,7 +40,7 @@
//! `Ignored:{reason}` marks the configuration as ignored with the given reason.
//!
//! `SkipEn... | true | |
wasmerio/wasmer | 6,645 | comment_to_fix | tests: run WASI FYI with Singlepass as well | `OsStr` is imported unconditionally but only used inside `#[cfg(feature = "singlepass")]` blocks. When the `singlepass` feature is disabled this becomes an unused import and will fail under the repo's `-D unused-imports`/clippy settings. | caf909f12ce8124141fb1d32c12c51ad8b335e20 | bc88c5b739b1e248f932478a656af484454f8d0d | diff --git a/lib/wasix/tests/wasm_tests/mod.rs b/lib/wasix/tests/wasm_tests/mod.rs
index d64104af823c..d0ea4b788c9e 100644
--- a/lib/wasix/tests/wasm_tests/mod.rs
+++ b/lib/wasix/tests/wasm_tests/mod.rs
@@ -40,7 +40,7 @@
//! `Ignored:{reason}` marks the configuration as ignored with the given reason.
//!
//! `SkipEn... | [
"lib/wasix/tests/wasm_tests/mod.rs"
] | [
{
"comment": "`OsStr` is imported unconditionally but only used inside `#[cfg(feature = \"singlepass\")]` blocks. When the `singlepass` feature is disabled this becomes an unused import and will fail under the repo's `-D unused-imports`/clippy settings.",
"path": "lib/wasix/tests/wasm_tests/mod.rs",
"hu... | true | ||
wasmerio/wasmer | 6,645 | comment_to_fix | tests: run WASI FYI with Singlepass as well | `create_engine_for_wasm` explicitly limits compilation to a single thread to avoid contention when many tests run in parallel, but the new Singlepass arm doesn't apply the same `num_threads(1)` setting. This can increase CPU usage / reduce test stability compared to LLVM/Cranelift. | caf909f12ce8124141fb1d32c12c51ad8b335e20 | bc88c5b739b1e248f932478a656af484454f8d0d | diff --git a/lib/wasix/tests/wasm_tests/runner.rs b/lib/wasix/tests/wasm_tests/runner.rs
index 73bd1f77a282..60789e29f133 100644
--- a/lib/wasix/tests/wasm_tests/runner.rs
+++ b/lib/wasix/tests/wasm_tests/runner.rs
@@ -265,6 +265,8 @@ fn create_engine_for_wasm(wasm_bytes: &[u8], engine: Engine) -> wasmer::Engine {
... | [
"lib/wasix/tests/wasm_tests/runner.rs"
] | [
{
"comment": "`create_engine_for_wasm` explicitly limits compilation to a single thread to avoid contention when many tests run in parallel, but the new Singlepass arm doesn't apply the same `num_threads(1)` setting. This can increase CPU usage / reduce test stability compared to LLVM/Cranelift.",
"path": "... | true | ||
wasmerio/wasmer | 6,645 | comment_to_fix | tests: run WASI FYI with Singlepass as well | Now that `Engine::Singlepass` is a runnable engine, the `SkipEngine:{engine}:{reason}` directive should be able to recognize `singlepass` too. Currently the directive parser only accepts `llvm`, `cranelift`, and `v8`, so fixtures can’t selectively skip failing configs for Singlepass without ignoring them for all engine... | caf909f12ce8124141fb1d32c12c51ad8b335e20 | bc88c5b739b1e248f932478a656af484454f8d0d | diff --git a/lib/wasix/tests/wasm_tests/mod.rs b/lib/wasix/tests/wasm_tests/mod.rs
index d64104af823c..d0ea4b788c9e 100644
--- a/lib/wasix/tests/wasm_tests/mod.rs
+++ b/lib/wasix/tests/wasm_tests/mod.rs
@@ -40,7 +40,7 @@
//! `Ignored:{reason}` marks the configuration as ignored with the given reason.
//!
//! `SkipEn... | [
"lib/wasix/tests/wasm_tests/mod.rs"
] | [
{
"comment": "Now that `Engine::Singlepass` is a runnable engine, the `SkipEngine:{engine}:{reason}` directive should be able to recognize `singlepass` too. Currently the directive parser only accepts `llvm`, `cranelift`, and `v8`, so fixtures can’t selectively skip failing configs for Singlepass without ignori... | true | ||
wasmerio/wasmer | 6,467 | issue_to_patch | WASIX: fix writing to unlinked files with reference counting and POSIX-compliant unlink()/rmdir() API
We used to have a PR that only served as a TODO list placeholder: #6129 | Fix FDs becoming invalid once their file is unlinked | Fixes: #6360. | cd2344ac409e2981dda47b534b5d0ce59deae876 | 2bf777c8cc2c6abde45eb1ced04bc67fc71cfa27 | diff --git a/lib/virtual-fs/src/lib.rs b/lib/virtual-fs/src/lib.rs
index 7fbc71182649..0f45c3549b0e 100644
--- a/lib/virtual-fs/src/lib.rs
+++ b/lib/virtual-fs/src/lib.rs
@@ -361,7 +361,11 @@ pub trait VirtualFile:
/// the extra bytes will be allocated and zeroed
fn set_len(&mut self, new_size: u64) -> Result... | [
"lib/virtual-fs/src/lib.rs",
"lib/virtual-fs/src/mem_fs/file.rs",
"lib/virtual-fs/src/mem_fs/file_opener.rs",
"lib/virtual-fs/src/mem_fs/filesystem.rs",
"lib/virtual-fs/src/mem_fs/mod.rs",
"lib/virtual-fs/src/overlay_fs.rs",
"tests/wasix/unlink-open-fd-write-after-unlink/main.c",
"tests/wasix/unlink-o... | [
{
"comment": "Open-handle tracking is used to decide whether `unlink_file_inode` can remove the inode immediately, but `lifecycle.opened()` is called inside `FileHandle::new()` after the filesystem write-lock has been released. This leaves a race where another thread can unlink the file between dropping the loc... | diff --git a/tests/wasix/unlink-open-fd-write-after-unlink/main.c b/tests/wasix/unlink-open-fd-write-after-unlink/main.c
new file mode 100644
index 000000000000..90c8fd855de6
--- /dev/null
+++ b/tests/wasix/unlink-open-fd-write-after-unlink/main.c
@@ -0,0 +1,165 @@
+#include <errno.h>
+#include <fcntl.h>
+#include <std... | true |
wasmerio/wasmer | 6,467 | comment_to_fix | Fix FDs becoming invalid once their file is unlinked | Open-handle tracking is used to decide whether `unlink_file_inode` can remove the inode immediately, but `lifecycle.opened()` is called inside `FileHandle::new()` after the filesystem write-lock has been released. This leaves a race where another thread can unlink the file between dropping the lock and incrementing `op... | cd2344ac409e2981dda47b534b5d0ce59deae876 | 2bf777c8cc2c6abde45eb1ced04bc67fc71cfa27 | diff --git a/lib/virtual-fs/src/mem_fs/file_opener.rs b/lib/virtual-fs/src/mem_fs/file_opener.rs
index fac028187519..2047b00e6e00 100644
--- a/lib/virtual-fs/src/mem_fs/file_opener.rs
+++ b/lib/virtual-fs/src/mem_fs/file_opener.rs
@@ -51,6 +51,7 @@ impl FileSystem {
len: file_len,
... | [
"lib/virtual-fs/src/mem_fs/file_opener.rs"
] | [
{
"comment": "Open-handle tracking is used to decide whether `unlink_file_inode` can remove the inode immediately, but `lifecycle.opened()` is called inside `FileHandle::new()` after the filesystem write-lock has been released. This leaves a race where another thread can unlink the file between dropping the loc... | true | ||
wasmerio/wasmer | 6,467 | comment_to_fix | Fix FDs becoming invalid once their file is unlinked | `handle_lifecycle` extraction treats `InodeResolution::Redirect(..)` as `unreachable!()`, but `maybe_inode_of_file` can legitimately be a redirect (e.g. when the parent is an `ArcDirectory`). This will panic on open rather than following the redirect logic handled later in the function. Handle the redirect here (e.g. e... | cd2344ac409e2981dda47b534b5d0ce59deae876 | 2bf777c8cc2c6abde45eb1ced04bc67fc71cfa27 | diff --git a/lib/virtual-fs/src/mem_fs/file_opener.rs b/lib/virtual-fs/src/mem_fs/file_opener.rs
index fac028187519..2047b00e6e00 100644
--- a/lib/virtual-fs/src/mem_fs/file_opener.rs
+++ b/lib/virtual-fs/src/mem_fs/file_opener.rs
@@ -51,6 +51,7 @@ impl FileSystem {
len: file_len,
... | [
"lib/virtual-fs/src/mem_fs/file_opener.rs"
] | [
{
"comment": "`handle_lifecycle` extraction treats `InodeResolution::Redirect(..)` as `unreachable!()`, but `maybe_inode_of_file` can legitimately be a redirect (e.g. when the parent is an `ArcDirectory`). This will panic on open rather than following the redirect logic handled later in the function. Handle the... | true | ||
wasmerio/wasmer | 6,467 | comment_to_fix | Fix FDs becoming invalid once their file is unlinked | `SecondaryFile` wraps the underlying `VirtualFile`, but this `VirtualFile` impl only forwards a subset of methods. Because `VirtualFile` provides defaults for methods like `get_special_fd()`, `is_open()`, `as_owned_buffer()`, and `write_from_mmap()`, the wrapper will silently change behavior for secondary files that ov... | cd2344ac409e2981dda47b534b5d0ce59deae876 | 2bf777c8cc2c6abde45eb1ced04bc67fc71cfa27 | diff --git a/lib/virtual-fs/src/overlay_fs.rs b/lib/virtual-fs/src/overlay_fs.rs
index 0eff1b11d430..de9366bf4785 100644
--- a/lib/virtual-fs/src/overlay_fs.rs
+++ b/lib/virtual-fs/src/overlay_fs.rs
@@ -17,6 +17,168 @@ use crate::{
ReadDir, VirtualFile, ops,
};
+fn unlink_overlay_path<P>(primary: &Arc<P>, path:... | [
"lib/virtual-fs/src/overlay_fs.rs"
] | [
{
"comment": "`SecondaryFile` wraps the underlying `VirtualFile`, but this `VirtualFile` impl only forwards a subset of methods. Because `VirtualFile` provides defaults for methods like `get_special_fd()`, `is_open()`, `as_owned_buffer()`, and `write_from_mmap()`, the wrapper will silently change behavior for s... | true | ||
wasmerio/wasmer | 6,467 | comment_to_fix | Fix FDs becoming invalid once their file is unlinked | `FileLifecycle::closed()` uses `fetch_sub(1) - 1`, which will underflow (wrapping to `usize::MAX`) if `closed()` is ever called when the count is 0 (e.g., if a handle is dropped without a matching `opened()` due to an early-return path or future refactor). This can mask accounting bugs and prevent storage reclamation. ... | cd2344ac409e2981dda47b534b5d0ce59deae876 | 2bf777c8cc2c6abde45eb1ced04bc67fc71cfa27 | diff --git a/lib/virtual-fs/src/mem_fs/mod.rs b/lib/virtual-fs/src/mem_fs/mod.rs
index db2ba68b625e..a1363737bb8d 100644
--- a/lib/virtual-fs/src/mem_fs/mod.rs
+++ b/lib/virtual-fs/src/mem_fs/mod.rs
@@ -17,7 +17,10 @@ use crate::Metadata;
use std::{
ffi::{OsStr, OsString},
path::PathBuf,
- sync::{Arc, Mut... | [
"lib/virtual-fs/src/mem_fs/mod.rs"
] | [
{
"comment": "`FileLifecycle::closed()` uses `fetch_sub(1) - 1`, which will underflow (wrapping to `usize::MAX`) if `closed()` is ever called when the count is 0 (e.g., if a handle is dropped without a matching `opened()` due to an early-return path or future refactor). This can mask accounting bugs and prevent... | true | ||
wasmerio/wasmer | 6,467 | comment_to_fix | Fix FDs becoming invalid once their file is unlinked | The `OnceLock` + global `Mutex<Option<...>>` hook introduces shared mutable global state across the entire test binary. Since Rust tests run in parallel by default, this can make tests flaky (a different test could trigger `run_open_before_handle_hook()` while the hook is set, or a panic could leave a hook installed fo... | cd2344ac409e2981dda47b534b5d0ce59deae876 | 2bf777c8cc2c6abde45eb1ced04bc67fc71cfa27 | diff --git a/lib/virtual-fs/src/mem_fs/file_opener.rs b/lib/virtual-fs/src/mem_fs/file_opener.rs
index fac028187519..2047b00e6e00 100644
--- a/lib/virtual-fs/src/mem_fs/file_opener.rs
+++ b/lib/virtual-fs/src/mem_fs/file_opener.rs
@@ -51,6 +51,7 @@ impl FileSystem {
len: file_len,
... | [
"lib/virtual-fs/src/mem_fs/file_opener.rs"
] | [
{
"comment": "The `OnceLock` + global `Mutex<Option<...>>` hook introduces shared mutable global state across the entire test binary. Since Rust tests run in parallel by default, this can make tests flaky (a different test could trigger `run_open_before_handle_hook()` while the hook is set, or a panic could lea... | true | ||
wasmerio/wasmer | 6,467 | comment_to_fix | Fix FDs becoming invalid once their file is unlinked | `unlink_overlay_path` discards the specific error from `ops::create_white_out()` and then may return `FsError::PermissionDenied` when `primary.remove_file()` fails with `EntryNotFound`/`InvalidInput`/`BaseNotDirectory`. This can produce misleading results, e.g. if the whiteout already exists (`create_white_out` returns... | cd2344ac409e2981dda47b534b5d0ce59deae876 | 2bf777c8cc2c6abde45eb1ced04bc67fc71cfa27 | diff --git a/lib/virtual-fs/src/overlay_fs.rs b/lib/virtual-fs/src/overlay_fs.rs
index 0eff1b11d430..de9366bf4785 100644
--- a/lib/virtual-fs/src/overlay_fs.rs
+++ b/lib/virtual-fs/src/overlay_fs.rs
@@ -17,6 +17,168 @@ use crate::{
ReadDir, VirtualFile, ops,
};
+fn unlink_overlay_path<P>(primary: &Arc<P>, path:... | [
"lib/virtual-fs/src/overlay_fs.rs"
] | [
{
"comment": "`unlink_overlay_path` discards the specific error from `ops::create_white_out()` and then may return `FsError::PermissionDenied` when `primary.remove_file()` fails with `EntryNotFound`/`InvalidInput`/`BaseNotDirectory`. This can produce misleading results, e.g. if the whiteout already exists (`cre... | true | ||
wasmerio/wasmer | 6,467 | comment_to_fix | Fix FDs becoming invalid once their file is unlinked | This helper only has the pathname, so an FD opened from a secondary/COW file will unlink whatever is currently bound to that path. If the path gets recreated before the old FD calls `unlink()`, the old handle will delete or whiteout the replacement instead of detaching the originally opened object. That is a real corre... | cd2344ac409e2981dda47b534b5d0ce59deae876 | 2bf777c8cc2c6abde45eb1ced04bc67fc71cfa27 | diff --git a/lib/virtual-fs/src/overlay_fs.rs b/lib/virtual-fs/src/overlay_fs.rs
index 0eff1b11d430..de9366bf4785 100644
--- a/lib/virtual-fs/src/overlay_fs.rs
+++ b/lib/virtual-fs/src/overlay_fs.rs
@@ -17,6 +17,168 @@ use crate::{
ReadDir, VirtualFile, ops,
};
+fn unlink_overlay_path<P>(primary: &Arc<P>, path:... | [
"lib/virtual-fs/src/overlay_fs.rs"
] | [
{
"comment": "This helper only has the pathname, so an FD opened from a secondary/COW file will unlink whatever is currently bound to that path. If the path gets recreated before the old FD calls `unlink()`, the old handle will delete or whiteout the replacement instead of detaching the originally opened object... | true | ||
wasmerio/wasmer | 6,467 | comment_to_fix | Fix FDs becoming invalid once their file is unlinked | If `create_white_out()` failed but `primary.remove_file(path)` succeeds, this still returns success via the `other => other` arm. In that case the lower-layer file becomes visible again, so the overlay unlink did not actually succeed. Whiteout creation needs to be treated as part of the operation whenever a lower-layer... | cd2344ac409e2981dda47b534b5d0ce59deae876 | 2bf777c8cc2c6abde45eb1ced04bc67fc71cfa27 | diff --git a/lib/virtual-fs/src/overlay_fs.rs b/lib/virtual-fs/src/overlay_fs.rs
index 0eff1b11d430..de9366bf4785 100644
--- a/lib/virtual-fs/src/overlay_fs.rs
+++ b/lib/virtual-fs/src/overlay_fs.rs
@@ -17,6 +17,168 @@ use crate::{
ReadDir, VirtualFile, ops,
};
+fn unlink_overlay_path<P>(primary: &Arc<P>, path:... | [
"lib/virtual-fs/src/overlay_fs.rs"
] | [
{
"comment": "If `create_white_out()` failed but `primary.remove_file(path)` succeeds, this still returns success via the `other => other` arm. In that case the lower-layer file becomes visible again, so the overlay unlink did not actually succeed. Whiteout creation needs to be treated as part of the operation ... | true | ||
wasmerio/wasmer | 6,659 | issue_to_patch | Release 7.2.0-alpha.3 | [bot] Release wasmer version 7.2.0-alpha.3 | cd2344ac409e2981dda47b534b5d0ce59deae876 | cd08dcc5784cfa71aad3717d4f560c5d83cb4f59 | diff --git a/CHANGELOG.md b/CHANGELOG.md
index 37899ec72db7..5c64001b9efd 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,92 @@
## **Unreleased**
+## 7.2.0-alpha.3 - 01/06/2026
+
+## Added
+
+ - [#6604](https://github.com/wasmerio/wasmer/pull/6604) Add soft-float libcall support for LLVM backend on hardwa... | [
"CHANGELOG.md",
"Cargo.lock",
"Cargo.toml",
"lib/api/Cargo.toml",
"lib/backend-api/Cargo.toml",
"lib/c-api/Cargo.toml",
"lib/cache/Cargo.toml",
"lib/cli/Cargo.toml",
"lib/compiler-cranelift/Cargo.toml",
"lib/compiler-llvm/Cargo.toml",
"lib/compiler-singlepass/Cargo.toml",
"lib/compiler/Cargo.t... | [] | diff --git a/tests/integration/cli/Cargo.toml b/tests/integration/cli/Cargo.toml
index a98b675655a3..5e2262ce101b 100644
--- a/tests/integration/cli/Cargo.toml
+++ b/tests/integration/cli/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "wasmer-integration-tests-cli"
-version = "7.2.0-alpha.2"
+version = "7.2.0-alpha.3"
... | true | |
wasmerio/wasmer | 6,652 | issue_to_patch | fix(virtual-fs): correct mem_fs poll_write_ready behavior | # Description
`poll_write_ready()` in `mem_fs` was checking read perms, so write-only handles came back `PermissionDenied`.
`CustomFile` and `ArcFile` also got forwarded to `poll_read_ready()`, so write readiness was kinda wrong there too.
Repro before this patch:
`cargo test -p virtual-fs poll_write_ready -- --nocapt... | a21e070815ac2cb24ed9475c3f35d03445c0344a | 1c68a734d53d8f7e9b10621c04596b642553ce09 | diff --git a/lib/virtual-fs/src/mem_fs/file.rs b/lib/virtual-fs/src/mem_fs/file.rs
index 91767c6c5b87..9e1b4b00f806 100644
--- a/lib/virtual-fs/src/mem_fs/file.rs
+++ b/lib/virtual-fs/src/mem_fs/file.rs
@@ -441,11 +441,11 @@ impl VirtualFile for FileHandle {
}
fn poll_write_ready(mut self: Pin<&mut Self>, c... | [
"lib/virtual-fs/src/mem_fs/file.rs"
] | [] | true | ||
wasmerio/wasmer | 6,653 | issue_to_patch | Symlinks webc | Added support for packages with symlinks (based on webc v12) | df7b69a3da75ced15ce2fee28cec72d59314a881 | e3ec9729fba770c67c343973db2858edb0893f25 | diff --git a/Cargo.lock b/Cargo.lock
index d70fac0debb0..95385dfc919d 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -7876,9 +7876,9 @@ dependencies = [
[[package]]
name = "webc"
-version = "11.0.0"
+version = "12.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "20b8b523112384e8c1caf... | [
"Cargo.lock",
"Cargo.toml",
"lib/cli/src/commands/create_exe.rs",
"lib/package/src/package/package.rs",
"lib/package/src/package/volume/fs.rs",
"lib/package/src/package/volume/in_memory.rs",
"lib/virtual-fs/src/webc_volume_fs.rs",
"lib/wasix/src/fs/mod.rs"
] | [
{
"comment": "`FsVolume::metadata()` currently returns `None` if `Timestamps::from_metadata(&meta)` fails. That causes entries (including symlinks) to effectively disappear from the packaged volume on platforms/filesystems where timestamp extraction isn’t supported or errors. Prefer returning metadata with `tim... | true | ||
wasmerio/wasmer | 6,653 | comment_to_fix | Symlinks webc | `FsVolume::metadata()` currently returns `None` if `Timestamps::from_metadata(&meta)` fails. That causes entries (including symlinks) to effectively disappear from the packaged volume on platforms/filesystems where timestamp extraction isn’t supported or errors. Prefer returning metadata with `timestamps: None` instead... | df7b69a3da75ced15ce2fee28cec72d59314a881 | e3ec9729fba770c67c343973db2858edb0893f25 | diff --git a/lib/package/src/package/volume/fs.rs b/lib/package/src/package/volume/fs.rs
index 6077a191a40b..3cb349148481 100644
--- a/lib/package/src/package/volume/fs.rs
+++ b/lib/package/src/package/volume/fs.rs
@@ -1,7 +1,7 @@
use std::{
collections::{BTreeMap, BTreeSet},
fmt::Debug,
- fs::File,
+ ... | [
"lib/package/src/package/volume/fs.rs"
] | [
{
"comment": "`FsVolume::metadata()` currently returns `None` if `Timestamps::from_metadata(&meta)` fails. That causes entries (including symlinks) to effectively disappear from the packaged volume on platforms/filesystems where timestamp extraction isn’t supported or errors. Prefer returning metadata with `tim... | true | ||
wasmerio/wasmer | 6,653 | comment_to_fix | Symlinks webc | When serializing a volume to WebC v1, symlink entries are silently dropped. This can produce executables with missing files/dirs and no indication of why. If v1 can’t represent symlinks, emit at least a warning so users can diagnose the issue (or consider failing fast). | df7b69a3da75ced15ce2fee28cec72d59314a881 | e3ec9729fba770c67c343973db2858edb0893f25 | diff --git a/lib/cli/src/commands/create_exe.rs b/lib/cli/src/commands/create_exe.rs
index 3001a216005e..743ddc0a0dee 100644
--- a/lib/cli/src/commands/create_exe.rs
+++ b/lib/cli/src/commands/create_exe.rs
@@ -541,6 +541,7 @@ fn serialize_volume_to_webc_v1(volume: &WebcVolume) -> Vec<u8> {
);
... | [
"lib/cli/src/commands/create_exe.rs"
] | [
{
"comment": "When serializing a volume to WebC v1, symlink entries are silently dropped. This can produce executables with missing files/dirs and no indication of why. If v1 can’t represent symlinks, emit at least a warning so users can diagnose the issue (or consider failing fast).",
"path": "lib/cli/src/... | true | ||
wasmerio/wasmer | 6,653 | comment_to_fix | Symlinks webc | `FsVolume::metadata()` currently returns `None` if `Timestamps::from_metadata(&meta)` fails. That causes entries (including symlinks) to effectively disappear from the packaged volume on platforms/filesystems where timestamp extraction isn’t supported or errors. Prefer returning metadata with `timestamps: None` instead... | df7b69a3da75ced15ce2fee28cec72d59314a881 | e3ec9729fba770c67c343973db2858edb0893f25 | diff --git a/lib/package/src/package/volume/fs.rs b/lib/package/src/package/volume/fs.rs
index 6077a191a40b..3cb349148481 100644
--- a/lib/package/src/package/volume/fs.rs
+++ b/lib/package/src/package/volume/fs.rs
@@ -1,7 +1,7 @@
use std::{
collections::{BTreeMap, BTreeSet},
fmt::Debug,
- fs::File,
+ ... | [
"lib/package/src/package/volume/fs.rs"
] | [
{
"comment": "`FsVolume::metadata()` currently returns `None` if `Timestamps::from_metadata(&meta)` fails. That causes entries (including symlinks) to effectively disappear from the packaged volume on platforms/filesystems where timestamp extraction isn’t supported or errors. Prefer returning metadata with `tim... | true | ||
wasmerio/wasmer | 6,653 | comment_to_fix | Symlinks webc | When serializing a volume to WebC v1, symlink entries are silently dropped. This can produce executables with missing files/dirs and no indication of why. If v1 can’t represent symlinks, emit at least a warning so users can diagnose the issue (or consider failing fast). | df7b69a3da75ced15ce2fee28cec72d59314a881 | e3ec9729fba770c67c343973db2858edb0893f25 | diff --git a/lib/cli/src/commands/create_exe.rs b/lib/cli/src/commands/create_exe.rs
index 3001a216005e..743ddc0a0dee 100644
--- a/lib/cli/src/commands/create_exe.rs
+++ b/lib/cli/src/commands/create_exe.rs
@@ -541,6 +541,7 @@ fn serialize_volume_to_webc_v1(volume: &WebcVolume) -> Vec<u8> {
);
... | [
"lib/cli/src/commands/create_exe.rs"
] | [
{
"comment": "When serializing a volume to WebC v1, symlink entries are silently dropped. This can produce executables with missing files/dirs and no indication of why. If v1 can’t represent symlinks, emit at least a warning so users can diagnose the issue (or consider failing fast).",
"path": "lib/cli/src/... | true | ||
wasmerio/wasmer | 6,647 | issue_to_patch | Refactor duplicated logic to `function_extents()` helper | A small follow-up to https://github.com/wasmerio/wasmer/pull/6603: moving duplicated logic between `internal_register_frame_info` and `finished_function_extents` into a local helper on `AllocatedArtifact`. This also ensures that `internal_register_frame_info` has the same length matching assertion. | 7ea276ea9f3c886b5c759eeccdb3f667db5bf078 | 65cc3f04a2c1ade600a9a3d247adbb5df3d72f07 | diff --git a/lib/compiler/src/engine/artifact.rs b/lib/compiler/src/engine/artifact.rs
index f2be6afe9d49..a19c9a3ff049 100644
--- a/lib/compiler/src/engine/artifact.rs
+++ b/lib/compiler/src/engine/artifact.rs
@@ -67,6 +67,23 @@ pub struct AllocatedArtifact {
finished_function_lengths: BoxedSlice<LocalFunctionInd... | [
"lib/compiler/src/engine/artifact.rs"
] | [] | true | ||
wasmerio/wasmer | 6,626 | issue_to_patch | Fix WASIX symlink resolution for path components | This fixes WASIX path resolution so symlinks are handled consistently during component traversal.
Changes:
- Resolve intermediate symlink components even when the final component should not be followed.
- Follow the final symlink only when `follow_symlinks` is enabled.
- Cache backing filesystem symlinks as `Ki... | d529bf7f901f50f8858c3808d8fe385bd6093acf | 1031ba8ce884d5f2d1a5d38d7cd4bf262cfba2f1 | diff --git a/lib/virtual-fs/src/arc_fs.rs b/lib/virtual-fs/src/arc_fs.rs
index 472985a0ed10..d3ca55c82b09 100644
--- a/lib/virtual-fs/src/arc_fs.rs
+++ b/lib/virtual-fs/src/arc_fs.rs
@@ -38,6 +38,10 @@ impl FileSystem for ArcFileSystem {
self.fs.create_symlink(source, target)
}
+ fn hard_link(&self, ... | [
"lib/virtual-fs/src/arc_fs.rs",
"lib/virtual-fs/src/host_fs.rs",
"lib/virtual-fs/src/lib.rs",
"lib/virtual-fs/src/mount_fs.rs",
"lib/virtual-fs/src/overlay_fs.rs",
"lib/virtual-fs/src/passthru_fs.rs",
"lib/virtual-fs/src/tmp_fs.rs",
"lib/wasix/src/fs/fd.rs",
"lib/wasix/src/fs/mod.rs",
"lib/wasix/s... | [
{
"comment": "For readability, let's declare that outside the function.",
"path": "lib/wasix/src/fs/mod.rs",
"hunk": "@@ -1135,101 +1135,147 @@ impl WasiFs {\n // assume '/a/b' to be the same as `a/b` relative to the inode, so\n // we skip over the RootDir component.\n ... | true | ||
wasmerio/wasmer | 6,626 | comment_to_fix | Fix WASIX symlink resolution for path components | For readability, let's declare that outside the function. | d529bf7f901f50f8858c3808d8fe385bd6093acf | 1031ba8ce884d5f2d1a5d38d7cd4bf262cfba2f1 | diff --git a/lib/wasix/src/fs/mod.rs b/lib/wasix/src/fs/mod.rs
index 8e83a0f2b2f9..c64cbb6b1b75 100644
--- a/lib/wasix/src/fs/mod.rs
+++ b/lib/wasix/src/fs/mod.rs
@@ -18,12 +18,13 @@ mod fd;
mod fd_list;
mod inode_guard;
mod notification;
+mod path_posix;
use std::{
- borrow::{Borrow, Cow},
+ borrow::Cow,
... | [
"lib/wasix/src/fs/mod.rs"
] | [
{
"comment": "For readability, let's declare that outside the function.",
"path": "lib/wasix/src/fs/mod.rs",
"hunk": "@@ -1135,101 +1135,147 @@ impl WasiFs {\n // assume '/a/b' to be the same as `a/b` relative to the inode, so\n // we skip over the RootDir component.\n ... | true | ||
wasmerio/wasmer | 6,626 | comment_to_fix | Fix WASIX symlink resolution for path components | This should be changed to: `follow_symlinks || !last_component`, because for /A/B/C where B->Z and C->Y:
- follow=true => /Z/Y
- follow=false => /Z/C
So for B we pass `!last_component` (always true), and for C `follow_symlinks`. | d529bf7f901f50f8858c3808d8fe385bd6093acf | 1031ba8ce884d5f2d1a5d38d7cd4bf262cfba2f1 | diff --git a/lib/wasix/src/fs/mod.rs b/lib/wasix/src/fs/mod.rs
index 8e83a0f2b2f9..c64cbb6b1b75 100644
--- a/lib/wasix/src/fs/mod.rs
+++ b/lib/wasix/src/fs/mod.rs
@@ -18,12 +18,13 @@ mod fd;
mod fd_list;
mod inode_guard;
mod notification;
+mod path_posix;
use std::{
- borrow::{Borrow, Cow},
+ borrow::Cow,
... | [
"lib/wasix/src/fs/mod.rs"
] | [
{
"comment": "This should be changed to: `follow_symlinks || !last_component`, because for /A/B/C where B->Z and C->Y:\n\n- follow=true => /Z/Y\n- follow=false => /Z/C\n\nSo for B we pass `!last_component` (always true), and for C `follow_symlinks`.",
"path": "lib/wasix/src/fs/mod.rs",
"hunk": "@@ -1272... | true | ||
wasmerio/wasmer | 6,626 | comment_to_fix | Fix WASIX symlink resolution for path components | `entry_names.contains(*name)` attempts to move out of `&String` (and won’t compile). Use `contains(name)` instead to compare by reference. | d529bf7f901f50f8858c3808d8fe385bd6093acf | 1031ba8ce884d5f2d1a5d38d7cd4bf262cfba2f1 | diff --git a/lib/wasix/src/syscalls/wasi/fd_readdir.rs b/lib/wasix/src/syscalls/wasi/fd_readdir.rs
index 5672ab5f6ff6..7a351a1cb844 100644
--- a/lib/wasix/src/syscalls/wasi/fd_readdir.rs
+++ b/lib/wasix/src/syscalls/wasi/fd_readdir.rs
@@ -66,16 +66,17 @@ pub fn fd_readdir<M: MemorySize>(
})
... | [
"lib/wasix/src/syscalls/wasi/fd_readdir.rs"
] | [
{
"comment": "`entry_names.contains(*name)` attempts to move out of `&String` (and won’t compile). Use `contains(name)` instead to compare by reference.",
"path": "lib/wasix/src/syscalls/wasi/fd_readdir.rs",
"hunk": "@@ -66,16 +66,17 @@ pub fn fd_readdir<M: MemorySize>(\n })\n ... | true | ||
wasmerio/wasmer | 6,626 | comment_to_fix | Fix WASIX symlink resolution for path components | `relative_path_to_absolute` turns an empty pathname into a non-empty `cwd/` path, which can make `chdir("")` succeed instead of returning `Errno::Noent`. Reject the empty pathname before absolutizing so `chdir` matches the resolver’s empty-path behavior. | d529bf7f901f50f8858c3808d8fe385bd6093acf | 1031ba8ce884d5f2d1a5d38d7cd4bf262cfba2f1 | diff --git a/lib/wasix/src/syscalls/wasix/chdir.rs b/lib/wasix/src/syscalls/wasix/chdir.rs
index e7e5018d4d6c..6f120a381d39 100644
--- a/lib/wasix/src/syscalls/wasix/chdir.rs
+++ b/lib/wasix/src/syscalls/wasix/chdir.rs
@@ -30,14 +30,59 @@ pub fn chdir<M: MemorySize>(
Ok(Errno::Success)
}
+/// Change the WASIX c... | [
"lib/wasix/src/syscalls/wasix/chdir.rs"
] | [
{
"comment": "`relative_path_to_absolute` turns an empty pathname into a non-empty `cwd/` path, which can make `chdir(\"\")` succeed instead of returning `Errno::Noent`. Reject the empty pathname before absolutizing so `chdir` matches the resolver’s empty-path behavior.",
"path": "lib/wasix/src/syscalls/was... | true | ||
wasmerio/wasmer | 6,626 | comment_to_fix | Fix WASIX symlink resolution for path components | The host FS should not support creating links to avoid sandbox escape scenarios. | d529bf7f901f50f8858c3808d8fe385bd6093acf | 1031ba8ce884d5f2d1a5d38d7cd4bf262cfba2f1 | diff --git a/lib/virtual-fs/src/host_fs.rs b/lib/virtual-fs/src/host_fs.rs
index d7fff96808bb..1c51ef5d9fc8 100644
--- a/lib/virtual-fs/src/host_fs.rs
+++ b/lib/virtual-fs/src/host_fs.rs
@@ -67,6 +67,40 @@ pub fn normalize_path(path: &Path) -> PathBuf {
ret
}
+fn path_suffix_to_guest_absolute(stripped: &Path) -... | [
"lib/virtual-fs/src/host_fs.rs"
] | [
{
"comment": "The host FS should not support creating links to avoid sandbox escape scenarios.",
"path": "lib/virtual-fs/src/host_fs.rs",
"hunk": "@@ -138,6 +138,17 @@ impl crate::FileSystem for FileSystem {\n fs::create_dir(path).map_err(Into::into)\n }\n \n+ fn hard_link(&self, source: ... | true | ||
wasmerio/wasmer | 6,626 | comment_to_fix | Fix WASIX symlink resolution for path components | Why we need this function?
Is not this one better? (it doesn't require string lossy conversion)
```suggestion
path.is_absolute()
``` | d529bf7f901f50f8858c3808d8fe385bd6093acf | 1031ba8ce884d5f2d1a5d38d7cd4bf262cfba2f1 | diff --git a/lib/wasix/src/fs/mod.rs b/lib/wasix/src/fs/mod.rs
index 8e83a0f2b2f9..c64cbb6b1b75 100644
--- a/lib/wasix/src/fs/mod.rs
+++ b/lib/wasix/src/fs/mod.rs
@@ -18,12 +18,13 @@ mod fd;
mod fd_list;
mod inode_guard;
mod notification;
+mod path_posix;
use std::{
- borrow::{Borrow, Cow},
+ borrow::Cow,
... | [
"lib/wasix/src/fs/mod.rs"
] | [
{
"comment": "Why we need this function? \n\nIs not this one better? (it doesn't require string lossy conversion)\n\n```suggestion\n path.is_absolute()\n```",
"path": "lib/wasix/src/fs/mod.rs",
"hunk": "@@ -302,26 +331,181 @@ pub struct WasiInodes {\n protected: Arc<RwLock<WasiInodesProtected>>,\... | true | ||
wasmerio/wasmer | 6,626 | comment_to_fix | Fix WASIX symlink resolution for path components | Why not this?
```suggestion
PathBuf::from(path.strip_prefix("/").unwrap_or(path))
``` | d529bf7f901f50f8858c3808d8fe385bd6093acf | 1031ba8ce884d5f2d1a5d38d7cd4bf262cfba2f1 | diff --git a/lib/wasix/src/fs/mod.rs b/lib/wasix/src/fs/mod.rs
index 8e83a0f2b2f9..c64cbb6b1b75 100644
--- a/lib/wasix/src/fs/mod.rs
+++ b/lib/wasix/src/fs/mod.rs
@@ -18,12 +18,13 @@ mod fd;
mod fd_list;
mod inode_guard;
mod notification;
+mod path_posix;
use std::{
- borrow::{Borrow, Cow},
+ borrow::Cow,
... | [
"lib/wasix/src/fs/mod.rs"
] | [
{
"comment": "Why not this?\n\n```suggestion\n PathBuf::from(path.strip_prefix(\"/\").unwrap_or(path))\n```",
"path": "lib/wasix/src/fs/mod.rs",
"hunk": "@@ -302,26 +331,181 @@ pub struct WasiInodes {\n protected: Arc<RwLock<WasiInodesProtected>>,\n }\n \n+// Normalize only already-resolved virtu... | true | ||
wasmerio/wasmer | 6,644 | issue_to_patch | fix(V8): use proper new memory sharing mechanism (take 2) | This is a second integration attempt for the V8 back-end where we properly distinguish between a memory attached to a Store (`VMMemory`) and a shared one, `VMSharedMemory` that can be later used in a different `Store`. With that, we can properly shared and access memory in between different Isolates. From the implement... | caf909f12ce8124141fb1d32c12c51ad8b335e20 | d4d79a2040e9ab831e129432e49478f440427f4a | diff --git a/Cargo.toml b/Cargo.toml
index 63e5fffa5119..585eb59aa176 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -106,7 +106,7 @@ axum = { version = "=0.6.9", default-features = false }
backtrace = "0.3"
base64 = "0.22.1"
bincode = "=2.0.1"
-bindgen = "0.72.1"
+bindgen = { version = "0.72.1", default-features = fal... | [
"Cargo.toml",
"Makefile",
"lib/api/Cargo.toml",
"lib/api/build.rs",
"lib/api/src/backend/js/entities/memory/mod.rs",
"lib/api/src/backend/sys/entities/memory/mod.rs",
"lib/api/src/backend/v8/entities/memory/mod.rs",
"lib/api/src/backend/v8/vm/mod.rs",
"lib/api/src/entities/memory/inner.rs",
"lib/a... | [
{
"comment": "This V8 method invokes `wasm_memory_type`/`wasm_memory_share` through `self.handle.as_shared()` without first checking that the caller is on the store's isolate thread. Other V8 memory methods call `check_isolate(store)` before touching the V8 C API; skipping it here can call into V8 from the wron... | diff --git a/lib/wasix/tests/wasm_tests/mod.rs b/lib/wasix/tests/wasm_tests/mod.rs
index d64104af823c..effddb68b19e 100644
--- a/lib/wasix/tests/wasm_tests/mod.rs
+++ b/lib/wasix/tests/wasm_tests/mod.rs
@@ -931,9 +931,8 @@ fn collect_tests(tests: &mut Vec<Trial>) -> Result<()> {
let mut supported_engines = v... | true | |
wasmerio/wasmer | 6,644 | comment_to_fix | fix(V8): use proper new memory sharing mechanism (take 2) | This V8 method invokes `wasm_memory_type`/`wasm_memory_share` through `self.handle.as_shared()` without first checking that the caller is on the store's isolate thread. Other V8 memory methods call `check_isolate(store)` before touching the V8 C API; skipping it here can call into V8 from the wrong thread when `Memory:... | caf909f12ce8124141fb1d32c12c51ad8b335e20 | d4d79a2040e9ab831e129432e49478f440427f4a | diff --git a/lib/api/src/backend/v8/entities/memory/mod.rs b/lib/api/src/backend/v8/entities/memory/mod.rs
index 8d876298a120..ebc79a6b5c79 100644
--- a/lib/api/src/backend/v8/entities/memory/mod.rs
+++ b/lib/api/src/backend/v8/entities/memory/mod.rs
@@ -162,10 +162,62 @@ impl Memory {
pub fn copy(&self, store: &i... | [
"lib/api/src/backend/v8/entities/memory/mod.rs"
] | [
{
"comment": "This V8 method invokes `wasm_memory_type`/`wasm_memory_share` through `self.handle.as_shared()` without first checking that the caller is on the store's isolate thread. Other V8 memory methods call `check_isolate(store)` before touching the V8 C API; skipping it here can call into V8 from the wron... | true | ||
wasmerio/wasmer | 6,644 | comment_to_fix | fix(V8): use proper new memory sharing mechanism (take 2) | This uses the build script's host `cfg!(target_os)` instead of the Cargo target OS. When cross-compiling V8 for Windows from a non-Windows host, the script will look for `libv8.a` even though the selected Windows archive contains `v8.lib`. Use `CARGO_CFG_TARGET_OS` consistently here, as the asset selection above does. | caf909f12ce8124141fb1d32c12c51ad8b335e20 | d4d79a2040e9ab831e129432e49478f440427f4a | diff --git a/lib/api/build.rs b/lib/api/build.rs
index 4dc1ef9963fa..354c05fb646f 100644
--- a/lib/api/build.rs
+++ b/lib/api/build.rs
@@ -18,10 +18,9 @@ fn build_v8() {
) {
("macos", "aarch64", _) => ("v8-darwin-aarch64.tar.xz", "darwin-aarch64"),
("linux", "x86_64", "gnu") => ("v8-linux-amd64.t... | [
"lib/api/build.rs"
] | [
{
"comment": "This uses the build script's host `cfg!(target_os)` instead of the Cargo target OS. When cross-compiling V8 for Windows from a non-Windows host, the script will look for `libv8.a` even though the selected Windows archive contains `v8.lib`. Use `CARGO_CFG_TARGET_OS` consistently here, as the asset ... | true | ||
wasmerio/wasmer | 6,644 | comment_to_fix | fix(V8): use proper new memory sharing mechanism (take 2) | Typo in the comment: "workardound" should be "workaround". | caf909f12ce8124141fb1d32c12c51ad8b335e20 | d4d79a2040e9ab831e129432e49478f440427f4a | diff --git a/scripts/alpine-linux-install-deps.sh b/scripts/alpine-linux-install-deps.sh
index 5a88cb018a83..fcdd95a0172c 100755
--- a/scripts/alpine-linux-install-deps.sh
+++ b/scripts/alpine-linux-install-deps.sh
@@ -9,5 +9,17 @@ apk update
# build scripts (proc-macro2, quote, libc, serde_core, ...). Without it,
# ... | [
"scripts/alpine-linux-install-deps.sh"
] | [
{
"comment": "Typo in the comment: \"workardound\" should be \"workaround\".",
"path": "scripts/alpine-linux-install-deps.sh",
"hunk": "@@ -10,4 +10,16 @@ apk update\n # `cargo build` fails with `error: linker 'cc' not found` on alpine:edge\n # images that no longer ship a host C toolchain by default.\n... | true | ||
wasmerio/wasmer | 6,644 | comment_to_fix | fix(V8): use proper new memory sharing mechanism (take 2) | Typo in the comment: "must" should be "musl". | caf909f12ce8124141fb1d32c12c51ad8b335e20 | d4d79a2040e9ab831e129432e49478f440427f4a | diff --git a/lib/api/Cargo.toml b/lib/api/Cargo.toml
index 77b9f76d3f90..dd3311075280 100644
--- a/lib/api/Cargo.toml
+++ b/lib/api/Cargo.toml
@@ -185,7 +185,17 @@ ureq = { workspace = true, optional = true }
which = { workspace = true, optional = true }
xz = { workspace = true, optional = true }
zip = { workspace =... | [
"lib/api/Cargo.toml"
] | [
{
"comment": "Typo in the comment: \"must\" should be \"musl\".",
"path": "lib/api/Cargo.toml",
"hunk": "@@ -185,7 +185,17 @@ ureq = { workspace = true, optional = true }\n which = { workspace = true, optional = true }\n xz = { workspace = true, optional = true }\n zip = { workspace = true, optional = t... | true | ||
wasmerio/wasmer | 6,644 | comment_to_fix | fix(V8): use proper new memory sharing mechanism (take 2) | Typo in the comment: "workardound" should be "workaround". | caf909f12ce8124141fb1d32c12c51ad8b335e20 | d4d79a2040e9ab831e129432e49478f440427f4a | diff --git a/scripts/alpine-linux-install-deps.sh b/scripts/alpine-linux-install-deps.sh
index 5a88cb018a83..fcdd95a0172c 100755
--- a/scripts/alpine-linux-install-deps.sh
+++ b/scripts/alpine-linux-install-deps.sh
@@ -9,5 +9,17 @@ apk update
# build scripts (proc-macro2, quote, libc, serde_core, ...). Without it,
# ... | [
"scripts/alpine-linux-install-deps.sh"
] | [
{
"comment": "Typo in the comment: \"workardound\" should be \"workaround\".",
"path": "scripts/alpine-linux-install-deps.sh",
"hunk": "@@ -10,4 +10,16 @@ apk update\n # `cargo build` fails with `error: linker 'cc' not found` on alpine:edge\n # images that no longer ship a host C toolchain by default.\n... | true | ||
wasmerio/wasmer | 6,644 | comment_to_fix | fix(V8): use proper new memory sharing mechanism (take 2) | Typo in the comment: "must" should be "musl". | caf909f12ce8124141fb1d32c12c51ad8b335e20 | d4d79a2040e9ab831e129432e49478f440427f4a | diff --git a/lib/api/Cargo.toml b/lib/api/Cargo.toml
index 77b9f76d3f90..dd3311075280 100644
--- a/lib/api/Cargo.toml
+++ b/lib/api/Cargo.toml
@@ -185,7 +185,17 @@ ureq = { workspace = true, optional = true }
which = { workspace = true, optional = true }
xz = { workspace = true, optional = true }
zip = { workspace =... | [
"lib/api/Cargo.toml"
] | [
{
"comment": "Typo in the comment: \"must\" should be \"musl\".",
"path": "lib/api/Cargo.toml",
"hunk": "@@ -185,7 +185,17 @@ ureq = { workspace = true, optional = true }\n which = { workspace = true, optional = true }\n xz = { workspace = true, optional = true }\n zip = { workspace = true, optional = t... | true | ||
wasmerio/wasmer | 6,627 | issue_to_patch | fix: advance static WebC file cursors on read | ## What
Static WebC reads in `StaticFileSystem` were not moving the file cursor.
If a caller reads the file in chunks, it gets the same bytes again, which is pretty annoying.
This path is live in the C API WASI `prepare_webc_env` flow too, so this is not just test-only stuff.
## Repro
Use any static WebC file that is... | e6cf863f4198a4d40254ebe754fc2635a552f1ce | a2d2c3223e009c18b4b86b48420003b26404b129 | diff --git a/lib/virtual-fs/src/static_fs.rs b/lib/virtual-fs/src/static_fs.rs
index 365829431c43..67ab796ae6f9 100644
--- a/lib/virtual-fs/src/static_fs.rs
+++ b/lib/virtual-fs/src/static_fs.rs
@@ -135,27 +135,27 @@ impl AsyncRead for WebCFile {
_cx: &mut Context<'_>,
buf: &mut tokio::io::ReadBuf<'_>... | [
"lib/virtual-fs/src/static_fs.rs"
] | [
{
"comment": "Let's stick to the usage of `self`, introduction of `this` seem not idiomatic to Rust.",
"path": "lib/virtual-fs/src/static_fs.rs",
"hunk": "@@ -135,27 +135,27 @@ impl AsyncRead for WebCFile {\n _cx: &mut Context<'_>,\n buf: &mut tokio::io::ReadBuf<'_>,\n ) -> Poll<io::... | true | ||
wasmerio/wasmer | 6,593 | issue_to_patch | chore: fix duplicated words in wasix and vm doc comments | Three small comment-only typos: doubled `a a` in `lib/wasix/src/os/task/process.rs` (two lines) and `lib/wasix/src/runtime/mod.rs`. No functional change. | 4a7d25af9d8cd1ea8128424ed2042ebcfaf66d3e | abb23ed53509f721a24274249da762cf6ee559b6 | diff --git a/lib/wasix/src/os/task/process.rs b/lib/wasix/src/os/task/process.rs
index 25528b1d75f9..2baf7cbfebe5 100644
--- a/lib/wasix/src/os/task/process.rs
+++ b/lib/wasix/src/os/task/process.rs
@@ -497,7 +497,7 @@ impl WasiProcess {
self.inner.0.lock().unwrap()
}
- /// Creates a a thread and ret... | [
"lib/wasix/src/os/task/process.rs",
"lib/wasix/src/runtime/mod.rs"
] | [] | true | ||
wasmerio/wasmer | 6,642 | issue_to_patch | Fix FS race resulting in None handle, take 2 | Supersedes #6636. | caf909f12ce8124141fb1d32c12c51ad8b335e20 | a14df89a8c83f760c76ed41930cd668daaa412bd | diff --git a/lib/wasix/src/fs/fd.rs b/lib/wasix/src/fs/fd.rs
index 5fe42b2f1f5c..0c018aaee852 100644
--- a/lib/wasix/src/fs/fd.rs
+++ b/lib/wasix/src/fs/fd.rs
@@ -15,6 +15,9 @@ use crate::os::epoll::EpollState;
use super::{InodeGuard, InodeWeakGuard, NotificationInner};
+/// Shared handle to an open [`VirtualFile`... | [
"lib/wasix/src/fs/fd.rs",
"lib/wasix/src/fs/fd_list.rs",
"lib/wasix/src/fs/inode_guard.rs",
"lib/wasix/src/fs/mod.rs",
"lib/wasix/src/journal/effector/syscalls/fd_close.rs",
"lib/wasix/src/syscalls/wasi/fd_close.rs",
"lib/wasix/src/syscalls/wasi/fd_datasync.rs",
"lib/wasix/src/syscalls/wasi/fd_fdstat_... | [
{
"comment": "`dup2_at`’s doc comment says the flush target must be captured while holding `fd_map.write()` and before `drop_one_handle` can clear the inode’s `Kind::File { handle: None }`. However, the current implementation removes `dst` first (which can drop the last handle and clear `handle`), and only then... | diff --git a/lib/wasix/tests/wasm_tests/fd_tests/fd-dup2-same-inode/main.c b/lib/wasix/tests/wasm_tests/fd_tests/fd-dup2-same-inode/main.c
new file mode 100644
index 000000000000..6e9266743237
--- /dev/null
+++ b/lib/wasix/tests/wasm_tests/fd_tests/fd-dup2-same-inode/main.c
@@ -0,0 +1,93 @@
+//#ExpectedStdout: dup2 sam... | true | |
wasmerio/wasmer | 6,642 | comment_to_fix | Fix FS race resulting in None handle, take 2 | `dup2_at`’s doc comment says the flush target must be captured while holding `fd_map.write()` and before `drop_one_handle` can clear the inode’s `Kind::File { handle: None }`. However, the current implementation removes `dst` first (which can drop the last handle and clear `handle`), and only then derives the flush tar... | caf909f12ce8124141fb1d32c12c51ad8b335e20 | a14df89a8c83f760c76ed41930cd668daaa412bd | diff --git a/lib/wasix/src/fs/mod.rs b/lib/wasix/src/fs/mod.rs
index be028f20929d..8e83a0f2b2f9 100644
--- a/lib/wasix/src/fs/mod.rs
+++ b/lib/wasix/src/fs/mod.rs
@@ -4,6 +4,15 @@
// only way we can get to a file on a FileSystem instance is by going
// through its respective FileOpener and giving it a path as input.
... | [
"lib/wasix/src/fs/mod.rs"
] | [
{
"comment": "`dup2_at`’s doc comment says the flush target must be captured while holding `fd_map.write()` and before `drop_one_handle` can clear the inode’s `Kind::File { handle: None }`. However, the current implementation removes `dst` first (which can drop the last handle and clear `handle`), and only then... | true | ||
wasmerio/wasmer | 6,642 | comment_to_fix | Fix FS race resulting in None handle, take 2 | `TARGET_FD` is intentionally kept open in the parent to ensure the spawned child’s dup2 replaces an occupied target, but it is never closed in the parent afterward. Since `posix_spawn_file_actions_adddup2` only affects the child, this leaks the parent’s FD 10 and can make the later `unlink(decoy_path)` cleanup dependen... | caf909f12ce8124141fb1d32c12c51ad8b335e20 | a14df89a8c83f760c76ed41930cd668daaa412bd | diff --git a/lib/wasix/tests/wasm_tests/fd_tests/proc-spawn2-dup2/main.c b/lib/wasix/tests/wasm_tests/fd_tests/proc-spawn2-dup2/main.c
new file mode 100644
index 000000000000..8e7db49b72b7
--- /dev/null
+++ b/lib/wasix/tests/wasm_tests/fd_tests/proc-spawn2-dup2/main.c
@@ -0,0 +1,105 @@
+//#ExpectedStdout: proc_spawn2 d... | [
"lib/wasix/tests/wasm_tests/fd_tests/proc-spawn2-dup2/main.c"
] | [
{
"comment": "`TARGET_FD` is intentionally kept open in the parent to ensure the spawned child’s dup2 replaces an occupied target, but it is never closed in the parent afterward. Since `posix_spawn_file_actions_adddup2` only affects the child, this leaks the parent’s FD 10 and can make the later `unlink(decoy_p... | true | ||
wasmerio/wasmer | 6,642 | comment_to_fix | Fix FS race resulting in None handle, take 2 | `pthread_*` APIs return an error code and generally do not set `errno`, so using `perror()` here can print a misleading message (sometimes even "Success") and loses the actual failure reason. Capture the return code and print `strerror(rc)` instead for barrier init and thread creation. | caf909f12ce8124141fb1d32c12c51ad8b335e20 | a14df89a8c83f760c76ed41930cd668daaa412bd | diff --git a/lib/wasix/tests/wasm_tests/fd_tests/fd-read-none-handle-race/main.c b/lib/wasix/tests/wasm_tests/fd_tests/fd-read-none-handle-race/main.c
new file mode 100644
index 000000000000..d9a215f72e9b
--- /dev/null
+++ b/lib/wasix/tests/wasm_tests/fd_tests/fd-read-none-handle-race/main.c
@@ -0,0 +1,175 @@
+//#Expec... | [
"lib/wasix/tests/wasm_tests/fd_tests/fd-read-none-handle-race/main.c"
] | [
{
"comment": "`pthread_*` APIs return an error code and generally do not set `errno`, so using `perror()` here can print a misleading message (sometimes even \"Success\") and loses the actual failure reason. Capture the return code and print `strerror(rc)` instead for barrier init and thread creation.",
"pa... | true | ||
wasmerio/wasmer | 6,642 | comment_to_fix | Fix FS race resulting in None handle, take 2 | Same issue as earlier: `pthread_join` / `pthread_barrier_destroy` return an error code rather than setting `errno`, so `perror()` can’t reliably report failures. Use the return code with `strerror(rc)` so failures are actionable. | caf909f12ce8124141fb1d32c12c51ad8b335e20 | a14df89a8c83f760c76ed41930cd668daaa412bd | diff --git a/lib/wasix/tests/wasm_tests/fd_tests/fd-read-none-handle-race/main.c b/lib/wasix/tests/wasm_tests/fd_tests/fd-read-none-handle-race/main.c
new file mode 100644
index 000000000000..d9a215f72e9b
--- /dev/null
+++ b/lib/wasix/tests/wasm_tests/fd_tests/fd-read-none-handle-race/main.c
@@ -0,0 +1,175 @@
+//#Expec... | [
"lib/wasix/tests/wasm_tests/fd_tests/fd-read-none-handle-race/main.c"
] | [
{
"comment": "Same issue as earlier: `pthread_join` / `pthread_barrier_destroy` return an error code rather than setting `errno`, so `perror()` can’t reliably report failures. Use the return code with `strerror(rc)` so failures are actionable.",
"path": "lib/wasix/tests/wasm_tests/fd_tests/fd-read-none-hand... | true | ||
wasmerio/wasmer | 6,642 | comment_to_fix | Fix FS race resulting in None handle, take 2 | Java vibes, double boxing , not so great for perf.
*if* we never need to move out or swap the file, we can use: `Arc<RwLock<dyn VirtualFile>>` without the extra Box, I believe. | caf909f12ce8124141fb1d32c12c51ad8b335e20 | a14df89a8c83f760c76ed41930cd668daaa412bd | diff --git a/lib/wasix/src/fs/fd.rs b/lib/wasix/src/fs/fd.rs
index 5fe42b2f1f5c..0c018aaee852 100644
--- a/lib/wasix/src/fs/fd.rs
+++ b/lib/wasix/src/fs/fd.rs
@@ -15,6 +15,9 @@ use crate::os::epoll::EpollState;
use super::{InodeGuard, InodeWeakGuard, NotificationInner};
+/// Shared handle to an open [`VirtualFile`... | [
"lib/wasix/src/fs/fd.rs"
] | [
{
"comment": "Java vibes, double boxing , not so great for perf.\n\n*if* we never need to move out or swap the file, we can use: `Arc<RwLock<dyn VirtualFile>>` without the extra Box, I believe.",
"path": "lib/wasix/src/fs/fd.rs",
"hunk": "@@ -15,6 +15,9 @@ use crate::os::epoll::EpollState;\n \n use supe... | true | ||
wasmerio/wasmer | 6,642 | comment_to_fix | Fix FS race resulting in None handle, take 2 | Side question, but why Option<>.
So we can retain info for a closed fd? | caf909f12ce8124141fb1d32c12c51ad8b335e20 | a14df89a8c83f760c76ed41930cd668daaa412bd | diff --git a/lib/wasix/src/fs/fd.rs b/lib/wasix/src/fs/fd.rs
index 5fe42b2f1f5c..0c018aaee852 100644
--- a/lib/wasix/src/fs/fd.rs
+++ b/lib/wasix/src/fs/fd.rs
@@ -15,6 +15,9 @@ use crate::os::epoll::EpollState;
use super::{InodeGuard, InodeWeakGuard, NotificationInner};
+/// Shared handle to an open [`VirtualFile`... | [
"lib/wasix/src/fs/fd.rs"
] | [
{
"comment": "Side question, but why Option<>.\r\nSo we can retain info for a closed fd?",
"path": "lib/wasix/src/fs/fd.rs",
"hunk": "@@ -89,7 +92,7 @@ pub enum Kind {\n File {\n /// The open file, if it's open\n #[cfg_attr(feature = \"enable-serde\", serde(skip))]\n- handle: ... | true | ||
wasmerio/wasmer | 6,642 | comment_to_fix | Fix FS race resulting in None handle, take 2 | I don't think this is new, it was already broken before, but fd_renumber is supposed to just RENUMBER, not to keep the old fd open!
But since this is not new behaviour, can come as a followup. | caf909f12ce8124141fb1d32c12c51ad8b335e20 | a14df89a8c83f760c76ed41930cd668daaa412bd | diff --git a/lib/wasix/src/syscalls/wasi/fd_renumber.rs b/lib/wasix/src/syscalls/wasi/fd_renumber.rs
index ad7ae56858e1..6c42a18e37a4 100644
--- a/lib/wasix/src/syscalls/wasi/fd_renumber.rs
+++ b/lib/wasix/src/syscalls/wasi/fd_renumber.rs
@@ -1,5 +1,5 @@
use super::*;
-use crate::fs::{FlushPoller, MAX_FD};
+use crate:... | [
"lib/wasix/src/syscalls/wasi/fd_renumber.rs"
] | [
{
"comment": "I don't think this is new, it was already broken before, but fd_renumber is supposed to just RENUMBER, not to keep the old fd open!\n\nBut since this is not new behaviour, can come as a followup.",
"path": "lib/wasix/src/syscalls/wasi/fd_renumber.rs",
"hunk": "@@ -38,71 +38,15 @@ pub(crate... | true | ||
wasmerio/wasmer | 6,643 | issue_to_patch | ci(alpine): install build-base so rustc can link host build scripts | The C-API (linux-musl) and test-wasmer-cli (linux-musl) jobs both fail on `alpine:edge` with:
error: linker `cc` not found
could not compile `quote` (build script)
could not compile `proc-macro2` (build script)
could not compile `libc` (build script)
could not compile `serde_core` (build scri... | 176021becfb1aef83a617f85ac549c116e16950d | b439cc33d1c88f914ff40f3a76113bde13c76138 | diff --git a/scripts/alpine-linux-install-deps.sh b/scripts/alpine-linux-install-deps.sh
index 841881eb0298..5a88cb018a83 100755
--- a/scripts/alpine-linux-install-deps.sh
+++ b/scripts/alpine-linux-install-deps.sh
@@ -4,5 +4,10 @@
# This script is used by the CI!
apk update
-apk add bash make curl cmake ninja clan... | [
"scripts/alpine-linux-install-deps.sh"
] | [] | true | ||
wasmerio/wasmer | 6,625 | issue_to_patch | port wasi-fyi to wasmer-wasix tests
I think the tests are pretty similar to the WASIX tests:
- an input file (`rustc +nightly --target=wasm32-wasip1 -o "$output" "$input"`) is compiled to `.wasm` file
- a test is run with a provided `stdin`
- and expected `stdout`/`stderr` are sometimes expected
@Arshia001 is it some... | test(wasix): port wasi-fyi suite to wasm harness | This ports the complete wasi-fyi fixture suite into the shared wasmer-wasix wasm_tests harness, so the fixtures are discovered as normal directive-driven wasm tests and run per engine through libtest-mimic.
The shared harness now supports Rust primary sources, runtime env/stdin directives, stderr and file-backed outpu... | 39bdf3646de17dca8aa428904c6b7754d5147a44 | 3b2e9d1dfc2b204cbe35b7f73edb4beab82f6e56 | diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml
index 6b19276e787b..226eb23c1c13 100644
--- a/.github/workflows/test.yaml
+++ b/.github/workflows/test.yaml
@@ -149,51 +149,6 @@ jobs:
- name: make test-js
run: |
make test-js
- test_wasi_fyi:
- name: Wasi-fyi
- run... | [
".github/workflows/test.yaml",
"Makefile",
"lib/wasix/tests/wasm_tests/README.md",
"lib/wasix/tests/wasm_tests/mod.rs",
"lib/wasix/tests/wasm_tests/runner.rs",
"lib/wasix/tests/wasm_tests/wasi_fyi/LICENSE",
"lib/wasix/tests/wasm_tests/wasi_fyi/README.md",
"lib/wasix/tests/wasm_tests/wasi_fyi/env_args-... | [
{
"comment": "`unwrap_or_default()` treats an unknown exit code as `0`, which can incorrectly pass fixtures that expect success (`*.status` contains `0`) even if the run actually failed but didn’t produce a parsable exit code. Prefer requiring `result.exit_code` to be `Some` when a `.status` sidecar exists (e.g... | diff --git a/lib/wasix/tests/wasm_tests/README.md b/lib/wasix/tests/wasm_tests/README.md
index d50561813185..0a0d19bfd262 100644
--- a/lib/wasix/tests/wasm_tests/README.md
+++ b/lib/wasix/tests/wasm_tests/README.md
@@ -18,11 +18,14 @@ The harness builds each discovered fixture, runs the resulting `main` module thr
and... | true |
wasmerio/wasmer | 6,625 | comment_to_fix | test(wasix): port wasi-fyi suite to wasm harness | Do we know why is the previous variant not sufficient? | 39bdf3646de17dca8aa428904c6b7754d5147a44 | 3b2e9d1dfc2b204cbe35b7f73edb4beab82f6e56 | diff --git a/lib/wasix/tests/wasm_tests/mod.rs b/lib/wasix/tests/wasm_tests/mod.rs
index a4d5abd2fec4..d64104af823c 100644
--- a/lib/wasix/tests/wasm_tests/mod.rs
+++ b/lib/wasix/tests/wasm_tests/mod.rs
@@ -4,8 +4,8 @@
//! for a WASM test. Each configuration represents a distinct test run, with its
//! own arguments,... | [
"lib/wasix/tests/wasm_tests/mod.rs"
] | [
{
"comment": "Do we know why is the previous variant not sufficient?",
"path": "lib/wasix/tests/wasm_tests/mod.rs",
"hunk": "@@ -384,13 +461,11 @@ fn run_build_script(config: &Config) -> anyhow::Result<PathBuf> {\n }\n create_dir_all(&build_test_path)?;\n \n- let mut options = fs_extra::dir::... | true | ||
wasmerio/wasmer | 6,625 | comment_to_fix | test(wasix): port wasi-fyi suite to wasm harness | What about mapping this and `ExpectedStderrFile` by filling up `config.expected_stdout.extend(... read lines from file)`? | 39bdf3646de17dca8aa428904c6b7754d5147a44 | 3b2e9d1dfc2b204cbe35b7f73edb4beab82f6e56 | diff --git a/lib/wasix/tests/wasm_tests/mod.rs b/lib/wasix/tests/wasm_tests/mod.rs
index a4d5abd2fec4..d64104af823c 100644
--- a/lib/wasix/tests/wasm_tests/mod.rs
+++ b/lib/wasix/tests/wasm_tests/mod.rs
@@ -4,8 +4,8 @@
//! for a WASM test. Each configuration represents a distinct test run, with its
//! own arguments,... | [
"lib/wasix/tests/wasm_tests/mod.rs"
] | [
{
"comment": "What about mapping this and `ExpectedStderrFile` by filling up `config.expected_stdout.extend(... read lines from file)`?",
"path": "lib/wasix/tests/wasm_tests/mod.rs",
"hunk": "@@ -298,6 +336,19 @@ fn process_directive(\n \"ExpectedStdout\" => {\n config.expected_stdou... | true | ||
wasmerio/wasmer | 6,625 | comment_to_fix | test(wasix): port wasi-fyi suite to wasm harness | Here it's going to simplify as well (no extra case for stdout_files and stderr_files. | 39bdf3646de17dca8aa428904c6b7754d5147a44 | 3b2e9d1dfc2b204cbe35b7f73edb4beab82f6e56 | diff --git a/lib/wasix/tests/wasm_tests/mod.rs b/lib/wasix/tests/wasm_tests/mod.rs
index a4d5abd2fec4..d64104af823c 100644
--- a/lib/wasix/tests/wasm_tests/mod.rs
+++ b/lib/wasix/tests/wasm_tests/mod.rs
@@ -4,8 +4,8 @@
//! for a WASM test. Each configuration represents a distinct test run, with its
//! own arguments,... | [
"lib/wasix/tests/wasm_tests/mod.rs"
] | [
{
"comment": "Here it's going to simplify as well (no extra case for stdout_files and stderr_files.",
"path": "lib/wasix/tests/wasm_tests/mod.rs",
"hunk": "@@ -516,17 +683,31 @@ fn run_integration_test(config: Config) -> Result<libtest_mimic::Completion> {\n }\n \n if !config.expected_stdout.is_... | true | ||
wasmerio/wasmer | 6,625 | comment_to_fix | test(wasix): port wasi-fyi suite to wasm harness | I would not introduce 2 new functions given the previous suggestion. | 39bdf3646de17dca8aa428904c6b7754d5147a44 | 3b2e9d1dfc2b204cbe35b7f73edb4beab82f6e56 | diff --git a/lib/wasix/tests/wasm_tests/mod.rs b/lib/wasix/tests/wasm_tests/mod.rs
index a4d5abd2fec4..d64104af823c 100644
--- a/lib/wasix/tests/wasm_tests/mod.rs
+++ b/lib/wasix/tests/wasm_tests/mod.rs
@@ -4,8 +4,8 @@
//! for a WASM test. Each configuration represents a distinct test run, with its
//! own arguments,... | [
"lib/wasix/tests/wasm_tests/mod.rs"
] | [
{
"comment": "I would not introduce 2 new functions given the previous suggestion.",
"path": "lib/wasix/tests/wasm_tests/mod.rs",
"hunk": "@@ -546,6 +727,48 @@ fn run_integration_test(config: Config) -> Result<libtest_mimic::Completion> {\n Ok(libtest_mimic::Completion::Completed)\n }\n \n+fn assert... | true | ||
wasmerio/wasmer | 6,625 | comment_to_fix | test(wasix): port wasi-fyi suite to wasm harness | I am thinking if `Self::RustSourceFile`, `Self::CSourceFile` and `Self::CppSourceFile` would not be a better option? | 39bdf3646de17dca8aa428904c6b7754d5147a44 | 3b2e9d1dfc2b204cbe35b7f73edb4beab82f6e56 | diff --git a/lib/wasix/tests/wasm_tests/mod.rs b/lib/wasix/tests/wasm_tests/mod.rs
index a4d5abd2fec4..d64104af823c 100644
--- a/lib/wasix/tests/wasm_tests/mod.rs
+++ b/lib/wasix/tests/wasm_tests/mod.rs
@@ -4,8 +4,8 @@
//! for a WASM test. Each configuration represents a distinct test run, with its
//! own arguments,... | [
"lib/wasix/tests/wasm_tests/mod.rs"
] | [
{
"comment": "I am thinking if `Self::RustSourceFile`, `Self::CSourceFile` and `Self::CppSourceFile` would not be a better option?",
"path": "lib/wasix/tests/wasm_tests/mod.rs",
"hunk": "@@ -580,10 +810,14 @@ impl PrimarySource {\n \n fn is_default(&self) -> bool {\n match self {\n- ... | true | ||
wasmerio/wasmer | 6,625 | comment_to_fix | test(wasix): port wasi-fyi suite to wasm harness | No need for documenting it. | 39bdf3646de17dca8aa428904c6b7754d5147a44 | 3b2e9d1dfc2b204cbe35b7f73edb4beab82f6e56 | diff --git a/lib/wasix/tests/wasm_tests/README.md b/lib/wasix/tests/wasm_tests/README.md
index d50561813185..0a0d19bfd262 100644
--- a/lib/wasix/tests/wasm_tests/README.md
+++ b/lib/wasix/tests/wasm_tests/README.md
@@ -18,11 +18,14 @@ The harness builds each discovered fixture, runs the resulting `main` module thr
and... | [
"lib/wasix/tests/wasm_tests/README.md"
] | [
{
"comment": "No need for documenting it.",
"path": "lib/wasix/tests/wasm_tests/README.md",
"hunk": "@@ -13,16 +13,21 @@ as a test fixture:\n - `main.c`\n - `main.cpp`\n - `$name.sh`\n+- one or more `*.rs` files\n \n The harness builds each discovered fixture, runs the resulting `main` module through th... | true | ||
wasmerio/wasmer | 6,625 | comment_to_fix | test(wasix): port wasi-fyi suite to wasm harness | I would rather mention that a `.rs` test requires the cross `rustc` compiler installed. | 39bdf3646de17dca8aa428904c6b7754d5147a44 | 3b2e9d1dfc2b204cbe35b7f73edb4beab82f6e56 | diff --git a/lib/wasix/tests/wasm_tests/README.md b/lib/wasix/tests/wasm_tests/README.md
index d50561813185..0a0d19bfd262 100644
--- a/lib/wasix/tests/wasm_tests/README.md
+++ b/lib/wasix/tests/wasm_tests/README.md
@@ -18,11 +18,14 @@ The harness builds each discovered fixture, runs the resulting `main` module thr
and... | [
"lib/wasix/tests/wasm_tests/README.md"
] | [
{
"comment": "I would rather mention that a `.rs` test requires the cross `rustc` compiler installed.",
"path": "lib/wasix/tests/wasm_tests/README.md",
"hunk": "@@ -46,3 +52,4 @@ the primary source, for example `//#BuildEnv: WASIXCC_PIC=1` in C/C++ sources or\n These tests run through the normal `wasix`... | true | ||
wasmerio/wasmer | 6,625 | comment_to_fix | test(wasix): port wasi-fyi suite to wasm harness | Let's extend the current function - no need for a wrapper. | 39bdf3646de17dca8aa428904c6b7754d5147a44 | 3b2e9d1dfc2b204cbe35b7f73edb4beab82f6e56 | diff --git a/lib/wasix/tests/wasm_tests/runner.rs b/lib/wasix/tests/wasm_tests/runner.rs
index 7b7fbf797ae7..73bd1f77a282 100644
--- a/lib/wasix/tests/wasm_tests/runner.rs
+++ b/lib/wasix/tests/wasm_tests/runner.rs
@@ -306,6 +306,8 @@ pub(crate) fn run_wasm_with_runner_config(
wasm_path: &PathBuf,
dir: &Path,... | [
"lib/wasix/tests/wasm_tests/runner.rs"
] | [
{
"comment": "Let's extend the current function - no need for a wrapper.",
"path": "lib/wasix/tests/wasm_tests/runner.rs",
"hunk": "@@ -302,17 +302,38 @@ pub(crate) struct WasmRunResult {\n pub(crate) error: Option<String>,\n }\n \n-pub(crate) fn run_wasm_with_runner_config(\n+pub(crate) fn run_wasm... | true | ||
wasmerio/wasmer | 6,625 | comment_to_fix | test(wasix): port wasi-fyi suite to wasm harness | Can we please make it a new "AbstractConfigFile: wasi-fyi.config" directive instead (and explicitly listing it in all the FYI tests files)? | 39bdf3646de17dca8aa428904c6b7754d5147a44 | 3b2e9d1dfc2b204cbe35b7f73edb4beab82f6e56 | diff --git a/lib/wasix/tests/wasm_tests/mod.rs b/lib/wasix/tests/wasm_tests/mod.rs
index a4d5abd2fec4..d64104af823c 100644
--- a/lib/wasix/tests/wasm_tests/mod.rs
+++ b/lib/wasix/tests/wasm_tests/mod.rs
@@ -4,8 +4,8 @@
//! for a WASM test. Each configuration represents a distinct test run, with its
//! own arguments,... | [
"lib/wasix/tests/wasm_tests/mod.rs"
] | [
{
"comment": "Can we please make it a new \"AbstractConfigFile: wasi-fyi.config\" directive instead (and explicitly listing it in all the FYI tests files)?",
"path": "lib/wasix/tests/wasm_tests/mod.rs",
"hunk": "@@ -55,9 +72,12 @@ use std::str::FromStr;\n use anyhow::bail;\n use libtest_mimic::Trial;\n ... | true | ||
wasmerio/wasmer | 6,625 | comment_to_fix | test(wasix): port wasi-fyi suite to wasm harness | As mentioned, let's make it an explicit directive. | 39bdf3646de17dca8aa428904c6b7754d5147a44 | 3b2e9d1dfc2b204cbe35b7f73edb4beab82f6e56 | diff --git a/lib/wasix/tests/wasm_tests/mod.rs b/lib/wasix/tests/wasm_tests/mod.rs
index a4d5abd2fec4..d64104af823c 100644
--- a/lib/wasix/tests/wasm_tests/mod.rs
+++ b/lib/wasix/tests/wasm_tests/mod.rs
@@ -4,8 +4,8 @@
//! for a WASM test. Each configuration represents a distinct test run, with its
//! own arguments,... | [
"lib/wasix/tests/wasm_tests/mod.rs"
] | [
{
"comment": "As mentioned, let's make it an explicit directive.",
"path": "lib/wasix/tests/wasm_tests/mod.rs",
"hunk": "@@ -207,13 +243,41 @@ fn parse_configs(default_config: &Config) -> Result<Vec<Config>> {\n let mut config = default_config.clone();\n let mut build_env = Vec::new();\n \n+ ... | true | ||
wasmerio/wasmer | 6,625 | comment_to_fix | test(wasix): port wasi-fyi suite to wasm harness | Let's directly read the file content at this place and put the lines to the `config.expected_stderr` which should remain `Vec<String>`. | 39bdf3646de17dca8aa428904c6b7754d5147a44 | 3b2e9d1dfc2b204cbe35b7f73edb4beab82f6e56 | diff --git a/lib/wasix/tests/wasm_tests/mod.rs b/lib/wasix/tests/wasm_tests/mod.rs
index a4d5abd2fec4..d64104af823c 100644
--- a/lib/wasix/tests/wasm_tests/mod.rs
+++ b/lib/wasix/tests/wasm_tests/mod.rs
@@ -4,8 +4,8 @@
//! for a WASM test. Each configuration represents a distinct test run, with its
//! own arguments,... | [
"lib/wasix/tests/wasm_tests/mod.rs"
] | [
{
"comment": "Let's directly read the file content at this place and put the lines to the `config.expected_stderr` which should remain `Vec<String>`.",
"path": "lib/wasix/tests/wasm_tests/mod.rs",
"hunk": "@@ -296,7 +360,36 @@ fn process_directive(\n .collect();\n }\n \"E... | true | ||
wasmerio/wasmer | 6,625 | comment_to_fix | test(wasix): port wasi-fyi suite to wasm harness | I would remove `is_rust` and make it based on the previous match statement where we handle `RustSourceFile`. | 39bdf3646de17dca8aa428904c6b7754d5147a44 | 3b2e9d1dfc2b204cbe35b7f73edb4beab82f6e56 | diff --git a/lib/wasix/tests/wasm_tests/mod.rs b/lib/wasix/tests/wasm_tests/mod.rs
index a4d5abd2fec4..d64104af823c 100644
--- a/lib/wasix/tests/wasm_tests/mod.rs
+++ b/lib/wasix/tests/wasm_tests/mod.rs
@@ -4,8 +4,8 @@
//! for a WASM test. Each configuration represents a distinct test run, with its
//! own arguments,... | [
"lib/wasix/tests/wasm_tests/mod.rs"
] | [
{
"comment": "I would remove `is_rust` and make it based on the previous match statement where we handle `RustSourceFile`.",
"path": "lib/wasix/tests/wasm_tests/mod.rs",
"hunk": "@@ -404,26 +528,39 @@ fn run_build_script(config: &Config) -> anyhow::Result<PathBuf> {\n .env(\"WASIXCC_DISC... | true | ||
wasmerio/wasmer | 6,625 | comment_to_fix | test(wasix): port wasi-fyi suite to wasm harness | I’m curious whether there’s an existing Rust crate that already provides this functionality. To be honest, I’m not a big fan of the custom homegrown approach. | 39bdf3646de17dca8aa428904c6b7754d5147a44 | 3b2e9d1dfc2b204cbe35b7f73edb4beab82f6e56 | diff --git a/lib/wasix/tests/wasm_tests/mod.rs b/lib/wasix/tests/wasm_tests/mod.rs
index a4d5abd2fec4..d64104af823c 100644
--- a/lib/wasix/tests/wasm_tests/mod.rs
+++ b/lib/wasix/tests/wasm_tests/mod.rs
@@ -4,8 +4,8 @@
//! for a WASM test. Each configuration represents a distinct test run, with its
//! own arguments,... | [
"lib/wasix/tests/wasm_tests/mod.rs"
] | [
{
"comment": "I’m curious whether there’s an existing Rust crate that already provides this functionality. To be honest, I’m not a big fan of the custom homegrown approach.",
"path": "lib/wasix/tests/wasm_tests/mod.rs",
"hunk": "@@ -442,6 +579,53 @@ fn run_build_script(config: &Config) -> anyhow::Result... | true | ||
wasmerio/wasmer | 6,625 | comment_to_fix | test(wasix): port wasi-fyi suite to wasm harness | If the directive is missing, I would not overwrite the program name. | 39bdf3646de17dca8aa428904c6b7754d5147a44 | 3b2e9d1dfc2b204cbe35b7f73edb4beab82f6e56 | diff --git a/lib/wasix/tests/wasm_tests/mod.rs b/lib/wasix/tests/wasm_tests/mod.rs
index a4d5abd2fec4..d64104af823c 100644
--- a/lib/wasix/tests/wasm_tests/mod.rs
+++ b/lib/wasix/tests/wasm_tests/mod.rs
@@ -4,8 +4,8 @@
//! for a WASM test. Each configuration represents a distinct test run, with its
//! own arguments,... | [
"lib/wasix/tests/wasm_tests/mod.rs"
] | [
{
"comment": "If the directive is missing, I would not overwrite the program name.",
"path": "lib/wasix/tests/wasm_tests/mod.rs",
"hunk": "@@ -463,40 +647,71 @@ fn run_integration_test(config: Config) -> Result<libtest_mimic::Completion> {\n File::create(run_dir.join(path))?.write_all(file_conte... | true | ||
wasmerio/wasmer | 6,625 | comment_to_fix | test(wasix): port wasi-fyi suite to wasm harness | As mentioned, please read it at the time of the Directive parsing. | 39bdf3646de17dca8aa428904c6b7754d5147a44 | 3b2e9d1dfc2b204cbe35b7f73edb4beab82f6e56 | diff --git a/lib/wasix/tests/wasm_tests/mod.rs b/lib/wasix/tests/wasm_tests/mod.rs
index a4d5abd2fec4..d64104af823c 100644
--- a/lib/wasix/tests/wasm_tests/mod.rs
+++ b/lib/wasix/tests/wasm_tests/mod.rs
@@ -4,8 +4,8 @@
//! for a WASM test. Each configuration represents a distinct test run, with its
//! own arguments,... | [
"lib/wasix/tests/wasm_tests/mod.rs"
] | [
{
"comment": "As mentioned, please read it at the time of the Directive parsing.",
"path": "lib/wasix/tests/wasm_tests/mod.rs",
"hunk": "@@ -463,40 +647,71 @@ fn run_integration_test(config: Config) -> Result<libtest_mimic::Completion> {\n File::create(run_dir.join(path))?.write_all(file_content... | true | ||
wasmerio/wasmer | 6,625 | comment_to_fix | test(wasix): port wasi-fyi suite to wasm harness | Please add a comment that explains we allow multiple Rust source files in a same directory. | 39bdf3646de17dca8aa428904c6b7754d5147a44 | 3b2e9d1dfc2b204cbe35b7f73edb4beab82f6e56 | diff --git a/lib/wasix/tests/wasm_tests/mod.rs b/lib/wasix/tests/wasm_tests/mod.rs
index a4d5abd2fec4..d64104af823c 100644
--- a/lib/wasix/tests/wasm_tests/mod.rs
+++ b/lib/wasix/tests/wasm_tests/mod.rs
@@ -4,8 +4,8 @@
//! for a WASM test. Each configuration represents a distinct test run, with its
//! own arguments,... | [
"lib/wasix/tests/wasm_tests/mod.rs"
] | [
{
"comment": "Please add a comment that explains we allow multiple Rust source files in a same directory.",
"path": "lib/wasix/tests/wasm_tests/mod.rs",
"hunk": "@@ -607,17 +860,53 @@ fn identify_primary_sources(test_src_dir: &Path) -> Result<Vec<PrimarySource>> {\n for file in [\"main.c\", \"main.c... | true | ||
wasmerio/wasmer | 6,604 | issue_to_patch | Add soft-float libcall support for LLVM backend on hardware-FP-less targets | # Description
## Motivation
When targeting platforms without hardware floating-point (e.g. soft-float RISC-V), LLVM emits references to compiler-rt / libgcc arithmetic helpers such as `__adddf3`, `__mulsf3`, `__eqdf2`, etc. Wasmer's
LLVM backend resolves libcall symbols by name at JIT link time, but thes... | ee17dece6c8b56fc920a90ef345264c06292f70a | 71573bf0ecf54dd4db2953727793f49d8a384c4d | diff --git a/lib/compiler-llvm/src/object_file.rs b/lib/compiler-llvm/src/object_file.rs
index 7265bca86cd6..60d8fdf5b7f3 100644
--- a/lib/compiler-llvm/src/object_file.rs
+++ b/lib/compiler-llvm/src/object_file.rs
@@ -92,6 +92,59 @@ static LIBCALLS_ELF: phf::Map<&'static str, LibCall> = phf::phf_map! {
"wasmer_vm... | [
"lib/compiler-llvm/src/object_file.rs",
"lib/types/src/libcalls.rs",
"lib/vm/src/libcalls.rs"
] | [
{
"comment": "The Mach-O libcalls map is keyed by the symbol names that appear as undefined references in LLVM-generated object files (see how `LIBCALLS_MACHO` is consumed in `load_object_file` around line 419). When LLVM emits code that needs `__mulsi3`, the Mach-O object file references the symbol `___mulsi3`... | true | ||
wasmerio/wasmer | 6,604 | comment_to_fix | Add soft-float libcall support for LLVM backend on hardware-FP-less targets | The Mach-O libcalls map is keyed by the symbol names that appear as undefined references in LLVM-generated object files (see how `LIBCALLS_MACHO` is consumed in `load_object_file` around line 419). When LLVM emits code that needs `__mulsi3`, the Mach-O object file references the symbol `___mulsi3` (the C name with the ... | ee17dece6c8b56fc920a90ef345264c06292f70a | 71573bf0ecf54dd4db2953727793f49d8a384c4d | diff --git a/lib/compiler-llvm/src/object_file.rs b/lib/compiler-llvm/src/object_file.rs
index 7265bca86cd6..60d8fdf5b7f3 100644
--- a/lib/compiler-llvm/src/object_file.rs
+++ b/lib/compiler-llvm/src/object_file.rs
@@ -92,6 +92,59 @@ static LIBCALLS_ELF: phf::Map<&'static str, LibCall> = phf::phf_map! {
"wasmer_vm... | [
"lib/compiler-llvm/src/object_file.rs"
] | [
{
"comment": "The Mach-O libcalls map is keyed by the symbol names that appear as undefined references in LLVM-generated object files (see how `LIBCALLS_MACHO` is consumed in `load_object_file` around line 419). When LLVM emits code that needs `__mulsi3`, the Mach-O object file references the symbol `___mulsi3`... | true | ||
wasmerio/wasmer | 6,604 | comment_to_fix | Add soft-float libcall support for LLVM backend on hardware-FP-less targets | I would like to see it guarded by the `cfg` so that it gets compiled in only for the desired platforms. | ee17dece6c8b56fc920a90ef345264c06292f70a | 71573bf0ecf54dd4db2953727793f49d8a384c4d | diff --git a/lib/compiler-llvm/src/object_file.rs b/lib/compiler-llvm/src/object_file.rs
index 7265bca86cd6..60d8fdf5b7f3 100644
--- a/lib/compiler-llvm/src/object_file.rs
+++ b/lib/compiler-llvm/src/object_file.rs
@@ -92,6 +92,59 @@ static LIBCALLS_ELF: phf::Map<&'static str, LibCall> = phf::phf_map! {
"wasmer_vm... | [
"lib/compiler-llvm/src/object_file.rs"
] | [
{
"comment": "I would like to see it guarded by the `cfg` so that it gets compiled in only for the desired platforms.",
"path": "lib/compiler-llvm/src/object_file.rs",
"hunk": "@@ -90,6 +90,62 @@ static LIBCALLS_ELF: phf::Map<&'static str, LibCall> = phf::phf_map! {\n \"wasmer_eh_personality2\" => L... | true | ||
wasmerio/wasmer | 6,604 | comment_to_fix | Add soft-float libcall support for LLVM backend on hardware-FP-less targets | Do you really need `memset`? It's a risky operation from the VM perspective - can we map it to `wasmer_vm_memory32_fill`? | ee17dece6c8b56fc920a90ef345264c06292f70a | 71573bf0ecf54dd4db2953727793f49d8a384c4d | diff --git a/lib/compiler-llvm/src/object_file.rs b/lib/compiler-llvm/src/object_file.rs
index 7265bca86cd6..60d8fdf5b7f3 100644
--- a/lib/compiler-llvm/src/object_file.rs
+++ b/lib/compiler-llvm/src/object_file.rs
@@ -92,6 +92,59 @@ static LIBCALLS_ELF: phf::Map<&'static str, LibCall> = phf::phf_map! {
"wasmer_vm... | [
"lib/compiler-llvm/src/object_file.rs"
] | [
{
"comment": "Do you really need `memset`? It's a risky operation from the VM perspective - can we map it to `wasmer_vm_memory32_fill`?",
"path": "lib/compiler-llvm/src/object_file.rs",
"hunk": "@@ -90,6 +90,62 @@ static LIBCALLS_ELF: phf::Map<&'static str, LibCall> = phf::phf_map! {\n \"wasmer_eh_p... | true | ||
wasmerio/wasmer | 6,604 | comment_to_fix | Add soft-float libcall support for LLVM backend on hardware-FP-less targets | Is there any supported Mach-O platform that needs these math routines? | ee17dece6c8b56fc920a90ef345264c06292f70a | 71573bf0ecf54dd4db2953727793f49d8a384c4d | diff --git a/lib/compiler-llvm/src/object_file.rs b/lib/compiler-llvm/src/object_file.rs
index 7265bca86cd6..60d8fdf5b7f3 100644
--- a/lib/compiler-llvm/src/object_file.rs
+++ b/lib/compiler-llvm/src/object_file.rs
@@ -92,6 +92,59 @@ static LIBCALLS_ELF: phf::Map<&'static str, LibCall> = phf::phf_map! {
"wasmer_vm... | [
"lib/compiler-llvm/src/object_file.rs"
] | [
{
"comment": "Is there any supported Mach-O platform that needs these math routines?",
"path": "lib/compiler-llvm/src/object_file.rs",
"hunk": "@@ -90,6 +90,62 @@ static LIBCALLS_ELF: phf::Map<&'static str, LibCall> = phf::phf_map! {\n \"wasmer_eh_personality2\" => LibCall::EHPersonality2,\n \"w... | true | ||
wasmerio/wasmer | 6,604 | comment_to_fix | Add soft-float libcall support for LLVM backend on hardware-FP-less targets | Am I right we will hit a linker error if some of the defined routines is undefined? | ee17dece6c8b56fc920a90ef345264c06292f70a | 71573bf0ecf54dd4db2953727793f49d8a384c4d | diff --git a/lib/vm/src/libcalls.rs b/lib/vm/src/libcalls.rs
index 424e05284a69..81ac7310e3e7 100644
--- a/lib/vm/src/libcalls.rs
+++ b/lib/vm/src/libcalls.rs
@@ -1006,5 +1006,149 @@ pub fn function_pointer(libcall: LibCall) -> usize {
}
LibCall::DebugUsize => wasmer_vm_dbg_usize as *const () as usize... | [
"lib/vm/src/libcalls.rs"
] | [
{
"comment": "Am I right we will hit a linker error if some of the defined routines is undefined?",
"path": "lib/vm/src/libcalls.rs",
"hunk": "@@ -1006,5 +1006,127 @@ pub fn function_pointer(libcall: LibCall) -> usize {\n }\n LibCall::DebugUsize => wasmer_vm_dbg_usize as *const () as usi... | true | ||
wasmerio/wasmer | 6,604 | comment_to_fix | Add soft-float libcall support for LLVM backend on hardware-FP-less targets | The soft-float map is ELF-specific (unprefixed symbols) but `lookup_libcall` consults it regardless of `fmt`. On Mach-O, these libcalls typically appear with a leading underscore (e.g. `___adddf3`), so they won’t be recognized. Fix by adding a Mach-O soft-float map (underscore-prefixed keys) and selecting the correct o... | ee17dece6c8b56fc920a90ef345264c06292f70a | 71573bf0ecf54dd4db2953727793f49d8a384c4d | diff --git a/lib/compiler-llvm/src/object_file.rs b/lib/compiler-llvm/src/object_file.rs
index 7265bca86cd6..60d8fdf5b7f3 100644
--- a/lib/compiler-llvm/src/object_file.rs
+++ b/lib/compiler-llvm/src/object_file.rs
@@ -92,6 +92,59 @@ static LIBCALLS_ELF: phf::Map<&'static str, LibCall> = phf::phf_map! {
"wasmer_vm... | [
"lib/compiler-llvm/src/object_file.rs"
] | [
{
"comment": "The soft-float map is ELF-specific (unprefixed symbols) but `lookup_libcall` consults it regardless of `fmt`. On Mach-O, these libcalls typically appear with a leading underscore (e.g. `___adddf3`), so they won’t be recognized. Fix by adding a Mach-O soft-float map (underscore-prefixed keys) and s... | true | ||
wasmerio/wasmer | 6,604 | comment_to_fix | Add soft-float libcall support for LLVM backend on hardware-FP-less targets | The soft-float map is ELF-specific (unprefixed symbols) but `lookup_libcall` consults it regardless of `fmt`. On Mach-O, these libcalls typically appear with a leading underscore (e.g. `___adddf3`), so they won’t be recognized. Fix by adding a Mach-O soft-float map (underscore-prefixed keys) and selecting the correct o... | ee17dece6c8b56fc920a90ef345264c06292f70a | 71573bf0ecf54dd4db2953727793f49d8a384c4d | diff --git a/lib/compiler-llvm/src/object_file.rs b/lib/compiler-llvm/src/object_file.rs
index 7265bca86cd6..60d8fdf5b7f3 100644
--- a/lib/compiler-llvm/src/object_file.rs
+++ b/lib/compiler-llvm/src/object_file.rs
@@ -92,6 +92,59 @@ static LIBCALLS_ELF: phf::Map<&'static str, LibCall> = phf::phf_map! {
"wasmer_vm... | [
"lib/compiler-llvm/src/object_file.rs"
] | [
{
"comment": "The soft-float map is ELF-specific (unprefixed symbols) but `lookup_libcall` consults it regardless of `fmt`. On Mach-O, these libcalls typically appear with a leading underscore (e.g. `___adddf3`), so they won’t be recognized. Fix by adding a Mach-O soft-float map (underscore-prefixed keys) and s... | true | ||
wasmerio/wasmer | 6,604 | comment_to_fix | Add soft-float libcall support for LLVM backend on hardware-FP-less targets | All of these externs are declared with empty signatures, which is misleading and makes it easy for a future change to accidentally call them with the wrong ABI/types. Since their signatures are well-known (e.g., `__adddf3(f64, f64) -> f64`, `__divdi3(i64, i64) -> i64`, etc.), declare them with correct parameter/return ... | ee17dece6c8b56fc920a90ef345264c06292f70a | 71573bf0ecf54dd4db2953727793f49d8a384c4d | diff --git a/lib/vm/src/libcalls.rs b/lib/vm/src/libcalls.rs
index 424e05284a69..81ac7310e3e7 100644
--- a/lib/vm/src/libcalls.rs
+++ b/lib/vm/src/libcalls.rs
@@ -1006,5 +1006,149 @@ pub fn function_pointer(libcall: LibCall) -> usize {
}
LibCall::DebugUsize => wasmer_vm_dbg_usize as *const () as usize... | [
"lib/vm/src/libcalls.rs"
] | [
{
"comment": "All of these externs are declared with empty signatures, which is misleading and makes it easy for a future change to accidentally call them with the wrong ABI/types. Since their signatures are well-known (e.g., `__adddf3(f64, f64) -> f64`, `__divdi3(i64, i64) -> i64`, etc.), declare them with cor... | true | ||
wasmerio/wasmer | 6,604 | comment_to_fix | Add soft-float libcall support for LLVM backend on hardware-FP-less targets | The exported symbol `wasmer_vm_sqrt` is inconsistent with nearby conventions like `wasmer_vm_f64_floor` / `wasmer_vm_f64_nearest`. Renaming to something like `wasmer_vm_f64_sqrt` (and updating `LibCall::to_symbol` accordingly) would make the API clearer and avoid ambiguity if an `f32` sqrt libcall is added later.
| ee17dece6c8b56fc920a90ef345264c06292f70a | 71573bf0ecf54dd4db2953727793f49d8a384c4d | diff --git a/lib/vm/src/libcalls.rs b/lib/vm/src/libcalls.rs
index 424e05284a69..81ac7310e3e7 100644
--- a/lib/vm/src/libcalls.rs
+++ b/lib/vm/src/libcalls.rs
@@ -1006,5 +1006,149 @@ pub fn function_pointer(libcall: LibCall) -> usize {
}
LibCall::DebugUsize => wasmer_vm_dbg_usize as *const () as usize... | [
"lib/vm/src/libcalls.rs"
] | [
{
"comment": "The exported symbol `wasmer_vm_sqrt` is inconsistent with nearby conventions like `wasmer_vm_f64_floor` / `wasmer_vm_f64_nearest`. Renaming to something like `wasmer_vm_f64_sqrt` (and updating `LibCall::to_symbol` accordingly) would make the API clearer and avoid ambiguity if an `f32` sqrt libcall... | true | ||
wasmerio/wasmer | 6,604 | comment_to_fix | Add soft-float libcall support for LLVM backend on hardware-FP-less targets | These match arms reference many compiler-rt/libgcc symbols unconditionally. Even if the LLVM object loader only ever produces these `LibCall` variants on certain architectures, the Rust binary may still need to resolve the referenced extern symbols at link time. To avoid potential link failures on targets/toolchains th... | ee17dece6c8b56fc920a90ef345264c06292f70a | 71573bf0ecf54dd4db2953727793f49d8a384c4d | diff --git a/lib/vm/src/libcalls.rs b/lib/vm/src/libcalls.rs
index 424e05284a69..81ac7310e3e7 100644
--- a/lib/vm/src/libcalls.rs
+++ b/lib/vm/src/libcalls.rs
@@ -1006,5 +1006,149 @@ pub fn function_pointer(libcall: LibCall) -> usize {
}
LibCall::DebugUsize => wasmer_vm_dbg_usize as *const () as usize... | [
"lib/vm/src/libcalls.rs"
] | [
{
"comment": "These match arms reference many compiler-rt/libgcc symbols unconditionally. Even if the LLVM object loader only ever produces these `LibCall` variants on certain architectures, the Rust binary may still need to resolve the referenced extern symbols at link time. To avoid potential link failures on... | true | ||
wasmerio/wasmer | 6,604 | comment_to_fix | Add soft-float libcall support for LLVM backend on hardware-FP-less targets | These match arms reference many compiler-rt/libgcc symbols unconditionally. Even if the LLVM object loader only ever produces these `LibCall` variants on certain architectures, the Rust binary may still need to resolve the referenced extern symbols at link time. To avoid potential link failures on targets/toolchains th... | ee17dece6c8b56fc920a90ef345264c06292f70a | 71573bf0ecf54dd4db2953727793f49d8a384c4d | diff --git a/lib/vm/src/libcalls.rs b/lib/vm/src/libcalls.rs
index 424e05284a69..81ac7310e3e7 100644
--- a/lib/vm/src/libcalls.rs
+++ b/lib/vm/src/libcalls.rs
@@ -1006,5 +1006,149 @@ pub fn function_pointer(libcall: LibCall) -> usize {
}
LibCall::DebugUsize => wasmer_vm_dbg_usize as *const () as usize... | [
"lib/vm/src/libcalls.rs"
] | [
{
"comment": "These match arms reference many compiler-rt/libgcc symbols unconditionally. Even if the LLVM object loader only ever produces these `LibCall` variants on certain architectures, the Rust binary may still need to resolve the referenced extern symbols at link time. To avoid potential link failures on... | true | ||
wasmerio/wasmer | 6,604 | comment_to_fix | Add soft-float libcall support for LLVM backend on hardware-FP-less targets | These match arms take addresses of `__*` soft-float symbols unconditionally, which forces the final Wasmer VM binary to link against them on all targets/builds. This can produce link-time failures on platforms/toolchains where these helpers are not available under these names (or are not linked in by default). Consider... | ee17dece6c8b56fc920a90ef345264c06292f70a | 71573bf0ecf54dd4db2953727793f49d8a384c4d | diff --git a/lib/vm/src/libcalls.rs b/lib/vm/src/libcalls.rs
index 424e05284a69..81ac7310e3e7 100644
--- a/lib/vm/src/libcalls.rs
+++ b/lib/vm/src/libcalls.rs
@@ -1006,5 +1006,149 @@ pub fn function_pointer(libcall: LibCall) -> usize {
}
LibCall::DebugUsize => wasmer_vm_dbg_usize as *const () as usize... | [
"lib/vm/src/libcalls.rs"
] | [
{
"comment": "These match arms take addresses of `__*` soft-float symbols unconditionally, which forces the final Wasmer VM binary to link against them on all targets/builds. This can produce link-time failures on platforms/toolchains where these helpers are not available under these names (or are not linked in... | true | ||
wasmerio/wasmer | 6,604 | comment_to_fix | Add soft-float libcall support for LLVM backend on hardware-FP-less targets | Using `unsafe extern \"C\" { ... }` for the extern block can be MSRV-sensitive depending on which Rust version this repo supports. If MSRV compatibility is a goal, prefer the broadly-supported form `extern \"C\" { ... }` (calls remain `unsafe` at the call site).
| ee17dece6c8b56fc920a90ef345264c06292f70a | 71573bf0ecf54dd4db2953727793f49d8a384c4d | diff --git a/lib/vm/src/libcalls.rs b/lib/vm/src/libcalls.rs
index 424e05284a69..81ac7310e3e7 100644
--- a/lib/vm/src/libcalls.rs
+++ b/lib/vm/src/libcalls.rs
@@ -1006,5 +1006,149 @@ pub fn function_pointer(libcall: LibCall) -> usize {
}
LibCall::DebugUsize => wasmer_vm_dbg_usize as *const () as usize... | [
"lib/vm/src/libcalls.rs"
] | [
{
"comment": "Using `unsafe extern \\\"C\\\" { ... }` for the extern block can be MSRV-sensitive depending on which Rust version this repo supports. If MSRV compatibility is a goal, prefer the broadly-supported form `extern \\\"C\\\" { ... }` (calls remain `unsafe` at the call site).\n",
"path": "lib/vm/src... | true | ||
wasmerio/wasmer | 6,604 | comment_to_fix | Add soft-float libcall support for LLVM backend on hardware-FP-less targets | Keying soft-float libcall recognition off the build-time `target_arch` risks failing to resolve relocations if an object file contains `__addsf3`-style symbols on x86_64/aarch64 (e.g., unusual target settings / soft-float configurations / cross-target object parsing). Since this is just a name->enum lookup, consider ma... | ee17dece6c8b56fc920a90ef345264c06292f70a | 71573bf0ecf54dd4db2953727793f49d8a384c4d | diff --git a/lib/compiler-llvm/src/object_file.rs b/lib/compiler-llvm/src/object_file.rs
index 7265bca86cd6..60d8fdf5b7f3 100644
--- a/lib/compiler-llvm/src/object_file.rs
+++ b/lib/compiler-llvm/src/object_file.rs
@@ -92,6 +92,59 @@ static LIBCALLS_ELF: phf::Map<&'static str, LibCall> = phf::phf_map! {
"wasmer_vm... | [
"lib/compiler-llvm/src/object_file.rs"
] | [
{
"comment": "Keying soft-float libcall recognition off the build-time `target_arch` risks failing to resolve relocations if an object file contains `__addsf3`-style symbols on x86_64/aarch64 (e.g., unusual target settings / soft-float configurations / cross-target object parsing). Since this is just a name->en... | true | ||
wasmerio/wasmer | 6,604 | comment_to_fix | Add soft-float libcall support for LLVM backend on hardware-FP-less targets | This changes behavior from ignoring `Err` results (`if let Ok(Some(...))`) to propagating them. If `symbol_name_to_relocation_target` can return `Err` for non-fatal/\"not a match\" cases, this will turn previously-successful compilations into hard failures. A safer pattern is to ensure `symbol_name_to_relocation_target... | ee17dece6c8b56fc920a90ef345264c06292f70a | 71573bf0ecf54dd4db2953727793f49d8a384c4d | diff --git a/lib/compiler-llvm/src/object_file.rs b/lib/compiler-llvm/src/object_file.rs
index 7265bca86cd6..60d8fdf5b7f3 100644
--- a/lib/compiler-llvm/src/object_file.rs
+++ b/lib/compiler-llvm/src/object_file.rs
@@ -92,6 +92,59 @@ static LIBCALLS_ELF: phf::Map<&'static str, LibCall> = phf::phf_map! {
"wasmer_vm... | [
"lib/compiler-llvm/src/object_file.rs"
] | [
{
"comment": "This changes behavior from ignoring `Err` results (`if let Ok(Some(...))`) to propagating them. If `symbol_name_to_relocation_target` can return `Err` for non-fatal/\\\"not a match\\\" cases, this will turn previously-successful compilations into hard failures. A safer pattern is to ensure `symbol... | true | ||
wasmerio/wasmer | 6,604 | comment_to_fix | Add soft-float libcall support for LLVM backend on hardware-FP-less targets | Can we have a rather explicit listing of architectures where we want the soft FP operations? `!x86_64 || !aarch64` does not seem correct to me. | ee17dece6c8b56fc920a90ef345264c06292f70a | 71573bf0ecf54dd4db2953727793f49d8a384c4d | diff --git a/lib/compiler-llvm/src/object_file.rs b/lib/compiler-llvm/src/object_file.rs
index 7265bca86cd6..60d8fdf5b7f3 100644
--- a/lib/compiler-llvm/src/object_file.rs
+++ b/lib/compiler-llvm/src/object_file.rs
@@ -92,6 +92,59 @@ static LIBCALLS_ELF: phf::Map<&'static str, LibCall> = phf::phf_map! {
"wasmer_vm... | [
"lib/compiler-llvm/src/object_file.rs"
] | [
{
"comment": "Can we have a rather explicit listing of architectures where we want the soft FP operations? `!x86_64 || !aarch64` does not seem correct to me.",
"path": "lib/compiler-llvm/src/object_file.rs",
"hunk": "@@ -92,6 +92,58 @@ static LIBCALLS_ELF: phf::Map<&'static str, LibCall> = phf::phf_map!... | true | ||
wasmerio/wasmer | 6,604 | comment_to_fix | Add soft-float libcall support for LLVM backend on hardware-FP-less targets | Similarly here. | ee17dece6c8b56fc920a90ef345264c06292f70a | 71573bf0ecf54dd4db2953727793f49d8a384c4d | diff --git a/lib/compiler-llvm/src/object_file.rs b/lib/compiler-llvm/src/object_file.rs
index 7265bca86cd6..60d8fdf5b7f3 100644
--- a/lib/compiler-llvm/src/object_file.rs
+++ b/lib/compiler-llvm/src/object_file.rs
@@ -92,6 +92,59 @@ static LIBCALLS_ELF: phf::Map<&'static str, LibCall> = phf::phf_map! {
"wasmer_vm... | [
"lib/compiler-llvm/src/object_file.rs"
] | [
{
"comment": "Similarly here.",
"path": "lib/compiler-llvm/src/object_file.rs",
"hunk": "@@ -152,6 +204,24 @@ static LIBCALLS_MACHO: phf::Map<&'static str, LibCall> = phf::phf_map! {\n \"_wasmer_vm_dbg_str\" => LibCall::DebugStr,\n };\n \n+fn lookup_libcall(name: &str, fmt: BinaryFormat) -> Option<L... | true | ||
wasmerio/wasmer | 6,604 | comment_to_fix | Add soft-float libcall support for LLVM backend on hardware-FP-less targets | Can we just one `#[cfg]` gate where we'll do a sub-match for all the soft FP calls? | ee17dece6c8b56fc920a90ef345264c06292f70a | 71573bf0ecf54dd4db2953727793f49d8a384c4d | diff --git a/lib/vm/src/libcalls.rs b/lib/vm/src/libcalls.rs
index 424e05284a69..81ac7310e3e7 100644
--- a/lib/vm/src/libcalls.rs
+++ b/lib/vm/src/libcalls.rs
@@ -1006,5 +1006,149 @@ pub fn function_pointer(libcall: LibCall) -> usize {
}
LibCall::DebugUsize => wasmer_vm_dbg_usize as *const () as usize... | [
"lib/vm/src/libcalls.rs"
] | [
{
"comment": "Can we just one `#[cfg]` gate where we'll do a sub-match for all the soft FP calls?",
"path": "lib/vm/src/libcalls.rs",
"hunk": "@@ -1006,5 +1006,189 @@ pub fn function_pointer(libcall: LibCall) -> usize {\n }\n LibCall::DebugUsize => wasmer_vm_dbg_usize as *const () as usi... | true | ||
wasmerio/wasmer | 6,604 | comment_to_fix | Add soft-float libcall support for LLVM backend on hardware-FP-less targets | I think it's still imprecise - we should combine the target architecture with `"target_feature = "f"`? | ee17dece6c8b56fc920a90ef345264c06292f70a | 71573bf0ecf54dd4db2953727793f49d8a384c4d | diff --git a/lib/compiler-llvm/src/object_file.rs b/lib/compiler-llvm/src/object_file.rs
index 7265bca86cd6..60d8fdf5b7f3 100644
--- a/lib/compiler-llvm/src/object_file.rs
+++ b/lib/compiler-llvm/src/object_file.rs
@@ -92,6 +92,59 @@ static LIBCALLS_ELF: phf::Map<&'static str, LibCall> = phf::phf_map! {
"wasmer_vm... | [
"lib/compiler-llvm/src/object_file.rs"
] | [
{
"comment": "I think it's still imprecise - we should combine the target architecture with `\"target_feature = \"f\"`?",
"path": "lib/compiler-llvm/src/object_file.rs",
"hunk": "@@ -92,10 +92,8 @@ static LIBCALLS_ELF: phf::Map<&'static str, LibCall> = phf::phf_map! {\n \"wasmer_vm_dbg_str\" => LibC... | true | ||
wasmerio/wasmer | 6,604 | comment_to_fix | Add soft-float libcall support for LLVM backend on hardware-FP-less targets | Should be aligned with the previously used `cfg` selection. | ee17dece6c8b56fc920a90ef345264c06292f70a | 71573bf0ecf54dd4db2953727793f49d8a384c4d | diff --git a/lib/vm/src/libcalls.rs b/lib/vm/src/libcalls.rs
index 424e05284a69..81ac7310e3e7 100644
--- a/lib/vm/src/libcalls.rs
+++ b/lib/vm/src/libcalls.rs
@@ -1006,5 +1006,149 @@ pub fn function_pointer(libcall: LibCall) -> usize {
}
LibCall::DebugUsize => wasmer_vm_dbg_usize as *const () as usize... | [
"lib/vm/src/libcalls.rs"
] | [
{
"comment": "Should be aligned with the previously used `cfg` selection.",
"path": "lib/vm/src/libcalls.rs",
"hunk": "@@ -1006,5 +1006,149 @@ pub fn function_pointer(libcall: LibCall) -> usize {\n }\n LibCall::DebugUsize => wasmer_vm_dbg_usize as *const () as usize,\n LibCall::D... | true | ||
wasmerio/wasmer | 6,604 | comment_to_fix | Add soft-float libcall support for LLVM backend on hardware-FP-less targets | Same here. | ee17dece6c8b56fc920a90ef345264c06292f70a | 71573bf0ecf54dd4db2953727793f49d8a384c4d | diff --git a/lib/vm/src/libcalls.rs b/lib/vm/src/libcalls.rs
index 424e05284a69..81ac7310e3e7 100644
--- a/lib/vm/src/libcalls.rs
+++ b/lib/vm/src/libcalls.rs
@@ -1006,5 +1006,149 @@ pub fn function_pointer(libcall: LibCall) -> usize {
}
LibCall::DebugUsize => wasmer_vm_dbg_usize as *const () as usize... | [
"lib/vm/src/libcalls.rs"
] | [
{
"comment": "Same here.",
"path": "lib/vm/src/libcalls.rs",
"hunk": "@@ -1006,5 +1006,149 @@ pub fn function_pointer(libcall: LibCall) -> usize {\n }\n LibCall::DebugUsize => wasmer_vm_dbg_usize as *const () as usize,\n LibCall::DebugStr => wasmer_vm_dbg_str as *const () as usiz... | true | ||
wasmerio/wasmer | 6,603 | issue_to_patch | Add `Artifact::finished_function_extents()` to expose compiled function body locations | # Description
Adds `Artifact::finished_function_extents()` and exposes access to the underlying `Artifact` via `Module::sys_artifact()`, making it possible to retrieve the in-memory location and byte length of each locally-defined function body in a compiled module.
## Motivation
When a compiled module is exec... | 4263a29798a884562904cb8a9e8643358957bfae | 6e1c967952fa549a1d16c56a2995c202ff2b15d5 | diff --git a/lib/api/src/backend/sys/entities/module.rs b/lib/api/src/backend/sys/entities/module.rs
index 4e6ae276fa1d..2ce2b9dc4e02 100644
--- a/lib/api/src/backend/sys/entities/module.rs
+++ b/lib/api/src/backend/sys/entities/module.rs
@@ -287,4 +287,21 @@ impl crate::Module {
_ => panic!("Not a `sys` m... | [
"lib/api/src/backend/sys/entities/module.rs",
"lib/api/src/backend/sys/mod.rs",
"lib/api/tests/module.rs",
"lib/compiler/src/engine/artifact.rs"
] | [
{
"comment": "This calls `Artifact::finished_function_extents()`, but `wasmer_compiler::Artifact` does not define that method in the current codebase. The crate will fail to compile until an accessor for the stored function pointers and lengths is added or this code is changed to use existing APIs.\n",
"pat... | diff --git a/lib/api/tests/module.rs b/lib/api/tests/module.rs
index df286eb3ee78..7824eb070015 100644
--- a/lib/api/tests/module.rs
+++ b/lib/api/tests/module.rs
@@ -296,6 +296,106 @@ fn module_custom_sections() -> Result<(), String> {
Ok(())
}
+#[cfg(all(
+ not(target_arch = "wasm32"),
+ any(feature = "... | true | |
wasmerio/wasmer | 6,603 | comment_to_fix | Add `Artifact::finished_function_extents()` to expose compiled function body locations | This calls `Artifact::finished_function_extents()`, but `wasmer_compiler::Artifact` does not define that method in the current codebase. The crate will fail to compile until an accessor for the stored function pointers and lengths is added or this code is changed to use existing APIs.
| 4263a29798a884562904cb8a9e8643358957bfae | 6e1c967952fa549a1d16c56a2995c202ff2b15d5 | diff --git a/lib/api/src/backend/sys/entities/module.rs b/lib/api/src/backend/sys/entities/module.rs
index 4e6ae276fa1d..2ce2b9dc4e02 100644
--- a/lib/api/src/backend/sys/entities/module.rs
+++ b/lib/api/src/backend/sys/entities/module.rs
@@ -287,4 +287,21 @@ impl crate::Module {
_ => panic!("Not a `sys` m... | [
"lib/api/src/backend/sys/entities/module.rs"
] | [
{
"comment": "This calls `Artifact::finished_function_extents()`, but `wasmer_compiler::Artifact` does not define that method in the current codebase. The crate will fail to compile until an accessor for the stored function pointers and lengths is added or this code is changed to use existing APIs.\n",
"pat... | true | ||
wasmerio/wasmer | 6,603 | comment_to_fix | Add `Artifact::finished_function_extents()` to expose compiled function body locations | These tests are only gated on the target architecture, but the new API explicitly returns an empty vector for non-`sys` backends. In native builds where the default engine is `v8`/`js` or `sys` is not enabled, this assertion expects three entries and will fail; restrict the positive assertions to the `sys` backend or c... | 4263a29798a884562904cb8a9e8643358957bfae | 6e1c967952fa549a1d16c56a2995c202ff2b15d5 | diff --git a/lib/api/tests/module.rs b/lib/api/tests/module.rs
index df286eb3ee78..7824eb070015 100644
--- a/lib/api/tests/module.rs
+++ b/lib/api/tests/module.rs
@@ -296,6 +296,106 @@ fn module_custom_sections() -> Result<(), String> {
Ok(())
}
+#[cfg(all(
+ not(target_arch = "wasm32"),
+ any(feature = "... | [
"lib/api/tests/module.rs"
] | [
{
"comment": "These tests are only gated on the target architecture, but the new API explicitly returns an empty vector for non-`sys` backends. In native builds where the default engine is `v8`/`js` or `sys` is not enabled, this assertion expects three entries and will fail; restrict the positive assertions to ... | true | ||
wasmerio/wasmer | 6,603 | comment_to_fix | Add `Artifact::finished_function_extents()` to expose compiled function body locations | This imported-function test only checks the number of extents, so an implementation that returns global function indices like `[1, 2]` instead of the promised local indices `[0, 1]` would still pass. Add an assertion for the returned indices here to cover the imported-function offset behavior described by the API.
| 4263a29798a884562904cb8a9e8643358957bfae | 6e1c967952fa549a1d16c56a2995c202ff2b15d5 | diff --git a/lib/api/tests/module.rs b/lib/api/tests/module.rs
index df286eb3ee78..7824eb070015 100644
--- a/lib/api/tests/module.rs
+++ b/lib/api/tests/module.rs
@@ -296,6 +296,106 @@ fn module_custom_sections() -> Result<(), String> {
Ok(())
}
+#[cfg(all(
+ not(target_arch = "wasm32"),
+ any(feature = "... | [
"lib/api/tests/module.rs"
] | [
{
"comment": "This imported-function test only checks the number of extents, so an implementation that returns global function indices like `[1, 2]` instead of the promised local indices `[0, 1]` would still pass. Add an assertion for the returned indices here to cover the imported-function offset behavior desc... | true | ||
wasmerio/wasmer | 6,603 | comment_to_fix | Add `Artifact::finished_function_extents()` to expose compiled function body locations | This will expose invalid zero-length extents for modules loaded via `static-artifact-load`: `Artifact::deserialize_object` initializes every `finished_function_lengths` entry to `0` (lib/compiler/src/engine/artifact.rs:1281-1284). Either preserve real lengths for static artifacts or return an empty result for that unsu... | 4263a29798a884562904cb8a9e8643358957bfae | 6e1c967952fa549a1d16c56a2995c202ff2b15d5 | diff --git a/lib/api/src/backend/sys/entities/module.rs b/lib/api/src/backend/sys/entities/module.rs
index 4e6ae276fa1d..2ce2b9dc4e02 100644
--- a/lib/api/src/backend/sys/entities/module.rs
+++ b/lib/api/src/backend/sys/entities/module.rs
@@ -287,4 +287,21 @@ impl crate::Module {
_ => panic!("Not a `sys` m... | [
"lib/api/src/backend/sys/entities/module.rs"
] | [
{
"comment": "This will expose invalid zero-length extents for modules loaded via `static-artifact-load`: `Artifact::deserialize_object` initializes every `finished_function_lengths` entry to `0` (lib/compiler/src/engine/artifact.rs:1281-1284). Either preserve real lengths for static artifacts or return an empt... | true | ||
wasmerio/wasmer | 6,603 | comment_to_fix | Add `Artifact::finished_function_extents()` to expose compiled function body locations | `finished_function_extents()` assumes the artifact has been allocated, but `Artifact::from_parts` explicitly leaves `allocated` as `None` for non-native targets used for cross-compilation. Calling the new public `Module::function_extents()` on such a sys module will therefore panic instead of returning an empty list fo... | 4263a29798a884562904cb8a9e8643358957bfae | 6e1c967952fa549a1d16c56a2995c202ff2b15d5 | diff --git a/lib/compiler/src/engine/artifact.rs b/lib/compiler/src/engine/artifact.rs
index 9c03a0ec9956..f2be6afe9d49 100644
--- a/lib/compiler/src/engine/artifact.rs
+++ b/lib/compiler/src/engine/artifact.rs
@@ -786,6 +786,38 @@ impl Artifact {
.finished_functions
}
+ /// Returns the start add... | [
"lib/compiler/src/engine/artifact.rs"
] | [
{
"comment": "`finished_function_extents()` assumes the artifact has been allocated, but `Artifact::from_parts` explicitly leaves `allocated` as `None` for non-native targets used for cross-compilation. Calling the new public `Module::function_extents()` on such a sys module will therefore panic instead of retu... | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.