From ca8e0927cf5de6c6c38357720720e2130cb09fde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Fri, 10 Jan 2025 11:30:30 +0900 Subject: [PATCH 1/4] CI: miri --- .github/workflows/CI.yml | 94 ++++++++++++++++++++-------------------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index e2b1dcce6717..31a2ba4f8095 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -488,53 +488,53 @@ jobs: export NODE_OPTIONS="--unhandled-rejections=warn" (cd crates/swc_node_bundler/tests/integration/react && npm install && npx spack) - miri: - name: Miri - runs-on: ubuntu-latest - if: >- - ${{ !contains(github.event.head_commit.message, 'chore: ') }} - strategy: - fail-fast: false - matrix: - crate: - - swc_parallel - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - - shell: bash - run: corepack enable - - - uses: actions/setup-node@v4 - with: - node-version: "18" - cache: "yarn" - - - name: Install node dependencies - shell: bash - run: | - corepack enable - yarn - - - name: Print rustup toolchain version - shell: bash - id: rustup-version - run: | - export RUST_TOOLCHAIN="$(cat rust-toolchain | tr -d '\n')" - echo "Rust toolchain: $RUST_TOOLCHAIN" - echo "RUST_TOOLCHAIN=$RUST_TOOLCHAIN" >> "$GITHUB_OUTPUT" - - - name: Install - uses: dtolnay/rust-toolchain@stable - with: - toolchain: "${{ steps.rustup-version.outputs.RUST_TOOLCHAIN }}" - components: miri - - - run: cargo miri test -p ${{ matrix.crate }} --no-fail-fast - continue-on-error: true - env: - MIRIFLAGS: "-Zmiri-disable-isolation" + # miri: + # name: Miri + # runs-on: ubuntu-latest + # if: >- + # ${{ !contains(github.event.head_commit.message, 'chore: ') }} + # strategy: + # fail-fast: false + # matrix: + # crate: + # - swc_parallel + # steps: + # - uses: actions/checkout@v4 + # with: + # submodules: true + + # - shell: bash + # run: corepack enable + + # - uses: actions/setup-node@v4 + # with: + # node-version: "18" + # cache: "yarn" + + # - name: Install node dependencies + # shell: bash + # run: | + # corepack enable + # yarn + + # - name: Print rustup toolchain version + # shell: bash + # id: rustup-version + # run: | + # export RUST_TOOLCHAIN="$(cat rust-toolchain | tr -d '\n')" + # echo "Rust toolchain: $RUST_TOOLCHAIN" + # echo "RUST_TOOLCHAIN=$RUST_TOOLCHAIN" >> "$GITHUB_OUTPUT" + + # - name: Install + # uses: dtolnay/rust-toolchain@stable + # with: + # toolchain: "${{ steps.rustup-version.outputs.RUST_TOOLCHAIN }}" + # components: miri + + # - run: cargo miri test -p ${{ matrix.crate }} --no-fail-fast + # continue-on-error: true + # env: + # MIRIFLAGS: "-Zmiri-disable-isolation" done: needs: - cargo-fmt From 3c913ac8b5daca1d99c4fa7767edfe364e449b37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Fri, 10 Jan 2025 11:40:05 +0900 Subject: [PATCH 2/4] Update wasmer --- Cargo.toml | 4 ++-- crates/swc_plugin_runner/Cargo.toml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index a5107594fbd3..9953d5c4ba9a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -120,8 +120,8 @@ resolver = "2" walkdir = "2.4.0" wasm-bindgen = "0.2.91" wasm-bindgen-futures = "0.4.41" - wasmer = { version = "5.0.1", default-features = false } - wasmer-wasix = { version = "0.31.0", default-features = false } + wasmer = { version = "=5.0.5-rc1", default-features = false } + wasmer-wasix = { version = "0.35.0", default-features = false } [profile.release] lto = true diff --git a/crates/swc_plugin_runner/Cargo.toml b/crates/swc_plugin_runner/Cargo.toml index 1567f62fcee6..c7f716372a7b 100644 --- a/crates/swc_plugin_runner/Cargo.toml +++ b/crates/swc_plugin_runner/Cargo.toml @@ -71,8 +71,8 @@ swc_ecma_ast = { version = "5.0.1", path = "../swc_ecma_ast", optional = true } swc_plugin_proxy = { version = "5.0.0", path = "../swc_plugin_proxy" } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -wasmer-cache = { version = "5.0.1", optional = true } -wasmer-compiler-cranelift = { version = "5.0.1", default-features = false } +wasmer-cache = { version = "=5.0.5-rc1", optional = true } +wasmer-compiler-cranelift = { version = "=5.0.5-rc1", default-features = false } [dev-dependencies] codspeed-criterion-compat = { workspace = true } From 29b455db6e78fd4123400859541b4b62fff11fff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Fri, 10 Jan 2025 11:40:21 +0900 Subject: [PATCH 3/4] cargo lockfile --- Cargo.lock | 223 +++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 181 insertions(+), 42 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 73393036abc7..27c6d3544cb5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -277,7 +277,7 @@ dependencies = [ "cfg-if", "libc", "miniz_oxide", - "object", + "object 0.36.4", "rustc-demangle", "windows-targets 0.52.6", ] @@ -1384,6 +1384,38 @@ dependencies = [ "syn 2.0.87", ] +[[package]] +name = "derive_more" +version = "0.99.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + +[[package]] +name = "derive_more" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "unicode-xid", +] + [[package]] name = "dialoguer" version = "0.10.4" @@ -2300,9 +2332,18 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.9.0" +version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" + +[[package]] +name = "iprange" +version = "0.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37209be0ad225457e63814401415e748e2453a5297f9b637338f5fb8afa4ec00" +dependencies = [ + "ipnet", +] [[package]] name = "is-macro" @@ -3014,6 +3055,20 @@ dependencies = [ "libc", ] +[[package]] +name = "object" +version = "0.32.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +dependencies = [ + "crc32fast", + "flate2", + "hashbrown 0.14.5", + "indexmap 2.5.0", + "memchr", + "ruzstd", +] + [[package]] name = "object" version = "0.36.4" @@ -3880,6 +3935,17 @@ dependencies = [ "num_cpus", ] +[[package]] +name = "ruzstd" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58c4eb8a81997cf040a091d1f7e1938aeab6749d3a0dfa73af43cdc32393483d" +dependencies = [ + "byteorder", + "derive_more 0.99.18", + "twox-hash", +] + [[package]] name = "ryu" version = "1.0.18" @@ -5999,7 +6065,7 @@ dependencies = [ "tokio", "tracing", "vergen", - "virtual-fs", + "virtual-fs 0.19.0", "wasmer", "wasmer-cache", "wasmer-compiler-cranelift", @@ -6862,12 +6928,37 @@ version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14d2456ec960b74e5b0423159c70dd9796da1445de462013fe03eefd2545b631" dependencies = [ - "anyhow", "async-trait", "bytes", "dashmap 6.1.0", "derivative", "dunce", + "futures", + "getrandom", + "indexmap 1.9.3", + "lazy_static", + "pin-project-lite", + "replace_with", + "shared-buffer", + "slab", + "thiserror", + "tokio", + "tracing", + "wasmer-package 0.2.0", +] + +[[package]] +name = "virtual-fs" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "875dbf2945deb48f93d09ed16896f57c4fa96b9a4344590a3a93f55147a8b8d1" +dependencies = [ + "anyhow", + "async-trait", + "bytes", + "dashmap 6.1.0", + "derive_more 1.0.0", + "dunce", "filetime", "fs_extra", "futures", @@ -6882,19 +6973,18 @@ dependencies = [ "thiserror", "tokio", "tracing", - "wasmer-package", + "wasmer-package 0.4.0", "webc", ] [[package]] name = "virtual-mio" -version = "0.5.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90f0b403de1e0c2195895ee51b04defec3afbe6a4d3c169efd24f97b37d144fe" +checksum = "1a5d846d89208ef272394e6b6706fcea6fe9ce81388b685bdae44dfd590bba16" dependencies = [ "async-trait", "bytes", - "derivative", "futures", "mio", "serde", @@ -6905,9 +6995,9 @@ dependencies = [ [[package]] name = "virtual-net" -version = "0.11.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "262fd9c0f59cc34501804c9f29dc20e1f0f0c354f86eb35b7305b20c25526ce6" +checksum = "33d71eb6f3cb7c0c48f9b989cbdcc21bb4face7c96cb8cce8f9234009e742c66" dependencies = [ "anyhow", "async-trait", @@ -6915,8 +7005,10 @@ dependencies = [ "bincode", "bytecheck 0.6.12", "bytes", - "derivative", + "derive_more 1.0.0", "futures-util", + "ipnet", + "iprange", "pin-project-lite", "rkyv", "serde", @@ -7111,15 +7203,14 @@ dependencies = [ [[package]] name = "wasmer" -version = "5.0.1" +version = "5.0.5-rc1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c8343224a7b75315dce065e68d01413a49a39279905a298ec984c098c3e828c" +checksum = "14e31f8a2e0568af0f661825a70f1762098d1c5b0552c4d7205a3e57badf3ae6" dependencies = [ "bindgen", "bytes", "cfg-if", "cmake", - "derivative", "indexmap 1.9.3", "js-sys", "more-asserts", @@ -7147,9 +7238,9 @@ dependencies = [ [[package]] name = "wasmer-cache" -version = "5.0.1" +version = "5.0.5-rc1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f63e07d30dda84df3d40cf29987f96b044f89f9d54b6e40ff464414dcbc33b1f" +checksum = "9dcb6700805ede59def89eea7c1dab505fc316807ddf5feab06447b610ebe7e2" dependencies = [ "blake3", "hex", @@ -7159,9 +7250,9 @@ dependencies = [ [[package]] name = "wasmer-compiler" -version = "5.0.1" +version = "5.0.5-rc1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe8a13cd4d33ed840c07f0da5097e33239f57a922bede0e8adfd3791905f0200" +checksum = "7a032262211c8323c9ddb8226e2ecfa410e1e1ba8149c905510111b981ffb5aa" dependencies = [ "backtrace", "bytes", @@ -7173,11 +7264,13 @@ dependencies = [ "libc", "memmap2", "more-asserts", + "object 0.32.2", "region", "rkyv", "self_cell", "shared-buffer", "smallvec", + "target-lexicon", "thiserror", "wasmer-types", "wasmer-vm", @@ -7188,9 +7281,9 @@ dependencies = [ [[package]] name = "wasmer-compiler-cranelift" -version = "5.0.1" +version = "5.0.5-rc1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c9017a0bc5fa75a3f78e1702cf379fac91d945d54a68498fa5e92c323b1881b" +checksum = "7c919ade1140a342a778eeeb811231ce65c1735e309c0876154f8a4735da6452" dependencies = [ "cranelift-codegen", "cranelift-entity", @@ -7228,11 +7321,33 @@ dependencies = [ "url", ] +[[package]] +name = "wasmer-config" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07fef53fbab864492d9dced0084c2f08631583cf63c68d7b30c88bf36318c074" +dependencies = [ + "anyhow", + "bytesize", + "ciborium", + "derive_builder 0.12.0", + "hex", + "indexmap 2.5.0", + "schemars", + "semver 1.0.23", + "serde", + "serde_json", + "serde_yml", + "thiserror", + "toml", + "url", +] + [[package]] name = "wasmer-derive" -version = "5.0.1" +version = "5.0.5-rc1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9338002b7f3e913236c03d31234d5a2c8cb7f994891c4f56eebaf3628b19b1ae" +checksum = "fd49fd1afd7c5dd0aa36d91f7e75f5b55331725a1038ca359c6c420d33844313" dependencies = [ "proc-macro-error2", "proc-macro2", @@ -7242,9 +7357,9 @@ dependencies = [ [[package]] name = "wasmer-journal" -version = "0.13.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3700ea2174a90df200c8f066407b2653a65bcd7a1f4ced8e57675d93f1c80dfb" +checksum = "73163004796997a188704dbaf7a5d23c83acdc73c341cf817e28fce5e2eaa048" dependencies = [ "anyhow", "async-trait", @@ -7252,7 +7367,7 @@ dependencies = [ "bincode", "bytecheck 0.6.12", "bytes", - "derivative", + "derive_more 1.0.0", "lz4_flex", "num_enum", "rkyv", @@ -7260,7 +7375,7 @@ dependencies = [ "serde_json", "thiserror", "tracing", - "virtual-fs", + "virtual-fs 0.21.0", "virtual-net", "wasmer", "wasmer-wasix-types", @@ -7288,15 +7403,41 @@ dependencies = [ "thiserror", "toml", "url", - "wasmer-config", + "wasmer-config 0.10.0", + "webc", +] + +[[package]] +name = "wasmer-package" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c16843df09cce487d0aa8dc8f19c77281cb7d1b929e6a9fd4c3047ddbece0da" +dependencies = [ + "anyhow", + "bytes", + "cfg-if", + "ciborium", + "flate2", + "insta", + "semver 1.0.23", + "serde", + "serde_json", + "sha2", + "shared-buffer", + "tar", + "tempfile", + "thiserror", + "toml", + "url", + "wasmer-config 0.12.0", "webc", ] [[package]] name = "wasmer-types" -version = "5.0.1" +version = "5.0.5-rc1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3988f25124ca94b82a937e665ffae3c47bb4883d55762fcada8bbf0adc602748" +checksum = "2d1acd6dc9529b216159b66b082c574e5dbaf1c188e75b007f947d6d06c64a82" dependencies = [ "bytecheck 0.6.12", "enum-iterator", @@ -7315,9 +7456,9 @@ dependencies = [ [[package]] name = "wasmer-vm" -version = "5.0.1" +version = "5.0.5-rc1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "818d6e2a6431158d56a1be30323b7707dc4fd4c99e18648b8662b0684d8aac7c" +checksum = "dabeac4f84113353e7e1711dd095d4b47020fd705905c4b084b07f4be1413eb7" dependencies = [ "backtrace", "cc", @@ -7325,7 +7466,6 @@ dependencies = [ "corosensei", "crossbeam-queue", "dashmap 6.1.0", - "derivative", "enum-iterator", "fnv", "indexmap 2.5.0", @@ -7343,11 +7483,10 @@ dependencies = [ [[package]] name = "wasmer-wasix" -version = "0.31.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db676d4da6ded91ebfe5ad5aa2948cd51104de9f91001eb67c01d4ce5a2aecb4" +checksum = "1191dad138aff02e330b75918a4ec34332b2974f9012e0959463400a8a84102d" dependencies = [ - "ahash", "anyhow", "async-trait", "base64 0.22.1", @@ -7359,7 +7498,7 @@ dependencies = [ "chrono", "cooked-waker", "dashmap 6.1.0", - "derivative", + "derive_more 1.0.0", "futures", "getrandom", "heapless", @@ -7395,16 +7534,16 @@ dependencies = [ "tracing", "url", "urlencoding", - "virtual-fs", + "virtual-fs 0.21.0", "virtual-mio", "virtual-net", "waker-fn", "wasm-bindgen", "wasm-bindgen-futures", "wasmer", - "wasmer-config", + "wasmer-config 0.12.0", "wasmer-journal", - "wasmer-package", + "wasmer-package 0.4.0", "wasmer-types", "wasmer-wasix-types", "web-sys", @@ -7416,9 +7555,9 @@ dependencies = [ [[package]] name = "wasmer-wasix-types" -version = "0.31.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "550fc6aafb24871aeedfbe8e115703942f439aad2f4bea2e8b3d5f4bc79c0e6e" +checksum = "b109a2a04343e4d421fd764f7a02980273d1e537be3a8e16d59c39e025cfcc5f" dependencies = [ "anyhow", "bitflags 1.3.2", From bf7a17bc6f52295863edb145d4dd1507a75328b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Fri, 10 Jan 2025 11:42:57 +0900 Subject: [PATCH 4/4] Create new-pants-agree.md --- .changeset/new-pants-agree.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/new-pants-agree.md diff --git a/.changeset/new-pants-agree.md b/.changeset/new-pants-agree.md new file mode 100644 index 000000000000..0b4fb1fc2375 --- /dev/null +++ b/.changeset/new-pants-agree.md @@ -0,0 +1,6 @@ +--- +swc_core: minor +swc_plugin_runner: minor +--- + +build: Update `wasmer` to `v5.0.5-rc1`