-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Should the CurrentEnv path be set at julia startup and not follow with the pwd? #27411
Comments
The consensus on Slack seems to be that using the initial |
I think using If there is a way to change the env from within a julia session, would that be allowed at any point? Even if one has loaded a package already? |
You can use |
I think it would be nice if the |
Adding command line options to control this conveniently is definitely in the plans. Some discussion is needed about what they should be called and how they should work, of course. |
I would vote for |
See also JuliaLang/Pkg.jl#360: I'm not familiar with |
Triage didn't reach a decision here, punting for next week (when more people are on the call). |
This makes LOAD_PATH just a vector of strings again. Some special syntaxes in JULIA_LOAD_PATH are handled specially: - split on `:` or `;` (on Windows) - replace the first empty entry with DEFAULT_LOAD_PATH - ignore the remaining empty entries - replace `@` with `current_env()` Other special syntaxes are left alone and expanded during load path lookup: - occurrences of `#` in `@...` entries to version digits - `@name` is looked up in the depot path - `@` is replaced with `current_env()` The last functionality is not accessible via JULIA_LOAD_PATH in this version since `@` in that is expanded early. This does allow putting a literal `@` in LOAD_PATH to get late expansion to `current_env()` instead of early expansion. Fixes #27411
This makes LOAD_PATH just a vector of strings again. Some special syntaxes in JULIA_LOAD_PATH are handled specially: - split on `:` or `;` (on Windows) - replace the first empty entry with DEFAULT_LOAD_PATH - ignore the remaining empty entries - replace `@` with `current_env()` Other special syntaxes are left alone and expanded during load path lookup: - occurrences of `#` in `@...` entries to version digits - `@name` is looked up in the depot path - `@` is replaced with `current_env()` The last functionality is not accessible via JULIA_LOAD_PATH in this version since `@` in that is expanded early. This does allow putting a literal `@` in LOAD_PATH to get late expansion to `current_env()` instead of early expansion. Fixes #27411
#27633 changes this to be resolved early: export JULIA_LOAD_PATH="@:$JULIA_LOAD_PATH" This works whether |
I don't think this is resolved yet since some new things got merged. |
It got deresolved. The current situation is that |
Does this still block 0.7? |
It does but it's fixed. |
StefanKarpinski wrote:
Is that still the case? |
No, the current situation is that by default
The initial active project can be set by the |
Opening this issue after some discussion on slack.
Currently, the
CurrentEnv
inLOAD_PATH
(the one that says what project file you should use based on your path) looks at thepwd
of the julia session. This means that if youcd
somewhere and there happens to be a project file there, you will load packages for that project. Or if youcd
somewhere where there is no project, you will start loading from theNamedEnv
.It could be argued that tying code loading to
pwd
is a bit brittle and that the path should be set at julia startup and require some explicit invokation to update to the currentpwd
would make it less likely to be consfused about what environment you are currently in.cc @mortenpi, @quinnj, @davidanthoff, @StefanKarpinski
The text was updated successfully, but these errors were encountered: