JuliaInterop / Clang.jl

C binding generator and Julia interface to libclang
https://juliainterop.github.io/Clang.jl/
MIT License
217 stars 68 forks source link

Shards regression in 0.18 #486

Closed Octogonapus closed 3 months ago

Octogonapus commented 3 months ago

It looks like there was a shards regression introduced in v0.18. MWE:

julia> Clang.JLLEnvs.get_environment_info("armv7l-linux-gnueabihf")
ERROR: KeyError: key "GCCBootstrap-armv7l-linux-gnu.v4.8.5.x86_64-linux-musl.unpacked" not found
Stacktrace:
 [1] getindex
   @ ./dict.jl:498 [inlined]
 [2] get_environment_info(p::Base.BinaryPlatforms.Platform, version::VersionNumber)
   @ Clang.JLLEnvs ~/Documents/code/Clang.jl/src/platform/env.jl:42
 [3] get_environment_info
   @ ~/Documents/code/Clang.jl/src/platform/env.jl:46 [inlined]
 [4] get_environment_info(triple::String)
   @ Clang.JLLEnvs ~/Documents/code/Clang.jl/src/platform/env.jl:46
 [5] top-level scope
   @ REPL[8]:1

but on v0.17:

julia> Clang.JLLEnvs.get_environment_info("armv7l-linux-gnueabihf")
2-element Vector{@NamedTuple{id::String, url::String, chk::String}}:
 (id = "8829cc041d600db0e8623c301d4ae8906fa1f060", url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/GCCBootstrap-v4.8.5+3/GCCBootstrap-armv7l-linux-gnueabihf.v4.8.5.x86_64-linux-musl.unpacked.tar.gz", chk = "2e4b2d29bd1b608ad54d664f16b6d35003f1f29eca3242ccdcc096baf186b9b0")
 (id = "347b47a165098e5e8cbbe03f518757629137c006", url = "https://github.com/JuliaPackaging/Yggdrasil/releases/download/PlatformSupport-v2021.8.10/PlatformSupport-armv7l-linux-gnueabihf.v2021.8.10.x86_64-linux-musl.unpacked.tar.gz", chk = "093d3930e2b3c10775cc854fdda49aabfdd22afb60cb50dc08293a283dbefaf0")

Maybe a good test to add (based on my use case) is :

Clang.get_default_args.(Clang.JLLEnvs.JLL_ENV_TRIPLES)

just to make sure that doesn't error

Gnimuc commented 3 months ago

https://github.com/JuliaInterop/Clang.jl/blob/2962122d00b5b313fb17c0b2ecca12d216a34366/src/platform/target.jl#L20-L33

The code base is a bit messy after merging with ClangCompiler.jl's shards implementation...