diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 37a0cb5435..154b4d602a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,17 +7,21 @@ permissions: {} jobs: build-rust: - runs-on: ubuntu-latest + runs-on: ${{ matrix.settings.os }} permissions: contents: read strategy: fail-fast: false matrix: - target: - - aarch64-apple-darwin - - aarch64-unknown-linux-gnu - - x86_64-unknown-linux-gnu - - x86_64-pc-windows-msvc + settings: + - target: aarch64-apple-darwin + os: namespace-profile-mac-default + - target: aarch64-unknown-linux-gnu + os: ubuntu-latest + - target: x86_64-unknown-linux-gnu + os: ubuntu-latest + - target: x86_64-pc-windows-msvc + os: windows-latest # - aarch64-pc-windows-msvc steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 @@ -30,55 +34,46 @@ jobs: save-cache: ${{ github.ref_name == 'main' }} cache-key: release - - uses: mlugg/setup-zig@8d6198c65fb0feaa111df26e6b467fea8345e46f # v2.0.5 - with: - version: 0.15.2 - - - uses: taiki-e/install-action@ad95d4e02e061d4390c4b66ef5ed56c7fee3d2ce # v2.58.17 - env: - GITHUB_TOKEN: ${{ github.token }} - with: - tool: cargo-zigbuild - - - uses: taiki-e/install-action@ad95d4e02e061d4390c4b66ef5ed56c7fee3d2ce # v2.58.17 - if: ${{ contains(matrix.target, 'windows') }} - env: - GITHUB_TOKEN: ${{ github.token }} - with: - tool: cargo-xwin - - - name: Install llvm - if: ${{ contains(matrix.target, 'windows') }} - run: brew install llvm - - name: Rustup Adds Target - run: rustup target add ${{ matrix.target }} + run: rustup target add ${{ matrix.settings.target }} - name: Add musl target (x86_64) - if: ${{ matrix.target == 'x86_64-unknown-linux-gnu' }} + if: ${{ matrix.settings.target == 'x86_64-unknown-linux-gnu' }} run: rustup target add x86_64-unknown-linux-musl - name: Add musl target (aarch64) - if: ${{ matrix.target == 'aarch64-unknown-linux-gnu' }} + if: ${{ matrix.settings.target == 'aarch64-unknown-linux-gnu' }} run: rustup target add aarch64-unknown-linux-musl - uses: oxc-project/setup-node@fdbf0dfd334c4e6d56ceeb77d91c76339c2a0885 # v1.0.4 - name: Build - run: pnpm --filter=@voidzero-dev/vite-plus build --target ${{ matrix.target }} -x + if: ${{ matrix.settings.target == 'x86_64-unknown-linux-gnu' }} + run: pnpm --filter=@voidzero-dev/vite-plus build --target ${{ matrix.settings.target }} --use-napi-cross env: - XWIN_CACHE_DIR: ${{ github.workspace }}/.xwin-cache + CC: x86_64-unknown-linux-gnu-cc + TARGET_CC: clang + + - name: Build + if: ${{ matrix.settings.target == 'aarch64-unknown-linux-gnu' }} + run: pnpm --filter=@voidzero-dev/vite-plus build --target ${{ matrix.settings.target }} --use-napi-cross + env: + TARGET_CC: clang + + - name: Build + if: ${{ !contains(matrix.settings.target, 'linux') }} + run: pnpm --filter=@voidzero-dev/vite-plus build --target ${{ matrix.settings.target }} - name: Upload artifact uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: - name: bindings-${{ matrix.target }} + name: bindings-${{ matrix.settings.target }} path: ./packages/cli/binding/*.node if-no-files-found: error - name: Upload cli dist uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 - if: ${{ matrix.target == 'x86_64-unknown-linux-gnu' }} + if: ${{ matrix.settings.target == 'x86_64-unknown-linux-gnu' }} with: name: cli path: ./packages/cli/dist diff --git a/Cargo.lock b/Cargo.lock index e949c6a8b8..b82ed1d9f8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -377,12 +377,11 @@ checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "attohttpc" -version = "0.29.2" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48404d931ab11b3a7a5267291b3b8f3590f09b86181381f8e82a7e562ed832c0" +checksum = "16e2cdb6d5ed835199484bb92bb8b3edd526effe995c61732580439c1a67e2e9" dependencies = [ "base64 0.22.1", - "flate2", "http 1.3.1", "log", "native-tls", @@ -1052,22 +1051,22 @@ dependencies = [ [[package]] name = "ctor" -version = "0.4.3" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec09e802f5081de6157da9a75701d6c713d8dc3ba52571fd4bd25f412644e8a6" +checksum = "67773048316103656a637612c4a62477603b777d91d9c62ff2290f9cde178fdb" dependencies = [ - "ctor-proc-macro", - "dtor 0.0.6", + "ctor-proc-macro 0.0.6", + "dtor", ] [[package]] name = "ctor" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67773048316103656a637612c4a62477603b777d91d9c62ff2290f9cde178fdb" +checksum = "59c9b8bdf64ee849747c1b12eb861d21aa47fa161564f48332f1afe2373bf899" dependencies = [ - "ctor-proc-macro", - "dtor 0.1.0", + "ctor-proc-macro 0.0.7", + "dtor", ] [[package]] @@ -1076,6 +1075,12 @@ version = "0.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2931af7e13dc045d8e9d26afccc6fa115d64e115c9c84b1166288b46f6782c2" +[[package]] +name = "ctor-proc-macro" +version = "0.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52560adf09603e58c9a7ee1fe1dcb95a16927b17c127f0ac02d6e768a0e25bc1" + [[package]] name = "darling" version = "0.20.11" @@ -1263,30 +1268,15 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" -[[package]] -name = "dtor" -version = "0.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97cbdf2ad6846025e8e25df05171abfb30e3ababa12ee0a0e44b9bbe570633a8" -dependencies = [ - "dtor-proc-macro 0.0.5", -] - [[package]] name = "dtor" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e58a0764cddb55ab28955347b45be00ade43d4d6f3ba4bf3dc354e4ec9432934" dependencies = [ - "dtor-proc-macro 0.0.6", + "dtor-proc-macro", ] -[[package]] -name = "dtor-proc-macro" -version = "0.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7454e41ff9012c00d53cf7f475c5e3afa3b91b7c90568495495e8d9bf47a1055" - [[package]] name = "dtor-proc-macro" version = "0.0.6" @@ -1532,7 +1522,7 @@ dependencies = [ "bumpalo", "const_format", "csv-async", - "ctor 0.4.3", + "ctor 0.6.0", "flate2", "fspy_detours_sys", "fspy_preload_unix", @@ -1591,7 +1581,7 @@ dependencies = [ "bstr", "bytemuck", "const_format", - "ctor 0.4.3", + "ctor 0.6.0", "derive-where", "fspy_seccomp_unotify", "fspy_shared", @@ -1806,8 +1796,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" dependencies = [ "cfg-if", + "js-sys", "libc", "wasi 0.11.1+wasi-snapshot-preview1", + "wasm-bindgen", ] [[package]] @@ -1817,9 +1809,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" dependencies = [ "cfg-if", + "js-sys", "libc", "r-efi", "wasi 0.14.7+wasi-0.2.4", + "wasm-bindgen", ] [[package]] @@ -2061,6 +2055,23 @@ dependencies = [ "want", ] +[[package]] +name = "hyper-rustls" +version = "0.27.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3c93eb611681b207e1fe55d5a71ecf91572ec8a6705cdb6857f7d8d5242cf58" +dependencies = [ + "http 1.3.1", + "hyper 1.7.0", + "hyper-util", + "rustls", + "rustls-pki-types", + "tokio", + "tokio-rustls", + "tower-service", + "webpki-roots", +] + [[package]] name = "hyper-tls" version = "0.6.0" @@ -2507,6 +2518,12 @@ dependencies = [ "hashbrown 0.15.5", ] +[[package]] +name = "lru-slab" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154" + [[package]] name = "matchers" version = "0.2.0" @@ -2809,9 +2826,9 @@ checksum = "d6790f58c7ff633d8771f42965289203411a5e5c68388703c06e14f24770b41e" [[package]] name = "openssl" -version = "0.10.73" +version = "0.10.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8505734d46c8ab1e19a1dce3aef597ad87dcb4c37e7188231769bd6bd51cebf8" +checksum = "24ad14dd45412269e1a30f52ad8f0664f0f4f4a89ee8fe28c3b3527021ebb654" dependencies = [ "bitflags 2.9.4", "cfg-if", @@ -2839,14 +2856,24 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" +[[package]] +name = "openssl-src" +version = "300.5.3+3.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc6bad8cd0233b63971e232cc9c5e83039375b8586d2312f31fda85db8f888c2" +dependencies = [ + "cc", +] + [[package]] name = "openssl-sys" -version = "0.9.109" +version = "0.9.110" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90096e2e47630d78b7d1c20952dc621f957103f8bc2c8359ec81290d75238571" +checksum = "0a9f0075ba3c21b09f8e8b2026584b1d18d49388648f2fbbf3c97ea8deced8e2" dependencies = [ "cc", "libc", + "openssl-src", "pkg-config", "vcpkg", ] @@ -3227,6 +3254,61 @@ dependencies = [ "yansi", ] +[[package]] +name = "quinn" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e20a958963c291dc322d98411f541009df2ced7b5a4f2bd52337638cfccf20" +dependencies = [ + "bytes", + "cfg_aliases 0.2.1", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2 0.5.10", + "thiserror 2.0.17", + "tokio", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-proto" +version = "0.11.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1906b49b0c3bc04b5fe5d86a77925ae6524a19b816ae38ce1e426255f1d8a31" +dependencies = [ + "bytes", + "getrandom 0.3.3", + "lru-slab", + "rand 0.9.2", + "ring", + "rustc-hash", + "rustls", + "rustls-pki-types", + "slab", + "thiserror 2.0.17", + "tinyvec", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-udp" +version = "0.5.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "addec6a0dcad8a8d96a771f815f0eaf55f9d1805756410b39f5fa81332574cbd" +dependencies = [ + "cfg_aliases 0.2.1", + "libc", + "once_cell", + "socket2 0.5.10", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "quote" version = "1.0.41" @@ -3421,6 +3503,7 @@ dependencies = [ "http-body 1.0.1", "http-body-util", "hyper 1.7.0", + "hyper-rustls", "hyper-tls", "hyper-util", "js-sys", @@ -3428,6 +3511,8 @@ dependencies = [ "native-tls", "percent-encoding", "pin-project-lite", + "quinn", + "rustls", "rustls-pki-types", "serde", "serde_json", @@ -3435,6 +3520,7 @@ dependencies = [ "sync_wrapper", "tokio", "tokio-native-tls", + "tokio-rustls", "tokio-util", "tower", "tower-http", @@ -3444,6 +3530,21 @@ dependencies = [ "wasm-bindgen-futures", "wasm-streams", "web-sys", + "webpki-roots", +] + +[[package]] +name = "ring" +version = "0.17.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" +dependencies = [ + "cc", + "cfg-if", + "getrandom 0.2.16", + "libc", + "untrusted", + "windows-sys 0.52.0", ] [[package]] @@ -3516,15 +3617,41 @@ dependencies = [ "windows-sys 0.61.1", ] +[[package]] +name = "rustls" +version = "0.23.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a9586e9ee2b4f8fab52a0048ca7334d7024eef48e2cb9407e3497bb7cab7fa7" +dependencies = [ + "once_cell", + "ring", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + [[package]] name = "rustls-pki-types" version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "229a4a4c221013e7e1f1a043678c5cc39fe5171437c88fb47151a21e6f5b5c79" dependencies = [ + "web-time", "zeroize", ] +[[package]] +name = "rustls-webpki" +version = "0.103.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e10b3f4191e8a80e6b43eebabfac91e5dcecebb27a71f04e820c47ec41d314bf" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + [[package]] name = "rustversion" version = "1.0.22" @@ -3955,6 +4082,12 @@ dependencies = [ "syn 2.0.106", ] +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + [[package]] name = "supports-color" version = "3.0.2" @@ -4147,6 +4280,21 @@ dependencies = [ "serde_json", ] +[[package]] +name = "tinyvec" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa5fdc3bce6191a1dbc8c02d5c8bffcf557bafa17c124c5264a458f1b0613fa" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + [[package]] name = "tokio" version = "1.47.1" @@ -4188,6 +4336,16 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-rustls" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61" +dependencies = [ + "rustls", + "tokio", +] + [[package]] name = "tokio-seqpacket" version = "0.8.0" @@ -4464,6 +4622,12 @@ version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + [[package]] name = "unty" version = "0.0.4" @@ -4926,6 +5090,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32b130c0d2d49f8b6889abc456e795e82525204f27c42cf767cf0d7734e089b8" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "which" version = "4.4.2" diff --git a/Cargo.toml b/Cargo.toml index dd812cd54f..c520a1214f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,7 +37,7 @@ anyhow = "1.0.98" arrayvec = "0.7.6" assert2 = "0.3.16" assertables = "9.8.1" -attohttpc = "0.29.2" +attohttpc = { version = "0.30.1", features = ["tls-native", "tls-native-vendored"], default-features = false } backon = "1.3.0" backtrace = "0.3.75" base64 = "0.22.1" @@ -58,7 +58,7 @@ constcat = "0.6.1" criterion = { version = "0.7", features = ["html_reports"] } crossterm = { version = "0.29.0", features = ["event-stream"] } csv-async = { version = "1.3.1", features = ["tokio"] } -ctor = "0.4.2" +ctor = "0.6" dashmap = "6.1.0" derive-where = "1.4.0" diff-struct = "0.5.3" @@ -98,7 +98,7 @@ rand = "0.9.1" ratatui = "0.29.0" rayon = "1.10.0" ref-cast = "1.0.24" -reqwest = { version = "0.12", features = ["stream", "native-tls", "json"], default-features = false } +reqwest = { version = "0.12", default-features = false } rusqlite = "0.37.0" rustc-hash = "2.1.1" seccompiler = { git = "https://github.com/branchseer/seccompiler", branch = "seccomp-action-raw" } diff --git a/crates/fspy_preload_unix/src/interceptions/spawn/exec/with_argv.rs b/crates/fspy_preload_unix/src/interceptions/spawn/exec/with_argv.rs index bf318d1111..8239b5836f 100644 --- a/crates/fspy_preload_unix/src/interceptions/spawn/exec/with_argv.rs +++ b/crates/fspy_preload_unix/src/interceptions/spawn/exec/with_argv.rs @@ -16,7 +16,10 @@ pub unsafe fn with_argv( let argc = 1 + unsafe { va.with_copy(|mut copy| { core::iter::from_fn(|| Some(copy.arg::<*const c_char>())) - .position(<*const i8>::is_null) + .position(|s| { + // Find the NULL terminator + s.is_null() + }) .unwrap() }) }; diff --git a/crates/vite_error/Cargo.toml b/crates/vite_error/Cargo.toml index 0caee467b8..972532a498 100644 --- a/crates/vite_error/Cargo.toml +++ b/crates/vite_error/Cargo.toml @@ -13,7 +13,6 @@ bincode = { workspace = true } bstr = { workspace = true } nix = { workspace = true } petgraph = { workspace = true } -reqwest = { workspace = true } rusqlite = { workspace = true } semver = { workspace = true } serde = { workspace = true, features = ["derive"] } @@ -24,3 +23,9 @@ tokio = { workspace = true } vite_path = { workspace = true } vite_str = { workspace = true } wax = { workspace = true } + +[target.'cfg(target_os = "windows")'.dependencies] +reqwest = { workspace = true, features = ["stream", "native-tls-vendored", "json"] } + +[target.'cfg(not(target_os = "windows"))'.dependencies] +reqwest = { workspace = true, features = ["stream", "rustls-tls", "json"] } diff --git a/crates/vite_package_manager/Cargo.toml b/crates/vite_package_manager/Cargo.toml index aa30f2ea97..43bedeeed9 100644 --- a/crates/vite_package_manager/Cargo.toml +++ b/crates/vite_package_manager/Cargo.toml @@ -17,7 +17,6 @@ hex = { workspace = true } indoc = { workspace = true } pathdiff = { workspace = true } petgraph = { workspace = true, features = ["serde-1"] } -reqwest = { workspace = true } rustc-hash = { workspace = true } semver = { workspace = true } serde = { workspace = true, features = ["derive"] } @@ -37,6 +36,12 @@ vite_path = { workspace = true } vite_str = { workspace = true } wax = { workspace = true } +[target.'cfg(target_os = "windows")'.dependencies] +reqwest = { workspace = true, features = ["stream", "native-tls-vendored", "json"] } + +[target.'cfg(not(target_os = "windows"))'.dependencies] +reqwest = { workspace = true, features = ["stream", "rustls-tls", "json"] } + [dev-dependencies] httpmock = { workspace = true } tempfile = { workspace = true } diff --git a/packages/cli/build.ts b/packages/cli/build.ts index d271068f83..dd2ab98cb2 100644 --- a/packages/cli/build.ts +++ b/packages/cli/build.ts @@ -14,7 +14,7 @@ import { sys, } from 'typescript'; -const { values: { target, x } } = parseArgs({ +const { values: { target, x, [`use-napi-cross`]: useNapiCross } } = parseArgs({ options: { target: { type: 'string', @@ -23,6 +23,10 @@ const { values: { target, x } } = parseArgs({ type: 'boolean', default: false, }, + [`use-napi-cross`]: { + type: 'boolean', + default: false, + }, }, }); @@ -35,6 +39,7 @@ const { task } = await cli.build({ esm: true, target, crossCompile: x, + useNapiCross, }); const output = (await task).find((o) => o.kind === 'node');