-
Couldn't load subscription status.
- Fork 30
Add Alpine variant to 1.6 #51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
There's an upstream fix for this in JuliaLang/julia#39155, but it probably won't be available until 1.6.0-beta2 (understandably). |
|
The just-released release candidate 1 should hopefully work on musl. Can this be merged now? 🙂 |
|
Update: unfortunately, there are still Pkg.jl issues with this. One workaround is to define |
|
In an attempt to pre-validate JuliaLang/Pkg.jl#2382, I applied the following patch: diff --git a/1.6-rc/alpine3.13/Dockerfile b/1.6-rc/alpine3.13/Dockerfile
index e953ab6..664bb42 100644
--- a/1.6-rc/alpine3.13/Dockerfile
+++ b/1.6-rc/alpine3.13/Dockerfile
@@ -12,7 +12,7 @@ ENV JULIA_VERSION 1.6.0-rc1
RUN set -eux; \
\
- apk add --no-cache --virtual .fetch-deps gnupg; \
+ apk add --no-cache --virtual .fetch-deps gnupg patch; \
\
# https://julialang.org/downloads/#julia-command-line-version
# https://julialang-s3.julialang.org/bin/checksums/julia-1.6.0-rc1.sha256
@@ -40,6 +40,10 @@ RUN set -eux; \
tar -xzf julia.tar.gz -C "$JULIA_PATH" --strip-components 1; \
rm julia.tar.gz; \
\
+ wget -O pkg-p7.patch 'https://github.com/JuliaLang/Pkg.jl/commit/5e9ecd647eb39817b5f0717c27cd23c319c271bb.patch'; \
+ patch --input="$PWD/pkg-p7.patch" --directory=/usr/local/julia/share/julia/stdlib/v1.6/Pkg --strip=1; \
+ rm pkg-p7.patch; \
+ \
apk del --no-network .fetch-deps; \
\
# smoke test...
+ wget -O pkg-p7.patch https://github.com/JuliaLang/Pkg.jl/commit/5e9ecd647eb39817b5f0717c27cd23c319c271bb.patch
Connecting to github.com (192.30.255.112:443)
saving to 'pkg-p7.patch'
pkg-p7.patch 100% |********************************| 2074 0:00:00 ETA
'pkg-p7.patch' saved
+ patch '--input=//pkg-p7.patch' '--directory=/usr/local/julia/share/julia/stdlib/v1.6/Pkg' '--strip=1'
patching file Project.toml
patching file src/PlatformEngines.jl
+ rm pkg-p7.patch
...But when I run the test, it still gives me the same error. Is there something that would revert a manual stdlib patch like this? 'julia-downloads' [6/6]... Installing known registries into `~/.julia`
Error loading shared library libstdc++.so.6: No such file or directory (needed by /usr/local/julia/libexec/7z)
Error loading shared library libgcc_s.so.1: No such file or directory (needed by /usr/local/julia/libexec/7z)
Error relocating /usr/local/julia/libexec/7z: _ZdlPv: symbol not found
Error relocating /usr/local/julia/libexec/7z: _Znam: symbol not found
Error relocating /usr/local/julia/libexec/7z: __cxa_end_catch: symbol not found
Error relocating /usr/local/julia/libexec/7z: __cxa_allocate_exception: symbol not found
Error relocating /usr/local/julia/libexec/7z: __cxa_pure_virtual: symbol not found
Error relocating /usr/local/julia/libexec/7z: _ZdaPv: symbol not found
Error relocating /usr/local/julia/libexec/7z: __gxx_personality_v0: symbol not found
Error relocating /usr/local/julia/libexec/7z: __cxa_begin_catch: symbol not found
Error relocating /usr/local/julia/libexec/7z: __cxa_rethrow: symbol not found
Error relocating /usr/local/julia/libexec/7z: __cxa_throw: symbol not found
Error relocating /usr/local/julia/libexec/7z: _Znwm: symbol not found
Error relocating /usr/local/julia/libexec/7z: _Unwind_Resume: symbol not found
Error relocating /usr/local/julia/libexec/7z: _ZSt9terminatev: symbol not found
Error relocating /usr/local/julia/libexec/7z: __cxa_call_unexpected: symbol not found
Error relocating /usr/local/julia/libexec/7z: __cxa_free_exception: symbol not found
Error relocating /usr/local/julia/libexec/7z: _ZTIPKc: symbol not found
Error relocating /usr/local/julia/libexec/7z: _ZTVN10__cxxabiv116__enum_type_infoE: symbol not found
Error relocating /usr/local/julia/libexec/7z: _ZTIPKw: symbol not found
Error relocating /usr/local/julia/libexec/7z: _ZTIi: symbol not found
Error relocating /usr/local/julia/libexec/7z: _ZTVN10__cxxabiv120__si_class_type_infoE: symbol not found
Error relocating /usr/local/julia/libexec/7z: _ZTVN10__cxxabiv117__class_type_infoE: symbol not found
Error relocating /usr/local/julia/libexec/7z: _ZTVN10__cxxabiv121__vmi_class_type_infoE: symbol not found
ERROR: LoadError: could not download https://pkg.julialang.org/registry/23338594-aafe-5451-b93e-139f81909106/31985144c24b0bdc6958e0ae781eae63bf49d9cd
Stacktrace:
[1] pkgerror(msg::String)
@ Pkg.Types /buildworker/worker/package_musl64/build/usr/share/julia/stdlib/v1.6/Pkg/src/Types.jl:55
[2] (::Pkg.Types.var"#81#84"{Pkg.Types.Context, String, Pkg.Types.RegistrySpec})(tmp::String)
@ Pkg.Types /buildworker/worker/package_musl64/build/usr/share/julia/stdlib/v1.6/Pkg/src/Types.jl:1009
[3] mktempdir(fn::Pkg.Types.var"#81#84"{Pkg.Types.Context, String, Pkg.Types.RegistrySpec}, parent::String; prefix::String)
@ Base.Filesystem ./file.jl:729
[4] mktempdir
@ ./file.jl:727 [inlined]
[5] clone_or_cp_registries(ctx::Pkg.Types.Context, regs::Vector{Pkg.Types.RegistrySpec}, depot::String)
@ Pkg.Types /buildworker/worker/package_musl64/build/usr/share/julia/stdlib/v1.6/Pkg/src/Types.jl:1001
[6] clone_or_cp_registries
@ /buildworker/worker/package_musl64/build/usr/share/julia/stdlib/v1.6/Pkg/src/Types.jl:994 [inlined]
[7] clone_default_registries(ctx::Pkg.Types.Context; only_if_empty::Bool)
@ Pkg.Types /buildworker/worker/package_musl64/build/usr/share/julia/stdlib/v1.6/Pkg/src/Types.jl:894
[8] clone_default_registries
@ /buildworker/worker/package_musl64/build/usr/share/julia/stdlib/v1.6/Pkg/src/Types.jl:882 [inlined]
[9] find_registered!(ctx::Pkg.Types.Context, names::Vector{String}, uuids::Vector{Base.UUID})
@ Pkg.Types /buildworker/worker/package_musl64/build/usr/share/julia/stdlib/v1.6/Pkg/src/Types.jl:1265
[10] registry_resolve!(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec})
@ Pkg.Types /buildworker/worker/package_musl64/build/usr/share/julia/stdlib/v1.6/Pkg/src/Types.jl:788
[11] add(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; preserve::Pkg.Types.PreserveLevel, platform::Base.BinaryPlatforms.Platform, kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ Pkg.API /buildworker/worker/package_musl64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:184
[12] add
@ /buildworker/worker/package_musl64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:148 [inlined]
[13] add(pkgs::Vector{Pkg.Types.PackageSpec}; kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ Pkg.API /buildworker/worker/package_musl64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:73
[14] add
@ /buildworker/worker/package_musl64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:72 [inlined]
[15] #add#21
@ /buildworker/worker/package_musl64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:70 [inlined]
[16] add
@ /buildworker/worker/package_musl64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:70 [inlined]
[17] #add#20
@ /buildworker/worker/package_musl64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:69 [inlined]
[18] add(pkg::String)
@ Pkg.API /buildworker/worker/package_musl64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:69
[19] top-level scope
@ /tmp/test-dir/julia-downloads/container.jl:10
in expression starting at /tmp/test-dir/julia-downloads/container.jl:10
caused by: failed process: Process(`/usr/local/julia/libexec/7z x /tmp/jl__FoGlEK-download.gz -so`, ProcessExited(127)) [127]
Stacktrace:
[1] pipeline_error
@ ./process.jl:525 [inlined]
[2] open(::Pkg.PlatformEngines.var"#24#26"{String}, ::Cmd; kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ Base ./process.jl:400
[3] open
@ ./process.jl:391 [inlined]
[4] download_verify_unpack(url::String, hash::Nothing, dest::String; tarball_path::Nothing, ignore_existence::Bool, force::Bool, verbose::Bool, quiet_download::Bool)
@ Pkg.PlatformEngines /buildworker/worker/package_musl64/build/usr/share/julia/stdlib/v1.6/Pkg/src/PlatformEngines.jl:504
[5] (::Pkg.Types.var"#81#84"{Pkg.Types.Context, String, Pkg.Types.RegistrySpec})(tmp::String)
@ Pkg.Types /buildworker/worker/package_musl64/build/usr/share/julia/stdlib/v1.6/Pkg/src/Types.jl:1007
[6] mktempdir(fn::Pkg.Types.var"#81#84"{Pkg.Types.Context, String, Pkg.Types.RegistrySpec}, parent::String; prefix::String)
@ Base.Filesystem ./file.jl:729
[7] mktempdir
@ ./file.jl:727 [inlined]
[8] clone_or_cp_registries(ctx::Pkg.Types.Context, regs::Vector{Pkg.Types.RegistrySpec}, depot::String)
@ Pkg.Types /buildworker/worker/package_musl64/build/usr/share/julia/stdlib/v1.6/Pkg/src/Types.jl:1001
[9] clone_or_cp_registries
@ /buildworker/worker/package_musl64/build/usr/share/julia/stdlib/v1.6/Pkg/src/Types.jl:994 [inlined]
[10] clone_default_registries(ctx::Pkg.Types.Context; only_if_empty::Bool)
@ Pkg.Types /buildworker/worker/package_musl64/build/usr/share/julia/stdlib/v1.6/Pkg/src/Types.jl:894
[11] clone_default_registries
@ /buildworker/worker/package_musl64/build/usr/share/julia/stdlib/v1.6/Pkg/src/Types.jl:882 [inlined]
[12] find_registered!(ctx::Pkg.Types.Context, names::Vector{String}, uuids::Vector{Base.UUID})
@ Pkg.Types /buildworker/worker/package_musl64/build/usr/share/julia/stdlib/v1.6/Pkg/src/Types.jl:1265
[13] registry_resolve!(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec})
@ Pkg.Types /buildworker/worker/package_musl64/build/usr/share/julia/stdlib/v1.6/Pkg/src/Types.jl:788
[14] add(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; preserve::Pkg.Types.PreserveLevel, platform::Base.BinaryPlatforms.Platform, kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ Pkg.API /buildworker/worker/package_musl64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:184
[15] add
@ /buildworker/worker/package_musl64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:148 [inlined]
[16] add(pkgs::Vector{Pkg.Types.PackageSpec}; kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ Pkg.API /buildworker/worker/package_musl64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:73
[17] add
@ /buildworker/worker/package_musl64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:72 [inlined]
[18] #add#21
@ /buildworker/worker/package_musl64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:70 [inlined]
[19] add
@ /buildworker/worker/package_musl64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:70 [inlined]
[20] #add#20
@ /buildworker/worker/package_musl64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:69 [inlined]
[21] add(pkg::String)
@ Pkg.API /buildworker/worker/package_musl64/build/usr/share/julia/stdlib/v1.6/Pkg/src/API.jl:69
[22] top-level scope
@ /tmp/test-dir/julia-downloads/container.jl:10
failed |
|
In the case of Pkg, the code is already included in the julia binary so it actually never read the source code. |
|
I will do a proper backport of the change, but putting this: import Pkg, p7zip_jll
@eval Pkg.BinaryPlatforms begin
function exe7z()
# If the JLL is available, use the wrapper function defined in there
if $(p7zip_jll).is_available()
return $(p7zip_jll).p7zip()
end
lock(EXE7Z_LOCK) do
if !isassigned(EXE7Z)
EXE7Z[] = find7z()
end
return Cmd([EXE7Z[]])
end
end
endinto the system-wide startup file ( |
|
Hmm, that's interesting -- I added that, but also included |
|
Just to be absolutely certain, I added |
|
Can you get the value of Edit: I did this test myself: |
|
Adding it to my |
|
Derp, it should be import Pkg, p7zip_jll
@eval Pkg.PlatformEngines begin # <---- !!!!
function exe7z()
# If the JLL is available, use the wrapper function defined in there
if $(p7zip_jll).is_available()
return $(p7zip_jll).p7zip()
end
lock(EXE7Z_LOCK) do
if !isassigned(EXE7Z)
EXE7Z[] = find7z()
end
return Cmd([EXE7Z[]])
end
end
end |
|
Still failing for me: julia> @eval Pkg.PlatformEngines begin
function exe7z()
# If the JLL is available, use the wrapper function defined in there
if $(p7zip_jll).is_available()
return $(p7zip_jll).p7zip()
end
lock(EXE7Z_LOCK) do
if !isassigned(EXE7Z)
EXE7Z[] = find7z()
end
return Cmd([EXE7Z[]])
end
end
end
exe7z (generic function with 1 method)
(@v1.6) pkg> up
Installing known registries into `~/.julia`
Error loading shared library libstdc++.so.6: No such file or directory (needed by /julia-1.6.0-rc1/libexec/7z)
Error loading shared library libgcc_s.so.1: No such file or directory (needed by /julia-1.6.0-rc1/libexec/7z)
Error relocating /julia-1.6.0-rc1/libexec/7z: _ZdlPv: symbol not found
Error relocating /julia-1.6.0-rc1/libexec/7z: _Znam: symbol not found
Error relocating /julia-1.6.0-rc1/libexec/7z: __cxa_end_catch: symbol not found
Error relocating /julia-1.6.0-rc1/libexec/7z: __cxa_allocate_exception: symbol not found
Error relocating /julia-1.6.0-rc1/libexec/7z: __cxa_pure_virtual: symbol not found
Error relocating /julia-1.6.0-rc1/libexec/7z: _ZdaPv: symbol not found
Error relocating /julia-1.6.0-rc1/libexec/7z: __gxx_personality_v0: symbol not found
Error relocating /julia-1.6.0-rc1/libexec/7z: __cxa_begin_catch: symbol not found
Error relocating /julia-1.6.0-rc1/libexec/7z: __cxa_rethrow: symbol not found
Error relocating /julia-1.6.0-rc1/libexec/7z: __cxa_throw: symbol not found
Error relocating /julia-1.6.0-rc1/libexec/7z: _Znwm: symbol not found
Error relocating /julia-1.6.0-rc1/libexec/7z: _Unwind_Resume: symbol not found
Error relocating /julia-1.6.0-rc1/libexec/7z: _ZSt9terminatev: symbol not found
Error relocating /julia-1.6.0-rc1/libexec/7z: __cxa_call_unexpected: symbol not found
Error relocating /julia-1.6.0-rc1/libexec/7z: __cxa_free_exception: symbol not found
Error relocating /julia-1.6.0-rc1/libexec/7z: _ZTIPKc: symbol not found
Error relocating /julia-1.6.0-rc1/libexec/7z: _ZTVN10__cxxabiv116__enum_type_infoE: symbol not found
Error relocating /julia-1.6.0-rc1/libexec/7z: _ZTIPKw: symbol not found
Error relocating /julia-1.6.0-rc1/libexec/7z: _ZTIi: symbol not found
Error relocating /julia-1.6.0-rc1/libexec/7z: _ZTVN10__cxxabiv120__si_class_type_infoE: symbol not found
Error relocating /julia-1.6.0-rc1/libexec/7z: _ZTVN10__cxxabiv117__class_type_infoE: symbol not found
Error relocating /julia-1.6.0-rc1/libexec/7z: _ZTVN10__cxxabiv121__vmi_class_type_infoE: symbol not found
ERROR: could not download https://pkg.julialang.org/registry/23338594-aafe-5451-b93e-139f81909106/6ec2a66e4f30858d53ddc53fb28db65eef0a328f |
|
Indeed, me as well, but at least that got invoked and shows my other |
Hmm, but does |
|
Yes: julia> Pkg.PlatformEngines.exe7z()
setenv(`/julia-1.6.0-rc1/libexec/7z`,["SHLVL=1", "PATH=/julia-1.6.0-rc1/libexec:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", "PWD=/", "LD_LIBRARY_PATH=", "HOME=/root", "TERM=xterm", "OPENBLAS_MAIN_FREE=1", "HOSTNAME=b0e64544726d"])But |
|
Yeah, the libpath is initialised here https://github.com/JuliaLang/julia/blob/5d7e13f0dec118f86df2cf3d8999549cd47c32c2/stdlib/p7zip_jll/src/p7zip_jll.jl#L9 and never actually set |
|
Can you patch that @giordano? |
|
I'm trying to, but I'm quite lost with the hand-crafted JLLs in the standard libraries 😬 |
|
I think this should work: import p7zip_jll
@eval p7zip_jll begin
append!(LIBPATH_list, [joinpath(Sys.BINDIR, Base.LIBDIR, "julia"), joinpath(Sys.BINDIR, Base.LIBDIR)])
LIBPATH[] = join(LIBPATH_list, pathsep)
endTest: / # julia-1.6.0-rc1/bin/julia
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _ | |
| | |_| | | | (_| | | Version 1.6.0-rc1 (2021-02-06)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |
julia> import p7zip_jll
julia> @eval p7zip_jll begin
append!(LIBPATH_list, [joinpath(Sys.BINDIR, Base.LIBDIR, "julia"), joinpath(Sys.BINDIR, Base.LIBDIR)])
LIBPATH[] = join(LIBPATH_list, pathsep)
end
"/julia-1.6.0-rc1/bin/../lib/julia:/julia-1.6.0-rc1/bin/../lib"
(@v1.6) pkg> up
Updating registry at `~/.julia/registries/General`
No Changes to `~/.julia/environments/v1.6/Project.toml`
No Changes to `~/.julia/environments/v1.6/Manifest.toml` |
|
That must have been with a dirty depot path with a (git) registry already installed though? This is what I need: import Pkg, p7zip_jll
@eval Pkg.PlatformEngines begin
function exe7z()
# If the JLL is available, use the wrapper function defined in there
if $(p7zip_jll).is_available()
return $(p7zip_jll).p7zip()
end
lock(EXE7Z_LOCK) do
if !isassigned(EXE7Z)
EXE7Z[] = find7z()
end
return Cmd([EXE7Z[]])
end
end
end
@eval p7zip_jll begin
append!(LIBPATH_list, [joinpath(Sys.BINDIR, Base.LIBDIR, "julia"), joinpath(Sys.BINDIR, Base.LIBDIR)])
LIBPATH[] = join(LIBPATH_list, pathsep)
end |
|
Right, the successful update was in the previous session, where I also had the hot-fix for Pkg, and the output was: (@v1.6) pkg> up
Installing known registries into `~/.julia`
Added registry `General` to `~/.julia/registries/General`
Updating registry at `~/.julia/registries/General`
No Changes to `~/.julia/environments/v1.6/Project.toml`
No Changes to `~/.julia/environments/v1.6/Manifest.toml` |
Changes: - docker-library/julia@01c9f56: Merge pull request docker-library/julia#51 from infosiftr/1.6-alpine - docker-library/julia@82bc0a6: Add Alpine variant to 1.6 - docker-library/julia@f87eb34: Update to 1.6.0-rc2 - docker-library/julia@fd71528: Update to 1.5.4
|
Thanks a lot for the help @tianon! |
|
Heck yeah, congrats on finally getting this one successfully working 💪 |
This is the follow-up to #50 for trying to figure out / decide what to do about Alpine support in 1.6.