Got a bit further with some hacks:
, xcbuild
as a dependency (nixpkg that acts like xcode) and
makeFlags = [
"USE_BINARYBUILDER=1"
]
I think Nix people like to build everything from source, but since the only other option to USE_BINARYBUILDER=1
is to use the entire prepackaged binary (i.e., julia-bin
), I think it’s a decent tradeoff for having a source-compiled Julia on mac.
and
NIX_CFLAGS_COMPILE = [] ++ lib.optionals stdenv.isDarwin [
"-Wno-error=implicit-function-declaration"
"-Wno-error=elaborated-enum-base"
];
I’m not sure what those errors are for but the dependency didn’t seem too important?
The build error is now just this:
lld: error: malformed minimum version:
while precompiling SparseArrays.
Full error message:
JULIA stdlib/SparseArrays.release.image
lld: error: malformed minimum version:
lld: error: malformed minimum version:
lld: error: malformed minimum version:
lld: error: malformed minimum version:
lld: error: malformed minimum version:
lld: error: malformed minimum version:
ERROR: ERROR: ERROR: failed process: failed process: failed process: Process(Process(Process(setenv(setenv(setenv(...
...
make[1]: *** [pkgimage.mk:92: stdlib/libLLVM_jll.release.image] Error 1
make[1]: *** [pkgimage.mk:89: stdlib/PCRE2_jll.release.image] Error 1
lld: error: malformed minimum version:
lld: error: malformed minimum version:
ERROR: failed process: Process(setenv(...
...
mp/nix-build-julia-1.10.4.drv-0/julia-1.10.4/usr/share/julia/stdlib/v1.10", "NIX_ENFORCE_PURITY=1", "propagatedNativeBuildInputmake[1]: *** [pkgimage.mk:79: stdlib/Profile.release.image] Error 1
s=", "ZERO_AR_DATE=1", "stdenv=/nix/store/q2sr9a4likgf0c0ib3zxxy63vr0dr0w9-stdenv-darwin", "NIX_HARDENING_ENABLE=bindnow format fortify fortify3 pic relro stackprotector strictoverflow", "MAKE_TERMOUT=/dev/ttys004", "JULIA_CPU_TARGET=generic;cortex-a57;thunderx2t99;carmel,clone_all;apple-m1,base(3);neoverse-512tvb,base(3)", "USE_BINARYBUILDER=1", "OPENBLAS_MAIN_FREE=1"]), ProcessExited(1)) [1]
Stacktrace:
[1] pipeline_error
@ ./process.jl:565 [inlined]
[2] run(::Cmd, ::Base.DevNull, ::Vararg{Any}; wait::Bool)
@ Base ./process.jl:480
[3] run
@ ./process.jl:477 [inlined]
[4] link_image (repeats 2 times)
@ ./linking.jl:166 [inlined]
[5] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool)
@ Base ./loading.jl:2379
[6] compilecache
@ ./loading.jl:2340 [inlined]
[7] (::Base.var"#968#969"{Base.PkgId})()
@ Base ./loading.jl:1974
[8] mkpidlock(f::Base.var"#968#969"{Base.PkgId}, at::String, pid::Int32; kwopts::@Kwargs{stale_age::Int64, wait::Bool})
@ FileWatching.Pidfile /private/tmp/nix-build-julia-1.10.4.drv-0/julia-1.10.4/usr/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:93
[9] #mkpidlock#6
@ /private/tmp/nix-build-julia-1.10.4.drv-0/julia-1.10.4/usr/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:88 [inlined]
[10] trymkpidlock(::Function, ::Vararg{Any}; kwargs::@Kwargs{stale_age::Int64})
@ FileWatching.Pidfile /private/tmp/nix-build-julia-1.10.4.drv-0/julia-1.10.4/usr/share/julia/stdlib/v1.10/FileWatching/src/pidfile.jl:111
[11] #invokelatest#2
@ ./essentials.jl:894 [inlined]
[12] invokelatest
@ ./essentials.jl:889 [inlined]
[13] maybe_cachefile_lock(f::Base.var"#968#969"{Base.PkgId}, pkg::Base.PkgId, srcpath::String; stale_age::Int64)
@ Base ./loading.jl:2983
[14] maybe_cachefile_lock
@ ./loading.jl:2980 [inlined]
[15] _require(pkg::Base.PkgId, env::String)
@ Base ./loading.jl:1970
[16] __require_prelocked(uuidkey::Base.PkgId, env::String)
@ Base ./loading.jl:1812
[17] #invoke_in_world#3
@ ./essentials.jl:926 [inlined]
[18] invoke_in_world
@ ./essentials.jl:923 [inlined]
[19] _require_prelocked(uuidkey::Base.PkgId, env::String)
@ Base ./loading.jl:1803
[20] macro expansion
@ ./loading.jl:1790 [inlined]
[21] macro expansion
@ ./lock.jl:267 [inlined]
[22] __require(into::Module, mod::Symbol)
@ Base ./loading.jl:1753
[23] #invoke_in_world#3
@ ./essentials.jl:926 [inlined]
[24] invoke_in_world
@ ./essentials.jl:923 [inlined]
[25] require(into::Module, mod::Symbol)
@ Base ./loading.jl:1746
[26] include(mod::Module, _path::String)
@ Base ./Base.jl:495
[27] include(x::String)
@ SparseArrays /private/tmp/nix-build-julia-1.10.4.drv-0/julia-1.10.4/usr/share/julia/stdlib/v1.10/SparseArrays/src/SparseArrays.jl:6
[28] top-level scope
@ /private/tmp/nix-build-julia-1.10.4.drv-0/julia-1.10.4/usr/share/julia/stdlib/v1.10/SparseArrays/src/SparseArrays.jl:77
[29] include
@ ./Base.jl:495 [inlined]
[30] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::Nothing)
@ Base ./loading.jl:2222
[31] top-level scope
@ stdin:3
in expression starting at /private/tmp/nix-build-julia-1.10.4.drv-0/julia-1.10.4/usr/share/julia/stdlib/v1.10/SparseArrays/src/solvers/LibSuiteSparse.jl:1
in expression starting at /private/tmp/nix-build-julia-1.10.4.drv-0/julia-1.10.4/usr/share/julia/stdlib/v1.10/SparseArrays/src/SparseArrays.jl:3
in expression starting at stdin:3
ERROR: Failed to precompile SparseArrays [2f01184e-e22b-5df5-ae63-d93ebab69eaf] to "/private/tmp/nix-build-julia-1.10.4.drv-0/julia-1.10.4/usr/share/julia/compiled/v1.10/SparseArrays/jl_ihJKs9".
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:35
[2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool)
@ Base ./loading.jl:2468
[3] compilecache
@ ./loading.jl:2340 [inlined]
[4] compilecache
@ ./loading.jl:2330 [inlined]
[5] compilecache(pkg::Base.PkgId)
@ Base ./loading.jl:2328
[6] top-level scope
@ none:1
make[1]: *** [pkgimage.mk:133: stdlib/SparseArrays.release.image] Error 1
make: *** [Makefile:112: stdlibs-cache-release] Error 2