Skip to content

Commit

Permalink
Try clang 19 on mac
Browse files Browse the repository at this point in the history
  • Loading branch information
glandium committed Feb 6, 2025
1 parent 5f815ab commit c5e0777
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions CI/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,8 +427,7 @@ def prefix(p, s):
elif variant:
raise Exception("Unknown variant: {}".format(variant))

if "osx" not in os:
environ["CC"] = "clang-19"
environ["CC"] = "clang-19"

if os.startswith("mingw"):
cpu = msys.msys_cpu(env.cpu)
Expand All @@ -441,7 +440,20 @@ def prefix(p, s):
rust_target = "x86_64-unknown-linux-gnu"
elif os == "arm64-linux":
rust_target = "aarch64-unknown-linux-gnu"
if "osx" not in os:
if "osx" in os:
arch = {
"x86_64": "X64",
"arm64": "ARM64",
}[env.cpu]
clang_install = [
f"curl -sLO https://github.com/llvm/llvm-project/releases/download/llvmorg-19.1.7/LLVM-19.1.7-macOS-{arch}.tar.xz",
f"gtar -axf LLVM-19.1.7-macOS-{arch}.tar.xz",
f"PATH=$PWD/LLVM-19.1.7-macOS-{arch}/bin:$PATH",
]
TARGET = rust_target.replace("-", "_").upper()
environ[f"CARGO_TARGET_{TARGET}_RUSTFLAGS"] = f"-C linker={environ['CC']} -C link-arg=-fuse-ld=lld"
else:
clang_install = []
for target in dict.fromkeys(
["x86_64-unknown-linux-gnu", rust_target]
).keys():
Expand Down Expand Up @@ -511,6 +523,7 @@ def prefix(p, s):
index="build.{}.{}.{}{}".format(hash, env.os, cpu, prefix(".", variant)),
command=Task.checkout(commit=head)
+ rust_install
+ clang_install
+ [
"(cd repo ; CI/cargo.sh build {})".format(" ".join(cargo_flags)),
"mv repo/target/{}/{}/{} $ARTIFACTS/".format(
Expand Down

0 comments on commit c5e0777

Please sign in to comment.