Skip to content

Commit

Permalink
update toolchain
Browse files Browse the repository at this point in the history
fix action
  • Loading branch information
ForsakenHarmony committed Feb 19, 2024
1 parent 265019f commit 21b5e69
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 71 deletions.
54 changes: 5 additions & 49 deletions .github/actions/setup-rust/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/build_reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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' }}
Expand Down
34 changes: 17 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ debug-assertions = false
[profile.dev.build-override]
opt-level = 3

[patch.crates-io]
# temporary patch until https://github.com/servo/pathfinder/pull/548 gets released.
pathfinder_simd = { git = "https://github.com/servo/pathfinder.git", rev = "e4fcda0d5259d0acf902aee6de7d2501f2bd6629" }

[workspace.dependencies]
# Workspace crates
next-api = { path = "packages/next-swc/crates/next-api" }
Expand Down
1 change: 1 addition & 0 deletions packages/next-swc/crates/wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
Expand Down
1 change: 0 additions & 1 deletion rust-toolchain

This file was deleted.

4 changes: 4 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[toolchain]
channel = "nightly-2024-02-16"
components = ["rustfmt", "clippy"]
profile = "minimal"
2 changes: 1 addition & 1 deletion scripts/send-trace-to-jaeger/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ fn main() {
let first_arg = args().nth(1).expect("Please provide a file name");

if let Ok(lines) = read_lines(first_arg) {
for json_to_parse in lines.flatten() {
for json_to_parse in lines.map_while(Result::ok) {
let v = match serde_json::from_str::<Vec<Value>>(&json_to_parse) {
Ok(v) => v
.into_iter()
Expand Down

0 comments on commit 21b5e69

Please sign in to comment.