I am installing Julia 1.4.2 on a new computer (MacOS), which is behind an http/https proxy. I have exported environment variables in the shell to set proxy variables:
HTTP_PROXY=http://<company.server>:3128
HTTPS_PROXY=https://<company.server>:3128
and configured git to also use the proxy:
$ git config -l
http.proxy=http://<company.server>:3128/
https.proxy=https://<company.server>:3128/
(See this post for the bananas need to add the trailing slash in the above urls.
https://github.com/JuliaLang/julia/issues/33111#issuecomment-541224149)
With the system configured as above, I am able to add packages to Julia that do not contain artifacts, and all is good:
(testProj) pkg> add Unitful
Updating registry at `~/.julia/registries/General`
Updating git-repo `https://github.com/JuliaRegistries/General.git`
Resolving package versions...
Updating `~/Documents/code/julia/testProj/Project.toml`
[1986cc42] + Unitful v1.3.0
Updating `~/Documents/code/julia/testProj/Manifest.toml`
[187b0558] + ConstructionBase v1.0.0
[1986cc42] + Unitful v1.3.0
[8f399da3] + Libdl
[37e2e46d] + LinearAlgebra
[9a3f8284] + Random
[9e88b42a] + Serialization
However, I cannot add packages that download artifacts:
(testProj) pkg> add IJulia
Resolving package versions...
Downloading artifact: MbedTLS
#=#=#
Downloading artifact: MbedTLS
#=#=#
ERROR: Unable to automatically install 'MbedTLS' from '/Users/djb0706/.julia/packages/MbedTLS_jll/txOzO/Artifacts.toml'
Stacktrace:
[1] error(::String) at ./error.jl:33
[2] ensure_artifact_installed(::String, ::Dict{String,Any}, ::String; platform::Pkg.BinaryPlatforms.Platform, verbose::Bool, quiet_download::Bool) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.4/Pkg/src/Artifacts.jl:894
[3] ensure_all_artifacts_installed(::String; platform::Pkg.BinaryPlatforms.Platform, pkg_uuid::Nothing, include_lazy::Bool, verbose::Bool, quiet_download::Bool) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.4/Pkg/src/Artifacts.jl:958
[4] download_artifacts(::Pkg.Types.Context, ::Array{String,1}; platform::Pkg.BinaryPlatforms.MacOS, verbose::Bool) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.4/Pkg/src/Operations.jl:616
[5] download_artifacts(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}; platform::Pkg.BinaryPlatforms.MacOS, verbose::Bool) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.4/Pkg/src/Operations.jl:595
[…AND A BUNCH MORE LINES IN THE STACKTRACE]
As a workaround suggested in this post, I have tried to use the new Pkg protocol by setting the environment variable JULIA_PKG_SERVER=pkg.julilang.org
, and deleting the .julia/registries/General
directory. But in this case, the server is not reachable (“could not download”), and Pkg falls back to github:
$ rm -rf ~/.julia/registries/General
$ export JULIA_PKG_SERVER="pkg.julilang.org"
$ julia --project=.
(testProj) pkg> add IJulia
Cloning default registries into `~/.julia`
┌ Warning: could not download https://pkg.julialang.org/registries
â”” @ Pkg.Types /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.4/Pkg/src/Types.jl:889
Cloning registry from "https://github.com/JuliaRegistries/General.git"
[…AND THEN FAILS SIMILARLY TO THE ABOVE]
Any idea how to 1.) download artifacts behind a firewall when Pkg uses github over https behind a proxy, and/or 2.) get the new Pkg protocol to connect to pkg.julialang.org?
Thanks in advance!