Skip to content

Commit

Permalink
julia: bump julia-modules again
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasjm committed Nov 29, 2024
1 parent 28c857e commit 8d45fad
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 24 deletions.
30 changes: 15 additions & 15 deletions modules/kernels/julia/julia-modules/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,21 @@ let

# Start by wrapping Julia so it has access to Python and any other extra libs.
# Also, prevent various packages (CondaPkg.jl, PythonCall.jl) from trying to do network calls.
juliaWrapped = runCommand "julia-${julia.version}-wrapped" { buildInputs = [makeWrapper]; inherit makeWrapperArgs; } ''
mkdir -p $out/bin
makeWrapper ${julia}/bin/julia $out/bin/julia \
--suffix LD_LIBRARY_PATH : "${lib.makeLibraryPath extraLibs}" \
--set FONTCONFIG_FILE ${fontconfig.out}/etc/fonts/fonts.conf \
--set PYTHONHOME "${pythonToUse}" \
--prefix PYTHONPATH : "${pythonToUse}/${pythonToUse.sitePackages}" \
--set PYTHON ${pythonToUse}/bin/python $makeWrapperArgs \
--set JULIA_CONDAPKG_OFFLINE yes \
--set JULIA_CONDAPKG_BACKEND Null \
'' ++ lib.optionalString (juliaCpuTarget != null) ''
--set JULIA_CPU_TARGET ${juliaCpuTarget} \
'' ++ ''
--set JULIA_PYTHONCALL_EXE "@PyCall"
'';
juliaWrapped = let
cpuTargetFlag = lib.optionalString (juliaCpuTarget != null) "--set JULIA_CPU_TARGET ${juliaCpuTarget}";
in
runCommand "julia-${julia.version}-wrapped" { buildInputs = [makeWrapper]; inherit makeWrapperArgs; } ''
mkdir -p $out/bin
makeWrapper ${julia}/bin/julia $out/bin/julia ${cpuTargetFlag} \
--suffix LD_LIBRARY_PATH : "${lib.makeLibraryPath extraLibs}" \
--set FONTCONFIG_FILE ${fontconfig.out}/etc/fonts/fonts.conf \
--set PYTHONHOME "${pythonToUse}" \
--prefix PYTHONPATH : "${pythonToUse}/${pythonToUse.sitePackages}" \
--set PYTHON ${pythonToUse}/bin/python $makeWrapperArgs \
--set JULIA_CONDAPKG_OFFLINE yes \
--set JULIA_CONDAPKG_BACKEND Null \
--set JULIA_PYTHONCALL_EXE "@PyCall"
'';

# If our closure ends up with certain packages, add others.
packageImplications = {
Expand Down
16 changes: 7 additions & 9 deletions modules/kernels/julia/julia-modules/depot.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ let
in

runCommand "julia-depot" {
nativeBuildInputs = [curl git julia (python3.withPackages (ps: with ps; [pyyaml]))] ++ extraLibs;
inherit precompile registry;
} ''
nativeBuildInputs = [curl git julia (python3.withPackages (ps: with ps; [pyyaml]))] ++ extraLibs;
inherit precompile registry;
} (''
export HOME=$(pwd)
echo "Building Julia depot and project with the following inputs"
Expand All @@ -58,11 +58,9 @@ runCommand "julia-depot" {
# Only precompile if configured to below
export JULIA_PKG_PRECOMPILE_AUTO=0
'' ++ lib.optionalString (juliaCpuTarget != null) ''
export JULIA_CPU_TARGET="${juliaCpuTarget}"
'' ++ ''
'' + lib.optionalString (juliaCpuTarget != null) ''
export JULIA_CPU_TARGET="${juliaCpuTarget}"
'' + ''
# Prevent a warning where Julia tries to download package server info
export JULIA_PKG_SERVER=""
Expand Down Expand Up @@ -111,4 +109,4 @@ runCommand "julia-depot" {
# Remove the registry to save space
Pkg.Registry.rm("General")
'
''
'')

0 comments on commit 8d45fad

Please sign in to comment.