Skip to content

Commit

Permalink
fix CI errors in wasm-bindgen
Browse files Browse the repository at this point in the history
  • Loading branch information
google-yfyang committed Mar 4, 2025
1 parent 718b6fe commit 79c884a
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 10 deletions.
7 changes: 4 additions & 3 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
runner = 'cargo run -p wasm-bindgen-cli --bin wasm-bindgen-test-runner --'

[build]

[target.'cfg(all(target_arch = "wasm32", target_os = "emscripten"))']
rustflags = [
"-Cllvm-args=-enable-emscripten-cxx-exceptions=0",
"-Clink-arg=-Wno-undefined",
"-Crelocation-model=static",
"-Cllvm-args=-enable-emscripten-cxx-exceptions=0",
"-Clink-arg=-Wno-undefined",
"-Crelocation-model=static",
]
2 changes: 1 addition & 1 deletion crates/cli-support/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ version = "0.2.100"
anyhow = "1.0"
base64 = "0.22"
log = "0.4"
regex = "1"
rustc-demangle = "0.1.13"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
tempfile = "3.0"
walrus = { version = "0.23", features = ['parallel'] }
regex = "1"
wasm-bindgen-externref-xform = { path = '../externref-xform', version = '=0.2.100' }
wasm-bindgen-multi-value-xform = { path = '../multi-value-xform', version = '=0.2.100' }
wasm-bindgen-shared = { path = "../shared", version = '=0.2.100' }
Expand Down
2 changes: 1 addition & 1 deletion crates/cli-support/src/js/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3188,7 +3188,7 @@ __wbg_set_wasm(wasm);"
code
)
} else {
if !import_deps.is_empty() {
if (matches!(self.config.mode, OutputMode::Emscripten) && !import_deps.is_empty()) {
for dep in &import_deps {
self.emscripten_deps.insert(dep.clone());
}
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/src/bin/wasm-bindgen-test-runner/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ fn main() -> anyhow::Result<()> {
.map(Path::new)
.context("file to test is not a valid file, can't extract file name")?;

let mut file_name_buf = PathBuf::from(cli.file.clone());
let mut file_name_buf = cli.file.clone();

// Repoint the file to be read from "name.js" to "name.wasm" in the case of emscripten.
// Rustc generates a .js and a .wasm file when targeting emscripten. It lists the .js
Expand Down
4 changes: 2 additions & 2 deletions crates/cli/src/bin/wasm-bindgen-test-runner/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ pub(crate) fn spawn(
response
})
.map_err(|e| anyhow!("{}", e))?;
return Ok(srv);
Ok(srv)
}

pub(crate) fn spawn_emscripten(
Expand Down Expand Up @@ -390,7 +390,7 @@ pub(crate) fn spawn_emscripten(
response
})
.map_err(|e| anyhow!("{}", e))?;
return Ok(srv);
Ok(srv)
}

fn try_asset(request: &Request, dir: &Path) -> Response {
Expand Down
4 changes: 2 additions & 2 deletions src/convert/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ impl WasmAbi for i128 {

#[inline]
fn join(low: u64, high: u64, _: (), _: ()) -> Self {
((high as u128) << 64 | low as u128) as i128
(((high as u128) << 64) | low as u128) as i128
}
}
impl WasmAbi for u128 {
Expand All @@ -62,7 +62,7 @@ impl WasmAbi for u128 {

#[inline]
fn join(low: u64, high: u64, _: (), _: ()) -> Self {
(high as u128) << 64 | low as u128
((high as u128) << 64) | low as u128
}
}

Expand Down

0 comments on commit 79c884a

Please sign in to comment.