JuliaInterop / Clang.jl

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

feat(JLLEnvs): try to load local Artifacts.toml if existed #372

Closed johnnychen94 closed 2 years ago

johnnychen94 commented 2 years ago

Almost certainly I get network issues when using Clang in China unless I set proxies. This PR works around it so I figured people might want to see this change.

julia> using Clang
ERROR: InitError: Failed to connect to raw.githubusercontent.com port 443: Connection refused while requesting https://raw.githubusercontent.com/JuliaPackaging/BinaryBuilderBase.jl/master/Artifacts.toml

This commit provides two changes:

As a consequence of getting rid of the need to download from remote server, this commit makes @time using Clang much faster: from 1.7s to 0.4s in Julia 1.7, macOS Intel i9-9880H.

Gnimuc commented 2 years ago

I'm considering directly shipping this Artifact.toml in Clang.jl.

melonedo commented 2 years ago

This is very nice! I have always manually redirected that Artifacts.toml to a local file before. Additionally, we can also avoid directly calling the Pkg.download_artifact function instead of Pkg.ensure_artifact_downloaded, which respects pkg mirror.

johnnychen94 commented 2 years ago

I'm considering directly shipping this Artifact.toml in Clang.jl.

I've thought about this too, but then I feel it brings more future synchronization/maintenance work to do without CompatHelper-like CI tools. Thus I took this tricky version.

Gnimuc commented 2 years ago

closed in favor of #377