Skip to content

Commit

Permalink
emscripten: Assume version is at least 3.1.42
Browse files Browse the repository at this point in the history
This revises commit 63b0d67
to assume that Emscripten 3.1.42 or later is being used whenever
`emcc` is not available. Since Emscripten 3.1.42 was released on
June 23, 2023, the majority of users are expected to have upgraded
to a more recent version.

Resolves: rust-lang/rust#131467.
  • Loading branch information
kleisauke committed Jan 14, 2025
1 parent 0f9f8c9 commit 880ad61
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
8 changes: 4 additions & 4 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::{env, str};
// need to know all the possible cfgs that this script will set. If you need to set another cfg
// make sure to add it to this list as well.
const ALLOWED_CFGS: &'static [&'static str] = &[
"emscripten_new_stat_abi",
"emscripten_old_stat_abi",
"espidf_time32",
"freebsd10",
"freebsd11",
Expand Down Expand Up @@ -76,9 +76,9 @@ fn main() {
}

match emcc_version_code() {
Some(v) if (v >= 30142) => set_cfg("emscripten_new_stat_abi"),
// Non-Emscripten or version < 3.1.42.
Some(_) | None => (),
Some(v) if (v < 30142) => set_cfg("emscripten_old_stat_abi"),
// Non-Emscripten or version >= 3.1.42.
_ => (),
}

if linux_time_bits64 {
Expand Down
2 changes: 0 additions & 2 deletions ci/emscripten.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

set -eux

# Note: keep in sync with:
# https://github.com/rust-lang/rust/blob/master/src/ci/docker/scripts/emscripten.sh
emsdk_version=3.1.68

git clone https://github.com/emscripten-core/emsdk.git /emsdk-portable
Expand Down
6 changes: 3 additions & 3 deletions src/unix/linux_like/emscripten/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,16 +227,16 @@ s! {
}
pub struct stat {
pub st_dev: crate::dev_t,
#[cfg(not(emscripten_new_stat_abi))]
#[cfg(emscripten_old_stat_abi)]
__st_dev_padding: c_int,
#[cfg(not(emscripten_new_stat_abi))]
#[cfg(emscripten_old_stat_abi)]
__st_ino_truncated: c_long,
pub st_mode: crate::mode_t,
pub st_nlink: crate::nlink_t,
pub st_uid: crate::uid_t,
pub st_gid: crate::gid_t,
pub st_rdev: crate::dev_t,
#[cfg(not(emscripten_new_stat_abi))]
#[cfg(emscripten_old_stat_abi)]
__st_rdev_padding: c_int,
pub st_size: off_t,
pub st_blksize: crate::blksize_t,
Expand Down

0 comments on commit 880ad61

Please sign in to comment.