From e0280ab03aa0cb4733da7e0e0ae56c6839ab5ab7 Mon Sep 17 00:00:00 2001 From: Octogonapus Date: Tue, 23 Apr 2024 10:14:01 -0400 Subject: [PATCH 1/3] patch version bump --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index d3e12d42..2aa537c2 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "Clang" uuid = "40e3b903-d033-50b4-a0cc-940c62c95e31" -version = "0.18.2" +version = "0.18.3" [deps] CEnum = "fa961155-64e5-5f13-b03f-caf6b980ea82" From 46f9c461cc4ace1bc4bd3a50af06b0be38b3aefa Mon Sep 17 00:00:00 2001 From: Octogonapus Date: Tue, 23 Apr 2024 10:13:54 -0400 Subject: [PATCH 2/3] Fix shards regression --- src/platform/env.jl | 2 +- src/platform/target.jl | 14 ++++++++------ test/jllenvs.jl | 9 +++++++++ test/runtests.jl | 1 + 4 files changed, 19 insertions(+), 7 deletions(-) create mode 100644 test/jllenvs.jl diff --git a/src/platform/env.jl b/src/platform/env.jl index 77c87263..86f9633d 100644 --- a/src/platform/env.jl +++ b/src/platform/env.jl @@ -11,7 +11,7 @@ const JLL_ENV_TRIPLES = String[ "x86_64-apple-darwin14", "x86_64-linux-gnu", "x86_64-linux-musl", - "x86_64-unknown-freebsd", + "x86_64-unknown-freebsd13.2", "x86_64-w64-mingw32", ] diff --git a/src/platform/target.jl b/src/platform/target.jl index d187c669..b2eec320 100644 --- a/src/platform/target.jl +++ b/src/platform/target.jl @@ -11,7 +11,7 @@ const JLL_ENV_CLANG_TARGETS_MAPPING = Dict( "x86_64-apple-darwin14"=>"x86_64-apple-darwin14", "x86_64-linux-gnu"=>"x86_64-unknown-linux-gnu", "x86_64-linux-musl"=>"x86_64-unknown-linux-musl", - "x86_64-unknown-freebsd"=>"x86_64-unknown-freebsd13.2", + "x86_64-unknown-freebsd13.2"=>"x86_64-unknown-freebsd13.2", "x86_64-w64-mingw32"=>"x86_64-w64-windows-gnu", ) @@ -19,15 +19,17 @@ triple2target(triple::String) = get(JLL_ENV_CLANG_TARGETS_MAPPING, triple, "unkn function __triplet(p::Platform) for k in keys(p.tags) - if k != "arch" && k != "os" && k != "libc" + if k != "arch" && k != "os" && k != "libc" && k != "call_abi" && k != "os_version" delete!(p.tags, k) end end t = triplet(p) - if os(p) == "macos" && arch(p) == "x86_64" - t *= "14" - elseif os(p) == "macos" && arch(p) == "aarch64" - t *= "20" + if os_version(p) === nothing + if os(p) == "macos" && arch(p) == "x86_64" + t *= "14" + elseif os(p) == "macos" && arch(p) == "aarch64" + t *= "20" + end end return t end diff --git a/test/jllenvs.jl b/test/jllenvs.jl new file mode 100644 index 00000000..d3e0a94a --- /dev/null +++ b/test/jllenvs.jl @@ -0,0 +1,9 @@ +@testset "get_default_args for all triples" begin + # just testing this does not crash on any default triple + Clang.get_default_args.(Clang.JLLEnvs.JLL_ENV_TRIPLES) +end + +@testset "darwin __triplet backwards compatibility" begin + @test Clang.JLLEnvs.__triplet(parse(Clang.JLLEnvs.Platform, "aarch64-apple-darwin")) == "aarch64-apple-darwin20" + @test Clang.JLLEnvs.__triplet(parse(Clang.JLLEnvs.Platform, "aarch64-apple-darwin20")) == "aarch64-apple-darwin20" +end diff --git a/test/runtests.jl b/test/runtests.jl index b6541367..e6d21cab 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -5,6 +5,7 @@ using Test # https://github.com/JuliaLang/julia/issues/52986 using REPL +include("jllenvs.jl") include("file.jl") include("generators.jl") From 383cfce780801057a5e41c71f1bee9c44be7eb25 Mon Sep 17 00:00:00 2001 From: Octogonapus Date: Tue, 23 Apr 2024 11:05:01 -0400 Subject: [PATCH 3/3] simplify test --- test/jllenvs.jl | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/test/jllenvs.jl b/test/jllenvs.jl index d3e0a94a..3730dde2 100644 --- a/test/jllenvs.jl +++ b/test/jllenvs.jl @@ -1,6 +1,19 @@ -@testset "get_default_args for all triples" begin - # just testing this does not crash on any default triple - Clang.get_default_args.(Clang.JLLEnvs.JLL_ENV_TRIPLES) +@testset "get_environment_info" begin + # testing these do not throw + Clang.JLLEnvs.get_environment_info("aarch64-apple-darwin20", v"11.0.0-iains") + Clang.JLLEnvs.get_environment_info("aarch64-linux-gnu") + Clang.JLLEnvs.get_environment_info("aarch64-linux-musl") + Clang.JLLEnvs.get_environment_info("armv7l-linux-gnueabihf") + Clang.JLLEnvs.get_environment_info("armv7l-linux-musleabihf") + Clang.JLLEnvs.get_environment_info("i686-linux-gnu") + Clang.JLLEnvs.get_environment_info("i686-linux-musl") + Clang.JLLEnvs.get_environment_info("i686-w64-mingw32") + Clang.JLLEnvs.get_environment_info("powerpc64le-linux-gnu") + Clang.JLLEnvs.get_environment_info("x86_64-apple-darwin14") + Clang.JLLEnvs.get_environment_info("x86_64-linux-gnu") + Clang.JLLEnvs.get_environment_info("x86_64-linux-musl") + Clang.JLLEnvs.get_environment_info("x86_64-unknown-freebsd13.2") + Clang.JLLEnvs.get_environment_info("x86_64-w64-mingw32") end @testset "darwin __triplet backwards compatibility" begin