Skip to content

Commit 3904222

Browse files
committed
Fix: broken nightly builds
In recent versions of the nightly / beta compilers, the use of linkme causes linker errors. (dtolnay/linkme#94) This is due to the new linker set as default in these versions. Add linker flags to nightly builds to revert to the old linker behaviour. See: - dtolnay/linkme#88 - https://blog.rust-lang.org/2024/05/17/enabling-rust-lld-on-linux.html Signed-off-by: Niklas Dewally <niklas@dewally.com>
1 parent 1cc0853 commit 3904222

File tree

4 files changed

+27
-1
lines changed

4 files changed

+27
-1
lines changed

.github/workflows/code-coverage-main.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ jobs:
2727
- name: Install rust ${{ env.rust_release }}
2828
run: rustup update ${{ env.rust_release }} && rustup default ${{ env.rust_release }}
2929

30+
- name: Disable rust-lld (to fix linkme)
31+
run: echo RUSTFLAGS=${RUSTFLAGS}\ -Zlinker-features=-lld >> $GITHUB_ENV
32+
if: matrix.rust == 'nightly'
33+
3034
- uses: ./.github/actions/install-conjure
3135
with:
3236
os_arch: linux

.github/workflows/code-coverage.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ jobs:
4040

4141
- name: Install rust ${{ env.rust_release }}
4242
run: rustup update ${{ env.rust_release }} && rustup default ${{ env.rust_release }}
43+
44+
- name: Disable rust-lld (to fix linkme)
45+
run: echo RUSTFLAGS=${RUSTFLAGS}\ -Zlinker-features=-lld >> $GITHUB_ENV
46+
if: matrix.rust == 'nightly'
4347

4448
- uses: ./.github/actions/install-conjure
4549
with:

.github/workflows/test.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ on:
2424
env:
2525
SCCACHE_GHA_ENABLED: "true"
2626
RUSTC_WRAPPER: "sccache"
27-
SCCACHE_GHA_VERSION: 2
27+
SCCACHE_GHA_VERSION: 3
2828

2929
jobs:
3030
build-and-test:
@@ -54,6 +54,10 @@ jobs:
5454
- name: Run sccache-cache
5555
uses: mozilla-actions/sccache-action@v0.0.3
5656

57+
- name: Disable rust-lld (to fix linkme)
58+
run: echo RUSTFLAGS=${RUSTFLAGS}\ -Zlinker-features=-lld >> $GITHUB_ENV
59+
if: matrix.rust == 'nightly'
60+
5761
- run: rustup update ${{ matrix.rust_release }} && rustup default ${{ matrix.rust_release }}
5862

5963
- run: cargo build -vv --workspace

readme.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,20 @@ This repository hosts the following projects:
1313
This project is being produced by staff and students of University of St
1414
Andrews, and is licenced under the [MPL 2.0](./LICENCE).
1515

16+
## Rust Nightly Support
17+
18+
The following compiler flags are required for Conjure-Oxide to work with
19+
Nightly Rust:
20+
21+
```sh
22+
export RUSTFLAGS="-Zlinker-features=-lld"
23+
cargo build <...>
24+
```
25+
26+
This is because of current incompatibilities with linkme and the new default
27+
linker ([link](https://github.com/dtolnay/linkme/issues/94)).
28+
29+
1630
## Documentation
1731

1832
API documentation can be found [here](https://conjure-cp.github.io/conjure-oxide/docs/).

0 commit comments

Comments
 (0)