diff --git a/.github/actions/setup-rust/action.yml b/.github/actions/setup-rust/action.yml index bb6044cbf08f1..b64b23b584ced 100644 --- a/.github/actions/setup-rust/action.yml +++ b/.github/actions/setup-rust/action.yml @@ -4,61 +4,17 @@ inputs: targets: description: 'Comma-separated list of target triples to install for this toolchain' required: false - components: - description: 'Comma-separated list of components to be additionally installed' - required: false - skip-install: - description: 'Sets environment variables without installing the rust toolchain' - required: false runs: using: 'composite' steps: - - name: 'Get toolchain version from file' - id: file - shell: bash - run: echo "toolchain=$(cat ./rust-toolchain)" >> $GITHUB_OUTPUT - - - shell: bash - run: | - : force toolchain version - echo "RUST_TOOLCHAIN=${{ steps.file.outputs.toolchain }}" >> $GITHUB_ENV - - - shell: bash - run: | - : disable incremental compilation - if [ -z "${CARGO_INCREMENTAL+set}" ]; then - echo CARGO_INCREMENTAL=0 >> $GITHUB_ENV - fi - - - shell: bash - run: | - : enable colors in Cargo output - if [ -z "${CARGO_TERM_COLOR+set}" ]; then - echo CARGO_TERM_COLOR=always >> $GITHUB_ENV - fi - - - shell: bash - run: | - : enable rust backtrace - if [ -z "${RUST_BACKTRACE+set}" ]; then - echo RUST_BACKTRACE=short >> $GITHUB_ENV - fi - - - shell: bash - run: | - : enable faster cargo sparse registry - if [ -z "${CARGO_REGISTRIES_CRATES_IO_PROTOCOL+set}" ]; then - echo CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse >> $GITHUB_ENV - fi - - name: 'Setup Rust toolchain' - uses: dtolnay/rust-toolchain@master - if: ${{ !inputs.skip-install }} + uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: ${{ steps.file.outputs.toolchain }} - targets: ${{ inputs.targets }} - components: ${{ inputs.components }} + target: ${{ inputs.targets }} + # needed to not make it override the defaults + rustflags: '' + cache: false - name: 'Add cargo problem matchers' shell: bash diff --git a/.github/workflows/build_and_deploy.yml b/.github/workflows/build_and_deploy.yml index 82ac9931614af..8557a51cb7f3f 100644 --- a/.github/workflows/build_and_deploy.yml +++ b/.github/workflows/build_and_deploy.yml @@ -255,11 +255,11 @@ jobs: check-latest: true - run: corepack enable + # we always want to run this to set environment variables - name: Install Rust uses: ./.github/actions/setup-rust with: targets: ${{ matrix.settings.target }} - skip-install: ${{ matrix.settings.docker }} - name: normalize versions run: node scripts/normalize-version-bump.js diff --git a/.github/workflows/build_reusable.yml b/.github/workflows/build_reusable.yml index 0d48f5403af8a..83bef38898f47 100644 --- a/.github/workflows/build_reusable.yml +++ b/.github/workflows/build_reusable.yml @@ -105,8 +105,6 @@ jobs: - name: Install Rust uses: ./.github/actions/setup-rust if: ${{ inputs.skipNativeBuild != 'yes' || inputs.needsNextest == 'yes' || inputs.needsRust == 'yes' }} - with: - components: rustfmt, clippy - name: 'Install mold linker' if: ${{ inputs.mold == 'yes' }} diff --git a/Cargo.lock b/Cargo.lock index 3fc65cd0e173d..c75312459235c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -385,51 +385,6 @@ dependencies = [ "arrayvec", ] -[[package]] -name = "axum" -version = "0.6.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f8ccfd9221ee7d1f3d4b33e1f8319b3a81ed8f61f2ea40b37b859794b4491" -dependencies = [ - "async-trait", - "axum-core", - "bitflags 1.3.2", - "bytes", - "futures-util", - "http", - "http-body", - "hyper", - "itoa", - "matchit", - "memchr", - "mime", - "percent-encoding", - "pin-project-lite", - "rustversion", - "serde", - "sync_wrapper", - "tower", - "tower-layer", - "tower-service", -] - -[[package]] -name = "axum-core" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2f958c80c248b34b9a877a643811be8dbca03ca5ba827f2b63baf3a81e5fc4e" -dependencies = [ - "async-trait", - "bytes", - "futures-util", - "http", - "http-body", - "mime", - "rustversion", - "tower-layer", - "tower-service", -] - [[package]] name = "backtrace" version = "0.3.68" @@ -839,42 +794,6 @@ dependencies = [ "windows-sys 0.45.0", ] -[[package]] -name = "console-api" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e57ff02e8ad8e06ab9731d5dc72dc23bef9200778eae1a89d555d8c42e5d4a86" -dependencies = [ - "prost", - "prost-types", - "tonic", - "tracing-core", -] - -[[package]] -name = "console-subscriber" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22a3a81dfaf6b66bce5d159eddae701e3a002f194d378cbf7be5f053c281d9be" -dependencies = [ - "console-api", - "crossbeam-channel", - "crossbeam-utils", - "futures", - "hdrhistogram", - "humantime", - "prost-types", - "serde", - "serde_json", - "thread_local", - "tokio", - "tokio-stream", - "tonic", - "tracing", - "tracing-core", - "tracing-subscriber", -] - [[package]] name = "console_error_panic_hook" version = "0.1.7" @@ -2004,19 +1923,6 @@ version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" -[[package]] -name = "hdrhistogram" -version = "7.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f19b9f54f7c7f55e31401bb647626ce0cf0f67b0004982ce815b3ee72a02aa8" -dependencies = [ - "base64 0.13.1", - "byteorder", - "flate2", - "nom", - "num-traits", -] - [[package]] name = "heapless" version = "0.7.16" @@ -2114,12 +2020,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" -[[package]] -name = "humantime" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" - [[package]] name = "hyper" version = "0.14.28" @@ -2157,18 +2057,6 @@ dependencies = [ "tokio-rustls", ] -[[package]] -name = "hyper-timeout" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" -dependencies = [ - "hyper", - "pin-project-lite", - "tokio", - "tokio-io-timeout", -] - [[package]] name = "hyper-tls" version = "0.5.0" @@ -2802,12 +2690,6 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" -[[package]] -name = "matchit" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b87248edafb776e59e6ee64a79086f65890d3510f2c656c000bf2a7e8a0aea40" - [[package]] name = "maybe-rayon" version = "0.1.1" @@ -3103,17 +2985,12 @@ name = "next-api" version = "0.1.0" dependencies = [ "anyhow", - "futures", "indexmap 1.9.3", - "indoc", "next-core", - "once_cell", "serde", "serde_json", "shadow-rs", - "tokio", "tracing", - "tracing-subscriber", "turbo-tasks", "turbopack-binding", ] @@ -3122,9 +2999,7 @@ dependencies = [ name = "next-build" version = "0.1.0" dependencies = [ - "console-subscriber", "next-core", - "turbo-tasks", "turbopack-binding", "vergen 7.5.1", ] @@ -3935,38 +3810,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "prost" -version = "0.11.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e48e50df39172a3e7eb17e14642445da64996989bc212b583015435d39a58537" -dependencies = [ - "bytes", - "prost-derive", -] - -[[package]] -name = "prost-derive" -version = "0.11.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ea9b0f8cbe5e15a8a042d030bd96668db28ecb567ec37d691971ff5731d2b1b" -dependencies = [ - "anyhow", - "itertools 0.10.5", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "prost-types" -version = "0.11.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "379119666929a1afd7a043aa6cf96fa67a6dce9af60c88095a4686dbce4c9c88" -dependencies = [ - "prost", -] - [[package]] name = "psm" version = "0.1.21" @@ -6563,12 +6406,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "sync_wrapper" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" - [[package]] name = "sys-info" version = "0.9.1" @@ -6822,20 +6659,9 @@ dependencies = [ "signal-hook-registry", "socket2 0.5.6", "tokio-macros", - "tracing", "windows-sys 0.48.0", ] -[[package]] -name = "tokio-io-timeout" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30b74022ada614a1b4834de765f9bb43877f910cc8ce4be40e89042c9223a8bf" -dependencies = [ - "pin-project-lite", - "tokio", -] - [[package]] name = "tokio-macros" version = "2.1.0" @@ -6973,64 +6799,6 @@ dependencies = [ "winnow", ] -[[package]] -name = "tonic" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f219fad3b929bef19b1f86fbc0358d35daed8f2cac972037ac0dc10bbb8d5fb" -dependencies = [ - "async-stream", - "async-trait", - "axum", - "base64 0.13.1", - "bytes", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "hyper", - "hyper-timeout", - "percent-encoding", - "pin-project", - "prost", - "prost-derive", - "tokio", - "tokio-stream", - "tokio-util", - "tower", - "tower-layer", - "tower-service", - "tracing", - "tracing-futures", -] - -[[package]] -name = "tower" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" -dependencies = [ - "futures-core", - "futures-util", - "indexmap 1.9.3", - "pin-project", - "pin-project-lite", - "rand", - "slab", - "tokio", - "tokio-util", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "tower-layer" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" - [[package]] name = "tower-service" version = "0.3.2" @@ -7082,16 +6850,6 @@ dependencies = [ "valuable", ] -[[package]] -name = "tracing-futures" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" -dependencies = [ - "pin-project", - "tracing", -] - [[package]] name = "tracing-log" version = "0.2.0" @@ -7103,16 +6861,6 @@ dependencies = [ "tracing-core", ] -[[package]] -name = "tracing-serde" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc6b213177105856957181934e4920de57730fc69bf42c37ee5bb664d406d9e1" -dependencies = [ - "serde", - "tracing-core", -] - [[package]] name = "tracing-subscriber" version = "0.3.18" @@ -7123,15 +6871,12 @@ dependencies = [ "nu-ansi-term", "once_cell", "regex", - "serde", - "serde_json", "sharded-slab", "smallvec", "thread_local", "tracing", "tracing-core", "tracing-log", - "tracing-serde", ] [[package]] @@ -8321,6 +8066,7 @@ dependencies = [ "serde-wasm-bindgen", "serde_json", "swc_core", + "tracing", "turbopack-binding", "wasm-bindgen", "wasm-bindgen-futures", diff --git a/packages/next-swc/crates/wasm/Cargo.toml b/packages/next-swc/crates/wasm/Cargo.toml index bc3bf0bc680c1..c184f6b6c5f84 100644 --- a/packages/next-swc/crates/wasm/Cargo.toml +++ b/packages/next-swc/crates/wasm/Cargo.toml @@ -21,6 +21,7 @@ anyhow = "1.0.66" console_error_panic_hook = "0.1.6" next-custom-transforms = { workspace = true } serde_json = "1" +tracing = { version = "0.1.37" } wasm-bindgen = { version = "0.2", features = ["enable-interning"] } wasm-bindgen-futures = "0.4.8" getrandom = { version = "0.2.9", default-features = false, features = ["js"] } diff --git a/rust-toolchain b/rust-toolchain deleted file mode 100644 index fb98c0f091c33..0000000000000 --- a/rust-toolchain +++ /dev/null @@ -1 +0,0 @@ -nightly-2024-04-03 diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000000000..59c3a03ab6aaf --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,4 @@ +[toolchain] +channel = "nightly-2024-04-03" +components = ["rustfmt", "clippy"] +profile = "minimal"