-
Notifications
You must be signed in to change notification settings - Fork 57
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
Introduce CONDA_JL_CONDA_EXE environment variable #216
Changes from 10 commits
3d42c9f
53ed58c
6c244f2
1399e71
bbb2653
2162971
0756e35
c95e1ab
8eb7c9a
1cadc27
2c723b7
84c662c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,14 +70,12 @@ function python_dir(env::Environment) | |
end | ||
const PYTHONDIR = python_dir(ROOTENV) | ||
|
||
# note: the same conda program is used for all environments | ||
const conda = if Sys.iswindows() | ||
p = script_dir(ROOTENV) | ||
conda_bat = joinpath(p, "conda.bat") | ||
isfile(conda_bat) ? conda_bat : joinpath(p, "conda.exe") | ||
else | ||
joinpath(bin_dir(ROOTENV), "conda") | ||
if ! @isdefined(CONDA_EXE) | ||
# We have an oudated deps.jl file that does not define CONDA_EXE | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is impossible. If there's an outdated deps.jl that means there was a update of Conda.jl which means the package has to be built first. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's possible in a few situations such as using multiple Julia installations with the same For example, I did this to myself in the course of testing the package by using While we could just throw and error if we detect this condition, encouraging the user to rebuild, just doing the former calculation seems friendlier since we can just follow the old behavior here. We see this issue with an outdated deps.jl file quite commonly with GR.jl and users will appear in support channels complaining that plotting is broken. The issues were reduced once we just started fixing the issues automatically. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can remove it now, but my recommendation is to keep it for the moment and then remove it at a later time to smooth over the migration process. |
||
error("CONDA_EXE not defined in $deps_file.\nPlease rebuild Conda.jl via `using Pkg; pkg\"build Conda\";`") | ||
end | ||
# note: the same conda program is used for all environments | ||
const conda = CONDA_EXE | ||
|
||
"Path to the condarc file" | ||
function conda_rc(env::Environment) | ||
|
@@ -191,6 +189,7 @@ _quiet() = get(ENV, "CI", "false") == "true" ? `-q` : `` | |
"Install miniconda if it hasn't been installed yet; _install_conda(true) installs Conda even if it has already been installed." | ||
function _install_conda(env::Environment, force::Bool=false) | ||
if force || !isfile(Conda.conda) | ||
@assert startswith(abspath(Conda.conda), abspath(PREFIX)) "CONDA_EXE, $(conda), does not exist within $PREFIX" | ||
@info("Downloading miniconda installer ...") | ||
if Sys.isunix() | ||
installer = joinpath(PREFIX, "installer.sh") | ||
|
@@ -211,7 +210,7 @@ function _install_conda(env::Environment, force::Bool=false) | |
end | ||
end | ||
if !isdir(prefix(env)) | ||
runconda(`create $(_quiet()) -y -p $(prefix(env))`) | ||
create(env) | ||
end | ||
end | ||
|
||
|
@@ -228,6 +227,10 @@ function rm(pkg::PkgOrPkgs, env::Environment=ROOTENV) | |
runconda(`remove $(_quiet()) -y $pkg`, env) | ||
end | ||
|
||
function create(env::Environment) | ||
runconda(`create $(_quiet()) -y -p $(prefix(env))`) | ||
end | ||
|
||
"Update all installed packages." | ||
function update(env::Environment=ROOTENV) | ||
if env == ROOTENV | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sys.isexecutable(CONDA_EXE)
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I made this change in 84c662c