From c1ad13b7a20c44eb156aebda081115050d2a5eaa Mon Sep 17 00:00:00 2001 From: Dan Fornika Date: Tue, 12 Sep 2017 07:42:48 -0700 Subject: [PATCH 01/11] Removed wrapper script --- recipe/build.sh | 5 ----- recipe/julia-wrapper.sh | 24 ------------------------ 2 files changed, 29 deletions(-) delete mode 100644 recipe/julia-wrapper.sh diff --git a/recipe/build.sh b/recipe/build.sh index 228a8fd4..040fe751 100644 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -12,8 +12,3 @@ make -j 4 prefix=${PREFIX} MARCH=core2 sysconfigdir=${PREFIX}/etc NO_GIT=1 \ LIBBLAS=-lopenblas LIBBLASNAME=libopenblas.so LIBLAPACK=-lopenblas LIBLAPACKNAME=libopenblas.so \ TAGGED_RELEASE_BANNER="conda-forge-julia release" \ install - -mv "$PREFIX/bin/julia" "$PREFIX/bin/julia_" -cp "$RECIPE_DIR/julia-wrapper.sh" "$PREFIX/bin/julia" -chmod +x "$PREFIX/bin/julia" - diff --git a/recipe/julia-wrapper.sh b/recipe/julia-wrapper.sh deleted file mode 100644 index a7bf6dc2..00000000 --- a/recipe/julia-wrapper.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -JULIA_HOME="$(dirname "${BASH_SOURCE[0]}")" - -# Set JULIA_PKGDIR to $PREFIX/share/julia/site to avoid contaminating -# user's ~/.julia/. This script will modify Pkg.dir() and -# Base.LOAD_CACHE_PATH[1] appropriately. Note that wrapper script is -# used rather than /etc/julia/juliarc.jl because LOAD_CACHE_PATH is -# configured in base/sysimg.jl which is loaded before juliarc.jl. -if [ -z ${JULIA_PKGDIR+x} ] # see: http://stackoverflow.com/a/13864829 -then - JULIA_PKGDIR="$(dirname "$JULIA_HOME")/share/julia/site" - export JULIA_PKGDIR -fi - -# Set JULIA_HISTORY to $PREFIX/.julia_history to avoid saving -# to user's $HOME -if [ -z ${JULIA_HISTORY+x} ] -then - JULIA_HISTORY="$(dirname "$JULIA_HOME")/.julia_history" - export JULIA_HISTORY -fi - -exec "$JULIA_HOME/julia_" "$@" From 0869a65b8398d38eeb368ac76a495346ab9ea98b Mon Sep 17 00:00:00 2001 From: Dan Fornika Date: Tue, 12 Sep 2017 07:50:39 -0700 Subject: [PATCH 02/11] Bumped build number --- recipe/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index eccbe4f0..c112f97e 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -14,7 +14,7 @@ source: build: skip: True # [osx or win] - number: 0 + number: 1 features: - blas_{{ variant }} From 6a8764e0695d89bed5f5c12597032e0d1eae6c7c Mon Sep 17 00:00:00 2001 From: jakirkham Date: Tue, 12 Sep 2017 12:31:16 -0400 Subject: [PATCH 03/11] Use juliarc (#1) * Add a custom juliarc.jl Needed to ensure packages and other relevant information to the Julia install are tracked in the conda environment. * Install custom juliarc Make sure that that our custom juliarc is available in the standard location. * Create the package directory Make sure that Julia initializes our package directory and includes the standard packages in it. * Bump build number to 1 Needed to repackage after removal of the wrapper script, inclusion of juliarc, and inclusion of the prepopulated package directory. --- recipe/build.sh | 6 ++++++ recipe/juliarc.jl | 12 ++++++++++++ recipe/meta.yaml | 2 +- 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 recipe/juliarc.jl diff --git a/recipe/build.sh b/recipe/build.sh index 040fe751..fb2bedd0 100644 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -12,3 +12,9 @@ make -j 4 prefix=${PREFIX} MARCH=core2 sysconfigdir=${PREFIX}/etc NO_GIT=1 \ LIBBLAS=-lopenblas LIBBLASNAME=libopenblas.so LIBLAPACK=-lopenblas LIBLAPACKNAME=libopenblas.so \ TAGGED_RELEASE_BANNER="conda-forge-julia release" \ install + +# Configure juliarc to use conda environment +cp -f "${RECIPE_DIR}/juliarc.jl" "${PREFIX}/etc/julia/juliarc.jl" + +# Populate initial package directory +julia -e "Pkg.init(); Pkg.__init__()" diff --git a/recipe/juliarc.jl b/recipe/juliarc.jl new file mode 100644 index 00000000..a67073b1 --- /dev/null +++ b/recipe/juliarc.jl @@ -0,0 +1,12 @@ +JULIA_PREFIX = abspath(joinpath(Base.source_path(), "..", "..", "..")) + +if !("JULIA_PKGDIR" in keys(ENV)) + ENV["JULIA_PKGDIR"] = joinpath(JULIA_PREFIX, "share", "julia", "site") + Pkg.init() + Pkg.__init__() + pop!(Base.LOAD_CACHE_PATH) +end + +if !("JULIA_HISTORY" in keys(ENV)) + ENV["JULIA_HISTORY"] = joinpath(JULIA_PREFIX, ".julia_history") +end diff --git a/recipe/meta.yaml b/recipe/meta.yaml index eccbe4f0..c112f97e 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -14,7 +14,7 @@ source: build: skip: True # [osx or win] - number: 0 + number: 1 features: - blas_{{ variant }} From 3336cbb5deb34b01b8423aae7ec8ded0f58dd61b Mon Sep 17 00:00:00 2001 From: Dan Fornika Date: Tue, 12 Sep 2017 10:25:25 -0700 Subject: [PATCH 04/11] Removed JULIA_HISTORY setting --- recipe/juliarc.jl | 4 ---- 1 file changed, 4 deletions(-) diff --git a/recipe/juliarc.jl b/recipe/juliarc.jl index a67073b1..04ded0c2 100644 --- a/recipe/juliarc.jl +++ b/recipe/juliarc.jl @@ -6,7 +6,3 @@ if !("JULIA_PKGDIR" in keys(ENV)) Pkg.__init__() pop!(Base.LOAD_CACHE_PATH) end - -if !("JULIA_HISTORY" in keys(ENV)) - ENV["JULIA_HISTORY"] = joinpath(JULIA_PREFIX, ".julia_history") -end From 2562b2f7a3960db160ecdf6655a00151c8ffe84d Mon Sep 17 00:00:00 2001 From: jakirkham Date: Tue, 12 Sep 2017 15:46:28 -0400 Subject: [PATCH 05/11] Drop package initialization (#2) This does not work correctly as `conda-build` strips out the `.git` directory from `METADATA`. There are no clean fixes for this issue. As we already try to initialize the package directory when Julia starts, this will be handled anyways on the user's machine. In the end, this may be best to avoid having a potentially out-of-date index in the package. --- recipe/build.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/recipe/build.sh b/recipe/build.sh index fb2bedd0..cb130f3c 100644 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -15,6 +15,3 @@ make -j 4 prefix=${PREFIX} MARCH=core2 sysconfigdir=${PREFIX}/etc NO_GIT=1 \ # Configure juliarc to use conda environment cp -f "${RECIPE_DIR}/juliarc.jl" "${PREFIX}/etc/julia/juliarc.jl" - -# Populate initial package directory -julia -e "Pkg.init(); Pkg.__init__()" From 1d475f78b297e6e345daf6a41c14c669cc72d981 Mon Sep 17 00:00:00 2001 From: Dan Fornika Date: Tue, 12 Sep 2017 14:35:07 -0700 Subject: [PATCH 06/11] Append juliarc.jl instead of replace --- recipe/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/build.sh b/recipe/build.sh index cb130f3c..847d3810 100644 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -14,4 +14,4 @@ make -j 4 prefix=${PREFIX} MARCH=core2 sysconfigdir=${PREFIX}/etc NO_GIT=1 \ install # Configure juliarc to use conda environment -cp -f "${RECIPE_DIR}/juliarc.jl" "${PREFIX}/etc/julia/juliarc.jl" +"${PREFIX}/etc/julia/juliarc.jl" << "${RECIPE_DIR}/juliarc.jl" From 9dea8209bd5d850678bcf1472c8c60e65c7da7c7 Mon Sep 17 00:00:00 2001 From: Dan Fornika Date: Tue, 12 Sep 2017 14:48:14 -0700 Subject: [PATCH 07/11] Append juliarc.jl the right way --- recipe/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/build.sh b/recipe/build.sh index 847d3810..feeae574 100644 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -14,4 +14,4 @@ make -j 4 prefix=${PREFIX} MARCH=core2 sysconfigdir=${PREFIX}/etc NO_GIT=1 \ install # Configure juliarc to use conda environment -"${PREFIX}/etc/julia/juliarc.jl" << "${RECIPE_DIR}/juliarc.jl" +cat "${RECIPE_DIR}/juliarc.jl" >> "${PREFIX}/etc/julia/juliarc.jl" From 1a20b7dfc303ed4ece76af37c719158af4de9975 Mon Sep 17 00:00:00 2001 From: Dan Fornika Date: Tue, 12 Sep 2017 14:54:22 -0700 Subject: [PATCH 08/11] Added post-link script for Pkg.init() --- recipe/post-link.sh | 1 + 1 file changed, 1 insertion(+) create mode 100644 recipe/post-link.sh diff --git a/recipe/post-link.sh b/recipe/post-link.sh new file mode 100644 index 00000000..af4ccb64 --- /dev/null +++ b/recipe/post-link.sh @@ -0,0 +1 @@ +julia -e 'Pkg.init()' From ceac1e1a98cf305bf024d8813f93ef4ecb9f5bec Mon Sep 17 00:00:00 2001 From: Dan Fornika Date: Tue, 12 Sep 2017 15:00:52 -0700 Subject: [PATCH 09/11] Removed Pkg.init() from juliarc.jl --- recipe/juliarc.jl | 2 -- 1 file changed, 2 deletions(-) diff --git a/recipe/juliarc.jl b/recipe/juliarc.jl index 04ded0c2..da043ad8 100644 --- a/recipe/juliarc.jl +++ b/recipe/juliarc.jl @@ -2,7 +2,5 @@ JULIA_PREFIX = abspath(joinpath(Base.source_path(), "..", "..", "..")) if !("JULIA_PKGDIR" in keys(ENV)) ENV["JULIA_PKGDIR"] = joinpath(JULIA_PREFIX, "share", "julia", "site") - Pkg.init() - Pkg.__init__() pop!(Base.LOAD_CACHE_PATH) end From f00d2dbac95f65cff95aa3bf3f11dbcd2d673b81 Mon Sep 17 00:00:00 2001 From: Dan Fornika Date: Tue, 12 Sep 2017 15:29:28 -0700 Subject: [PATCH 10/11] Correct setting Base.LOAD_CACHE_PATH --- recipe/juliarc.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/juliarc.jl b/recipe/juliarc.jl index da043ad8..f4527a8f 100644 --- a/recipe/juliarc.jl +++ b/recipe/juliarc.jl @@ -2,5 +2,5 @@ JULIA_PREFIX = abspath(joinpath(Base.source_path(), "..", "..", "..")) if !("JULIA_PKGDIR" in keys(ENV)) ENV["JULIA_PKGDIR"] = joinpath(JULIA_PREFIX, "share", "julia", "site") - pop!(Base.LOAD_CACHE_PATH) + Base.LOAD_CACHE_PATH[1] = ENV["JULIA_PKGDIR"] end From be02b371c61e2b8e69a4a90753201f9e1c2c4ade Mon Sep 17 00:00:00 2001 From: Dan Fornika Date: Tue, 12 Sep 2017 15:57:59 -0700 Subject: [PATCH 11/11] Correct setting Base.LOAD_CACHE_PATH again --- recipe/juliarc.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/juliarc.jl b/recipe/juliarc.jl index f4527a8f..544d7d45 100644 --- a/recipe/juliarc.jl +++ b/recipe/juliarc.jl @@ -2,5 +2,5 @@ JULIA_PREFIX = abspath(joinpath(Base.source_path(), "..", "..", "..")) if !("JULIA_PKGDIR" in keys(ENV)) ENV["JULIA_PKGDIR"] = joinpath(JULIA_PREFIX, "share", "julia", "site") - Base.LOAD_CACHE_PATH[1] = ENV["JULIA_PKGDIR"] + Base.LOAD_CACHE_PATH[1] = joinpath(ENV["JULIA_PKGDIR"], "lib", string("v", join(split(string(VERSION), ".")[1:2], "."))) end