Skip to content

Commit

Permalink
fix(ci): Work around binary distribution tool bug
Browse files Browse the repository at this point in the history
The binary distribution tool we use, `dist`, seems to ignore `RUSTFLAGS`
set in `.cargo/config.toml`. See also:
axodotdev/cargo-dist#1571

Using a custom build setup, it is possible to patch `RUSTFLAGS`. This is
considered a temporary patch, until the underlying bug in `dist` is
fixed. See also:
https://opensource.axo.dev/cargo-dist/book/ci/customizing.html

changelog: ignore
  • Loading branch information
jan-ferdinand committed Nov 26, 2024
1 parent 330fda9 commit 2834a87
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/build-workaround
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# A workaround for
# https://github.com/axodotdev/cargo-dist/issues/1571
# using
# https://opensource.axo.dev/cargo-dist/book/ci/customizing.html#customizing-build-setup
- name: Update RUSTFLAGS with --cfg tokio_unstable
run: echo RUSTFLAGS="$RUSTFLAGS --cfg tokio_unstable" >> "$GITHUB_ENV"
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: "Update RUSTFLAGS with --cfg tokio_unstable"
run: "echo RUSTFLAGS=\"$RUSTFLAGS --cfg tokio_unstable\" >> \"$GITHUB_ENV\""
- name: Install dist
run: ${{ matrix.install_dist }}
# Get the dist-manifest
Expand Down
1 change: 1 addition & 0 deletions dist-workspace.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ install-path = "CARGO_HOME"
install-updater = true
# Whether to enable GitHub Attestations
github-attestations = true
github-build-setup = "build-workaround"

0 comments on commit 2834a87

Please sign in to comment.