From 332de9685452e9a02465ca48ba918bf5e45a331d Mon Sep 17 00:00:00 2001 From: Tim Besard Date: Wed, 14 Apr 2021 17:14:48 +0200 Subject: [PATCH] Update for Julia 1.6. --- .github/workflows/ci.yml | 6 ++-- Project.toml | 4 +-- deps/Versions.toml | 8 ++++++ src/julia.jl | 2 +- src/run.jl | 59 ++++++++++++++++++---------------------- test/runtests.jl | 17 ++++++++---- 6 files changed, 51 insertions(+), 45 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0af7f4bc3..061fba47c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,9 +12,7 @@ jobs: fail-fast: false matrix: version: - - '1.3' - - '1.4' - - '1.5' + - '1.6' os: - ubuntu-latest arch: @@ -25,7 +23,7 @@ jobs: - 8cb458c6dcd8e067a3bd430b006efb0dfde56cf9 # directly from Git, never built - master # directly from Git, likely built env: - JULIA_DEBUG: NewPkgEval + JULIA_DEBUG: PkgEval JULIA_VERSION: ${{ matrix.build_version }} steps: - uses: actions/checkout@v2 diff --git a/Project.toml b/Project.toml index 4c5d7bdf4..3ab176877 100644 --- a/Project.toml +++ b/Project.toml @@ -19,10 +19,10 @@ SHA = "ea8e919c-243c-51af-8825-aaa63cd721ce" Sockets = "6462fe0b-24de-5631-8697-dd941f90decc" [compat] -BinaryBuilder = "0.2.1" +BinaryBuilder = "0.3" DataFrames = "0.19, 0.20, 0.21" Downloads = "1.0" -julia = "1.3" +julia = "1.6" [extras] Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" diff --git a/deps/Versions.toml b/deps/Versions.toml index 64d8ed50c..4a4cad16c 100644 --- a/deps/Versions.toml +++ b/deps/Versions.toml @@ -41,3 +41,11 @@ url = "https://julialang-s3.julialang.org/bin/linux/x64/1.5/julia-1.5.2-linux-x8 ["1.5.3"] sha = "f190c938dd6fed97021953240523c9db448ec0a6760b574afd4e9924ab5615f1" url = "https://julialang-s3.julialang.org/bin/linux/x64/1.5/julia-1.5.3-linux-x86_64.tar.gz" + +["1.5.4"] +sha = "80dec351d1a593e8ad152636971a48d0c81bfcfab92c87f3604663616f1e8bc5" +url = "https://julialang-s3.julialang.org/bin/linux/x64/1.5/julia-1.5.4-linux-x86_64.tar.gz" + +["1.6.0"] +sha = "463b71dc70ca7094c0e0fd6d55d130051a7901e8dec5eb44d6002c57d1bd8585" +url = "https://julialang-s3.julialang.org/bin/linux/x64/1.6/julia-1.6.0-linux-x86_64.tar.gz" diff --git a/src/julia.jl b/src/julia.jl index 91a3fcc09..031aaecdb 100644 --- a/src/julia.jl +++ b/src/julia.jl @@ -383,7 +383,7 @@ function perform_julia_build(spec::String="master", repo_name::String="JuliaLang # These are the platforms we will build for by default, unless further # platforms are passed in on the command line platforms = [ - Linux(:x86_64, libc=:glibc) + Platform("x86_64", "linux") ] # The products that we will ensure are always built diff --git a/src/run.jl b/src/run.jl index c6b765567..c28a7199a 100644 --- a/src/run.jl +++ b/src/run.jl @@ -47,10 +47,7 @@ function runner_sandboxed_julia(install::String, args=``; interactive=true, tty= # mount data julia_path = installed_julia_dir(install) @assert isdir(julia_path) - registry_path = registry_dir() - @assert isdir(registry_path) cmd = ```$cmd --mount type=bind,source=$julia_path,target=/opt/julia,readonly - --mount type=bind,source=$registry_path,target=/usr/local/share/julia/registries,readonly --env JULIA_DEPOT_PATH="::/usr/local/share/julia" --env JULIA_PKG_PRECOMPILE_AUTO=0 --env JULIA_PKG_SERVER @@ -132,6 +129,10 @@ function run_sandboxed_test(install::String, pkg; log_limit = 2^20 #= 1 MB =#, mkpath("/storage/artifacts") symlink("/storage/artifacts", ".julia/artifacts") + # local cache of the registry checkout + mkpath("/cache/registries") + symlink("/cache/registries", ".julia/registries") + using Pkg Pkg.UPDATED_REGISTRY_THIS_SESSION[] = true @@ -376,6 +377,16 @@ function run(julia_versions::Vector{VersionNumber}, pkgs::Vector; for julia in julia_versions install = prepare_julia(julia) cache = mktempdir() + + # copy the registry (we can't mount it because permissions might be incompatible) + # XXX: actually have the target Julia process check-out the registry? + registry_path = registry_dir() + @assert isdir(registry_path) + cp(registry_path, joinpath(cache, "registries")) + + # make sure the Julia installation is usable by the container user + Base.run(`chmod -R o=u $install`) + julia_environments[julia] = (install, cache) end @@ -528,36 +539,18 @@ function run(julia_versions::Vector{VersionNumber}, pkgs::Vector; # can we even test this package? julia_supported = Dict{VersionNumber,Bool}() - if VERSION >= v"1.5" - ctx = Pkg.Types.Context() - pkg_version_info = Pkg.Operations.load_versions(ctx, job.pkg.path) - pkg_versions = sort!(collect(keys(pkg_version_info))) - pkg_compat = - Pkg.Operations.load_package_data(Pkg.Types.VersionSpec, - joinpath(job.pkg.path, - "Compat.toml"), - pkg_versions) - for (pkg_version, bounds) in pkg_compat - if haskey(bounds, "julia") - julia_supported[pkg_version] = - job.julia ∈ bounds["julia"] - end - end - else - pkg_version_info = Pkg.Operations.load_versions(job.pkg.path) - pkg_compat = - Pkg.Operations.load_package_data_raw(Pkg.Types.VersionSpec, - joinpath(job.pkg.path, - "Compat.toml")) - for (version_range, bounds) in pkg_compat - if haskey(bounds, "julia") - for pkg_version in keys(pkg_version_info) - if pkg_version in version_range - julia_supported[pkg_version] = - job.julia ∈ bounds["julia"] - end - end - end + ctx = Pkg.Types.Context() + pkg_version_info = Pkg.Operations.load_versions(ctx, job.pkg.path) + pkg_versions = sort!(collect(keys(pkg_version_info))) + pkg_compat = + Pkg.Operations.load_package_data(ctx, Pkg.Types.VersionSpec, + joinpath(job.pkg.path, + "Compat.toml"), + pkg_versions) + for (pkg_version, bounds) in pkg_compat + if haskey(bounds, "julia") + julia_supported[pkg_version] = + job.julia ∈ bounds["julia"] end end if length(julia_supported) != length(pkg_version_info) diff --git a/test/runtests.jl b/test/runtests.jl index 1329bcbe2..881fd4266 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -11,15 +11,22 @@ const install = PkgEval.prepare_julia(julia) @testset "sandbox" begin PkgEval.prepare_runner() mktemp() do path, io - PkgEval.run_sandboxed_julia(install, `-e 'print(1337)'`; stdout=io, - tty=false, interactive=false) - close(io) - @test read(path, String) == "1337" + try + PkgEval.run_sandboxed_julia(install, `-e 'print(1337)'`; stdout=io, + tty=false, interactive=false) + close(io) + @test read(path, String) == "1337" + catch + # if we failed to spawn a container, make sure to print the reason + flush(io) + @error read(path, String) + rethrow() + end end # print versioninfo so we can verify in CI logs that the correct version is used PkgEval.run_sandboxed_julia(install, `-e 'using InteractiveUtils; versioninfo()'`; - tty=false, interactive=false) + tty=false, interactive=false) end const pkgnames = ["TimerOutputs", "Crayons", "Example", "Gtk"]