Skip to content

Conversation

@jungleraptor
Copy link
Contributor

@jungleraptor jungleraptor commented Mar 31, 2023

Adds support for using the hermetic llvm toolchain on x86_64-darwin.

The configuration settings for darwin are mostly copied from: https://github.com/grailbio/bazel-toolchain/blob/master/toolchain/cc_toolchain_config.bzl

One major difference is we don't need to worry about supporting arbitrary versions of llvm, which simplifies things a little.

Also worth mentioning is on mac the toolchain is configured to use the system libc++, ld, and ar. This makes the toolchain less hermetic than the linux version. See the comments for the reasons why.

Known Issues

The clang-tidy aspect isn't currently working on x86_64-darwin. The llvm version of clang-tidy seems to have an issue finding the libc++ headers.

I've created a seperate ticket to track this issue, but I don't think it should be a blocker for getting this merged: https://swift-nav.atlassian.net/browse/BUILD-658

Testing

I also tested IDE integration (CLion), to make sure things like intellisense, debugging are still working as before.

@jungleraptor jungleraptor changed the title Isaac/macos llvm cc: toolchain: add support for hermetic llvm on x86_64-darwin [BUILD-562] Apr 4, 2023
@jungleraptor jungleraptor marked this pull request as ready for review April 4, 2023 01:11
@jungleraptor jungleraptor requested review from a team, krisukox and wwieclaw April 4, 2023 22:29
Copy link
Contributor

@krisukox krisukox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jungleraptor jungleraptor merged commit 169456e into main Apr 5, 2023
@jungleraptor jungleraptor deleted the isaac/macos-llvm branch April 5, 2023 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants