From b0d2c481262ad7827cbbb56dbac964839548d1af Mon Sep 17 00:00:00 2001 From: tbro Date: Wed, 14 Aug 2024 15:04:30 +0300 Subject: [PATCH 1/3] Try mold linker in CI --- .github/workflows/build.yml | 5 +++++ .github/workflows/coverage.yml | 2 ++ .github/workflows/lint.yml | 2 ++ .github/workflows/slowtest.yaml | 2 ++ .github/workflows/test.yml | 1 + 5 files changed, 12 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d15d12d09..f7899f199 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -47,6 +47,9 @@ jobs: with: prefix-key: v1-rust + + - uses: rui314/setup-mold@v1 + - name: Build # Build in release without `testing` feature, this should work without `hotshot_example` config. run: | @@ -102,6 +105,8 @@ jobs: - name: Enable Rust Caching uses: Swatinem/rust-cache@v2 + - uses: rui314/setup-mold@v1 + - name: Build run: | cargo build --locked --release --workspace diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 5fed0da73..a4cdb0776 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -37,6 +37,8 @@ jobs: with: version: nightly + - uses: rui314/setup-mold@v1 + - uses: dtolnay/rust-toolchain@nightly - name: Enable Rust Caching diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 67e48ebfd..e59028b7e 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -24,6 +24,8 @@ jobs: lint: runs-on: ubuntu-latest steps: + - uses: rui314/setup-mold@v1 + - uses: actions/checkout@v4 name: Checkout Repository diff --git a/.github/workflows/slowtest.yaml b/.github/workflows/slowtest.yaml index 1653faa9d..7db3ca57f 100644 --- a/.github/workflows/slowtest.yaml +++ b/.github/workflows/slowtest.yaml @@ -34,6 +34,8 @@ jobs: with: version: nightly + - uses: rui314/setup-mold@v1 + - uses: taiki-e/install-action@nextest - name: Checkout Repository diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7c14ac3dd..06a3b56df 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,6 +34,7 @@ jobs: with: version: nightly + - uses: rui314/setup-mold@v1 - uses: taiki-e/install-action@nextest - name: Checkout Repository From ccc8efd3500d3e5970db54dde24cde05db0b45ea Mon Sep 17 00:00:00 2001 From: tbro Date: Wed, 14 Aug 2024 15:06:12 +0300 Subject: [PATCH 2/3] mold should be default linker But It might be possible that something is being overridden. --- .github/workflows/build.yml | 2 +- .github/workflows/slowtest.yaml | 2 +- .github/workflows/test.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f7899f199..be8dc62eb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,7 +18,7 @@ concurrency: cancel-in-progress: true env: - RUSTFLAGS: '--cfg async_executor_impl="async-std" --cfg async_channel_impl="async-std"' + RUSTFLAGS: '--cfg async_executor_impl="async-std" --cfg async_channel_impl="async-std" -C link-arg=-fuse-ld=/usr/local/bin/mold' RUST_LOG: info,libp2p=off,node=error jobs: diff --git a/.github/workflows/slowtest.yaml b/.github/workflows/slowtest.yaml index 7db3ca57f..7101509d7 100644 --- a/.github/workflows/slowtest.yaml +++ b/.github/workflows/slowtest.yaml @@ -18,7 +18,7 @@ concurrency: cancel-in-progress: ${{ !contains(github.ref, 'main')}} env: - RUSTFLAGS: '--cfg async_executor_impl="async-std" --cfg async_channel_impl="async-std"' + RUSTFLAGS: '--cfg async_executor_impl="async-std" --cfg async_channel_impl="async-std" -C link-arg=-fuse-ld=/usr/local/bin/mold' RUST_LOG: info,libp2p=off,node=error jobs: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 06a3b56df..21c79c732 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,7 +18,7 @@ concurrency: cancel-in-progress: true env: - RUSTFLAGS: '--cfg async_executor_impl="async-std" --cfg async_channel_impl="async-std"' + RUSTFLAGS: '--cfg async_executor_impl="async-std" --cfg async_channel_impl="async-std" -C link-arg=-fuse-ld=/usr/local/bin/mold' RUST_LOG: info,libp2p=off,node=error jobs: From 1f6e9747429969b92442e11af8446cb344e8302c Mon Sep 17 00:00:00 2001 From: tbro Date: Wed, 14 Aug 2024 15:07:28 +0300 Subject: [PATCH 3/3] add a version --- .github/workflows/build.yml | 3 ++- .github/workflows/slowtest.yaml | 1 + .github/workflows/test.yml | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index be8dc62eb..293a3a7d0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -47,8 +47,8 @@ jobs: with: prefix-key: v1-rust - - uses: rui314/setup-mold@v1 + mold-version: 2.31.0 - name: Build # Build in release without `testing` feature, this should work without `hotshot_example` config. @@ -106,6 +106,7 @@ jobs: uses: Swatinem/rust-cache@v2 - uses: rui314/setup-mold@v1 + mold-version: 2.31.0 - name: Build run: | diff --git a/.github/workflows/slowtest.yaml b/.github/workflows/slowtest.yaml index 7101509d7..702891f5e 100644 --- a/.github/workflows/slowtest.yaml +++ b/.github/workflows/slowtest.yaml @@ -35,6 +35,7 @@ jobs: version: nightly - uses: rui314/setup-mold@v1 + mold-version: 2.31.0 - uses: taiki-e/install-action@nextest diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 21c79c732..01658b3fa 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -35,6 +35,8 @@ jobs: version: nightly - uses: rui314/setup-mold@v1 + mold-version: 2.31.0 + - uses: taiki-e/install-action@nextest - name: Checkout Repository