Skip to content

Commit 880ad61

Browse files
committed
emscripten: Assume version is at least 3.1.42
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.
1 parent 0f9f8c9 commit 880ad61

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

build.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use std::{env, str};
55
// need to know all the possible cfgs that this script will set. If you need to set another cfg
66
// make sure to add it to this list as well.
77
const ALLOWED_CFGS: &'static [&'static str] = &[
8-
"emscripten_new_stat_abi",
8+
"emscripten_old_stat_abi",
99
"espidf_time32",
1010
"freebsd10",
1111
"freebsd11",
@@ -76,9 +76,9 @@ fn main() {
7676
}
7777

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

8484
if linux_time_bits64 {

ci/emscripten.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
set -eux
44

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

97
git clone https://github.com/emscripten-core/emsdk.git /emsdk-portable

src/unix/linux_like/emscripten/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,16 +227,16 @@ s! {
227227
}
228228
pub struct stat {
229229
pub st_dev: crate::dev_t,
230-
#[cfg(not(emscripten_new_stat_abi))]
230+
#[cfg(emscripten_old_stat_abi)]
231231
__st_dev_padding: c_int,
232-
#[cfg(not(emscripten_new_stat_abi))]
232+
#[cfg(emscripten_old_stat_abi)]
233233
__st_ino_truncated: c_long,
234234
pub st_mode: crate::mode_t,
235235
pub st_nlink: crate::nlink_t,
236236
pub st_uid: crate::uid_t,
237237
pub st_gid: crate::gid_t,
238238
pub st_rdev: crate::dev_t,
239-
#[cfg(not(emscripten_new_stat_abi))]
239+
#[cfg(emscripten_old_stat_abi)]
240240
__st_rdev_padding: c_int,
241241
pub st_size: off_t,
242242
pub st_blksize: crate::blksize_t,

0 commit comments

Comments
 (0)