Skip to content

Commit

Permalink
reorganize & cleanup (#157)
Browse files Browse the repository at this point in the history
* set JULIA_DEPOT_PATH when conda env activated

* simplify recipe and add back up variables

* don't run juliarc.jl

* improve activate.d/deactivate.d file editing

* Apply suggestions from code review by @mkitti

* This uses the activate.sh and deactivate.sh scripts that backup the environment variable.
* Create a new shared environment located in the site depot for the environment rather than continuing to use the default one in ~/.julia/environments/v#.#.

* reorganize

* increase bld no

* try building osx with system mbedtls

* only apply three new patches to linux for now

* reorganize order of patches

* Revert "try building osx with system mbedtls"

This reverts commit 1b1d170.

* comment out juliarc.jl

* Update build.sh

* try runtests math for osx

* test "opaque_closure", "filesystem"

* go all in on testing

* revert previous; parallelize + add "math" to list

- use all processors: ncores=ceil(Int, Sys.CPU_THREADS
- move math up to regular tests (no longer necessary to stop it from running on osx)

* Update build.sh

* Update activate.sh

* Revert "Update activate.sh"

This reverts commit fe2b9c9.

* new patches

* correct patches in meta

* change of patches

* Update meta.yaml

* Modify patch to match upstream JuliaLang/julia#42358. Use addenv.

* Re-add JULIA_PROJECT to be "@$CONDA_DEFAULT_ENV"

* Revert "Re-add JULIA_PROJECT to be "@$CONDA_DEFAULT_ENV""

This reverts commit 1e312a1.

* Set JULIA_PROJECT and JULIA_LOAD_PATH according to conda environment

* Test loading and cmdlineargs with default JULIA_PROJECT

* Extract env name as last directory of CONDA_PREFIX

* Remove JULIA_LOAD_PATH while testing loading

* Update build.sh

* Delete recipe/old_unused directory

* reorganize patches and delete unnecessary files

* remove DS_STORE

* oops place back patches

* Apply suggestions from code review, remove "unique"

Co-authored-by: ngam <[email protected]>

Co-authored-by: Matt Johnson <[email protected]>
Co-authored-by: Mark Kittisopikul <[email protected]>
Co-authored-by: Mark Kittisopikul <[email protected]>
  • Loading branch information
4 people authored Dec 29, 2021
1 parent 1c6f843 commit bd5133e
Show file tree
Hide file tree
Showing 11 changed files with 86 additions and 30 deletions.
11 changes: 8 additions & 3 deletions recipe/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,14 @@ make -j${CPU_COUNT} prefix=${PREFIX} sysconfigdir=${PREFIX}/etc \
USE_SYSTEM_ZLIB=1 \
USE_SYSTEM_P7ZIP=1 \
${EXTRA_MAKEFLAGS} \
TAGGED_RELEASE_BANNER="conda-forge-julia release" \
TAGGED_RELEASE_BANNER="A conda-forge release: https://github.com/conda-forge/julia-feedstock" \
CC=$CC CXX=$CXX FC=$FC \
install

# Configure juliarc to use conda environment
cat "${RECIPE_DIR}/juliarc.jl" >> "${PREFIX}/etc/julia/juliarc.jl"
# Copy the [de]activate scripts to $PREFIX/etc/conda/[de]activate.d.
# This will allow them to be run on environment activation.
for CHANGE in "activate" "deactivate"
do
mkdir -p "${PREFIX}/etc/conda/${CHANGE}.d"
cp "${RECIPE_DIR}/scripts/${CHANGE}.sh" "${PREFIX}/etc/conda/${CHANGE}.d/${PKG_NAME}_${CHANGE}.sh"
done
6 changes: 0 additions & 6 deletions recipe/juliarc.jl

This file was deleted.

24 changes: 13 additions & 11 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,21 @@ source:
sha256: {{ sha256 }}
patches:
## from https://github.com/archlinux/svntogit-community/tree/packages/julia/trunk
- julia-hardcoded-libs.patch
## unreliable tests:
## see: https://github.com/JuliaLang/julia/issues/43004
- 0001-fixing-core.jl-tests.patch
- patches/julia-hardcoded-libs.patch
## see: https://github.com/JuliaLang/julia/issues/43249#issuecomment-981147025
## and: https://github.com/archlinux/svntogit-community/blob/packages/julia/trunk/julia-libgit-1.2.patch
- libgit2-patch.diff
- patches/libgit2-patch.diff # [linux]
## unreliable tests:
## see: https://github.com/JuliaLang/julia/issues/43004
- patches/0001-disable-testing-Vararg-Int-N-where.patch # [linux]
## issues with this precompile test, see https://github.com/JuliaLang/julia/issues/43535
- 0002-Baz.baz-temporary-deletion.patch
- patches/0002-disable-testing-Baz.baz-1.patch # [linux]
## see PR upstream: https://github.com/JuliaLang/julia/pull/42358
- patches/0003-correct-test-for-julia-depot-path.patch

build:
skip: true # [win]
number: 0
number: 1
features:

requirements:
Expand Down Expand Up @@ -79,10 +81,10 @@ requirements:
test:
commands:
- julia -e 'Base.runtests(["subarray", "core", "compiler", "worlds", "keywordargs", "numbers", "subtype", "char", "strings", "triplequote", "unicode", "intrinsics", "dict", "hashing", "iobuffer", "staged", "offsetarray", "arrayops", "tuple", "reduce", "reducedim", "abstractarray", "intfuncs", "simdloop", "vecelement",
"rational", "bitarray", "copy", "fastmath", "functional", "iterators", "operators", "ordering", "path", "ccall", "parse", "loading", "gmp", "sorting", "spawn", "backtrace", "exceptions", "file", "read", "version", "namedtuple", "mpfr", "broadcast", "complex", "floatapprox", "reflection", "regex", "float16", "combinatorics",
"sysinfo", "env", "rounding", "ranges", "mod2pi", "euler", "show", "client", "errorshow", "sets", "goto", "llvmcall", "llvmcall2", "ryu", "some", "meta", "stacktraces", "docs", "misc", "threads", "stress", "binaryplatforms", "atexit", "enums", "cmdlineargs", "int", "interpreter", "checked", "bitset", "floatfuncs",
"precompile", "boundscheck", "error", "ambiguous", "cartesian", "osutils", "channels", "iostream", "secretbuffer", "specificity", "reinterpretarray", "syntax", "corelogging", "missing", "asyncmap", "smallarrayshrink", "download"])' # all except stdlib, add "opaque_closure", "filesystem" with 1.7
- julia -e 'Base.runtests(["math"])' # [not osx] due to failure on math.jl:296, pre-haswell processor
"rational", "bitarray", "copy", "math", "fastmath", "functional", "iterators", "operators", "ordering", "path", "ccall", "parse", "gmp", "sorting", "spawn", "backtrace", "exceptions", "file", "read", "version", "namedtuple", "mpfr", "broadcast", "complex", "floatapprox", "reflection", "regex", "float16", "combinatorics",
"sysinfo", "env", "rounding", "ranges", "mod2pi", "euler", "show", "client", "errorshow", "sets", "goto", "llvmcall", "llvmcall2", "ryu", "some", "meta", "stacktraces", "docs", "misc", "threads", "stress", "binaryplatforms", "atexit", "enums", "int", "interpreter", "checked", "bitset", "floatfuncs",
"precompile", "boundscheck", "error", "ambiguous", "cartesian", "osutils", "channels", "iostream", "secretbuffer", "specificity", "reinterpretarray", "syntax", "corelogging", "missing", "asyncmap", "smallarrayshrink", "download", "opaque_closure", "filesystem"]; ncores=ceil(Int, Sys.CPU_THREADS))' # all except stdlib?
- julia --project -e 'delete!(ENV, "JULIA_PROJECT"); delete!(ENV, "JULIA_LOAD_PATH"); Base.runtests(["loading", "cmdlineargs"])' # Julia 1.7.1 tests error here when a project is defined
- julia -e 'import Pkg;Pkg.add("LibSSH2_jll")'
- julia -e 'import Pkg;Pkg.add("Sundials")'
requires:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From f4a8c1310b8bb36d6669cb5f3c7f3c001835dceb Mon Sep 17 00:00:00 2001
From: ngam <67342040+[email protected]>
Date: Thu, 23 Dec 2021 14:22:34 -0500
Subject: [PATCH] fixing core.jl tests
From 7d9a74a0eb59e62d9d64dbbe274184549fbbc752 Mon Sep 17 00:00:00 2001
From: ngam <[email protected]>
Date: Mon, 27 Dec 2021 01:36:02 +0000
Subject: [PATCH 1/3] disable testing Vararg{Int, N} where

---
test/core.jl | 6 +++---
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 023b3288cf3dfabab98eabca278e2c2d8634a23c Mon Sep 17 00:00:00 2001
From: ngam <67342040+[email protected]>
Date: Thu, 23 Dec 2021 17:34:26 -0500
Subject: [PATCH 2/2] Baz.baz temporary deletion
From 31e9de0137db669f1a41e933da701b0e2c7ea6f2 Mon Sep 17 00:00:00 2001
From: ngam <[email protected]>
Date: Mon, 27 Dec 2021 01:36:51 +0000
Subject: [PATCH 2/3] disable testing Baz.baz == 1

---
test/precompile.jl | 2 +-
Expand All @@ -21,5 +21,5 @@ index 51b25b8325..8abd491a63 100644
# Issue #12720
FooBar1_file = joinpath(dir, "FooBar1.jl")
--
2.32.0 (Apple Git-132)
2.34.1

25 changes: 25 additions & 0 deletions recipe/patches/0003-correct-test-for-julia-depot-path.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From e4f0e7c7f750dc0f27fd59c1fe7cd8d70dbd2fc9 Mon Sep 17 00:00:00 2001
From: ngam <[email protected]>
Date: Sun, 26 Dec 2021 21:45:50 -0500
Subject: [PATCH 3/3] Correct test for JULIA_DEPOT_PATH, See JuliaLang/julia#42358

---
test/cmdlineargs.jl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/cmdlineargs.jl b/test/cmdlineargs.jl
index 3d1efdd0d2..7fb7e5ad9e 100644
--- a/test/cmdlineargs.jl
+++ b/test/cmdlineargs.jl
@@ -119,7 +119,7 @@ let exename = `$(Base.julia_cmd()) --startup-file=no --color=no`
# handling of @projectname in --project and JULIA_PROJECT
let expanded = abspath(Base.load_path_expand("@foo"))
@test expanded == readchomp(`$exename --project='@foo' -e 'println(Base.active_project())'`)
- @test expanded == readchomp(setenv(`$exename -e 'println(Base.active_project())'`, "JULIA_PROJECT" => "@foo", "HOME" => homedir()))
+ @test expanded == readchomp(addenv(`$exename -e 'println(Base.active_project())'`, "JULIA_PROJECT" => "@foo", "HOME" => homedir()))
end

# --quiet, --banner
--
2.34.1

File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion recipe/pre-unlink.sh

This file was deleted.

14 changes: 14 additions & 0 deletions recipe/scripts/activate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export JULIA_DEPOT_PATH_BACKUP=${JULIA_DEPOT_PATH:-}
export JULIA_PROJECT_BACKUP=${JULIA_PROJECT:-}
export JULIA_LOAD_PATH_BACKUP=${JULIA_LOAD_PATH:-}

# Move ~/.julia to a conda environment specific location
export JULIA_DEPOT_PATH="$CONDA_PREFIX/share/julia:$JULIA_DEPOT_PATH"

# Create a named environment for each conda environment
# Use of @ to specify a shared named environment is new as of Julia 1.7
# https://github.com/JuliaLang/julia/pull/40025
# The name of the environment is the last directory of the CONDA_PREFIX
export JULIA_PROJECT="@${CONDA_PREFIX##*/}"
# Modify load path so that projects stack on the conda-named environment
export JULIA_LOAD_PATH="@:$JULIA_PROJECT:@stdlib"
17 changes: 17 additions & 0 deletions recipe/scripts/deactivate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
export JULIA_DEPOT_PATH=$JULIA_DEPOT_PATH_BACKUP
export JULIA_PROJECT=$JULIA_PROJECT_BACKUP
export JULIA_LOAD_PATH=$JULIA_LOAD_PATH_BACKUP

unset JULIA_DEPOT_PATH_BACKUP
unset JULIA_PROJECT_BACKUP
unset JULIA_LOAD_PATH_BACKUP

if [ -z $JULIA_DEPOT_PATH ]; then
unset JULIA_DEPOT_PATH
fi
if [ -z $JULIA_PROJECT ]; then
unset JULIA_PROJECT
fi
if [ -z $JULIA_LOAD_PATH ]; then
unset JULIA_LOAD_PATH
fi

0 comments on commit bd5133e

Please sign in to comment.