Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Fix crux-mir macOS builds after upgrade to Clang 14 #1050

Closed
RyanGlScott opened this issue Oct 12, 2022 · 0 comments
Closed

CI: Fix crux-mir macOS builds after upgrade to Clang 14 #1050

RyanGlScott opened this issue Oct 12, 2022 · 0 comments
Assignees
Labels
CI crux macOS Issues specific to macOS MIR Issues relating to Rust/MIR support
Milestone

Comments

@RyanGlScott
Copy link
Contributor

Recently, GitHub Actions' macOS 12 runners upgraded from Clang 13 to 14. One unfortunate consequence of this change is that mir-json now fails to install (example):

error: linking with `cc` failed: exit code: 1

<snip>

  = note: ld: in /Users/runner/.rustup/toolchains/nightly-2020-03-22-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libhashbrown-10668ca28005f147.rlib(lib.rmeta), archive member 'lib.rmeta' with length 684584 is not mach-o or llvm bitcode file '/Users/runner/.rustup/toolchains/nightly-2020-03-22-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libhashbrown-10668ca28005f147.rlib'
          clang: error: linker command failed with exit code 1 (use -v to see invocation)


error: aborting due to previous error

error: could not compile `libc`.

While I don't exactly know why this is happen, I've inferred that it is due to a combination of (1) the use of Clang 14 or later and (2) the fact that we are using a somewhat old nightly version of rustc.

One way to avoid the issue for the time being is to downgrade the macOS runner from 12 to 11, as GitHub Actions' macOS 11 runners still use Clang 13. However, it's not quite as simple as it sounds, as our pre-built what4-solvers bindists only target macOS 12 at the moment, and they do not work out of the box on macOS 11. We could extend what4-solvers to support both macOS 11 and 12, but this seems like overkill, especially given how scarce macOS resources are on GitHub Actions.

The proper fix is likely to upgrade the nightly rustc version. However, there is no guarantee that the code will continue to compile with a newer rustc version (and indeed, it likely won't), so this option would require some code changes to accommodate.

Another option that is worth considering is to try using a linker besides Apple Clang. We could try setting LDFLAGS=-fuse-ld=lld and RUSTFLAGS="-C link-arg=-fuse-ld=lld" to see if that makes a difference.

To avoid CI issues, I think I'm simply going to avoid running the crux-mir job on macOS for now. We should revisit this soon, however.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI crux macOS Issues specific to macOS MIR Issues relating to Rust/MIR support
Projects
None yet
Development

No branches or pull requests

1 participant