Skip to content

Commit

Permalink
Fix: broken nightly builds
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
niklasdewally committed Jun 25, 2024
1 parent 1cc0853 commit 43ad958
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/code-coverage-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ jobs:
- name: Install rust ${{ env.rust_release }}
run: rustup update ${{ env.rust_release }} && rustup default ${{ env.rust_release }}

- name: Disable rust-lld (to fix linkme)
run: echo RUSTFLAGS=${RUSTFLAGS}\ -Zlinker-features=-lld >> $GITHUB_ENV
if: matrix.rust == 'nightly'

- uses: ./.github/actions/install-conjure
with:
os_arch: linux
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/code-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ jobs:

- name: Install rust ${{ env.rust_release }}
run: rustup update ${{ env.rust_release }} && rustup default ${{ env.rust_release }}

- name: Disable rust-lld (to fix linkme)
run: echo RUSTFLAGS=${RUSTFLAGS}\ -Zlinker-features=-lld >> $GITHUB_ENV
if: matrix.rust == 'nightly'

- uses: ./.github/actions/install-conjure
with:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ jobs:
- name: Run sccache-cache
uses: mozilla-actions/[email protected]

- name: Disable rust-lld (to fix linkme)
run: echo RUSTFLAGS=${RUSTFLAGS}\ -Zlinker-features=-lld >> $GITHUB_ENV
if: matrix.rust == 'nightly'

- run: rustup update ${{ matrix.rust_release }} && rustup default ${{ matrix.rust_release }}

- run: cargo build -vv --workspace
Expand Down
14 changes: 14 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,20 @@ This repository hosts the following projects:
This project is being produced by staff and students of University of St
Andrews, and is licenced under the [MPL 2.0](./LICENCE).

## Rust Nightly Support

The following compiler flags are required for Conjure-Oxide to work with
Nightly Rust:

```sh
export RUSTFLAGS="-Zlinker-features=-lld"
cargo build <...>
```

This is because of current incompatibilities with linkme and the new default
linker ([link](https://github.com/dtolnay/linkme/issues/94)).


## Documentation

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

0 comments on commit 43ad958

Please sign in to comment.