-
-
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
correct pointing in "@projectname --project" testing #43560
Conversation
- ran into this while customizing conda-forge build of julia - with @mkitti
Won't this error if the user doesn't have |
This comment has been minimized.
This comment has been minimized.
Ah, you're right. I thought it would populate it automatically. What would you recommend here, then? @DilumAluthge |
Co-authored-by: Dilum Aluthge <[email protected]>
This reverts commit 947dd83.
Co-authored-by: Dilum Aluthge <[email protected]>
|
I delete the empty lines. Should I still squash now or is it okay to squash upon (potential) merge? |
Let's wait to squash until we're happy with the implementation. |
I would recommend that you do the following:
|
@@ -139,7 +139,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(addenv(`$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(), "JULIA_DEPOT_PATH" => "$(Base.DEPOT_PATH[1])")) |
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.
Since we are doing env = copy(ENV)
and then deleting keys from env
, we should use setenv
instead of addenv
.
@test expanded == readchomp(addenv(`$exename -e 'println(Base.active_project())'`, "JULIA_PROJECT" => "@foo", "HOME" => homedir(), "JULIA_DEPOT_PATH" => "$(Base.DEPOT_PATH[1])")) | |
env = copy(ENV) | |
env["JULIA_PROJECT"] = "@foo" | |
env["HOME"] = homedir() | |
delete!(env, "JULIA_DEPOT_PATH") | |
@test expanded == readchomp(setenv(`$exename -e 'println(Base.active_project())'`, env)) |
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.
As I mentioned in a different thread:
I think that explicitly deleting the JULIA_DEPOT_PATH environment variable (by doing
delete!(env, "JULIA_DEPOT_PATH")
) is the most correct solution here, because it makes explicit what we are trying to accomplish.
Abort this pull request. Do not merge. @ngam The patch is not needed. As I mentioned in conda-forge/julia-feedstock#157 (comment), I thought this might have already been fixed upstream. It has. It already have been fixed by @DilumAluthge in #42358 . @KristofferC could we backport #42358 to 1.7 branch? |
The originating error on 1.7.1 is as follows:
This error occurs when testing 1.7.1 since that still uses In #42358 (which is merged on Julia master slated for Julia 1.8), this was changed to The problem that we are trying to address here does not exist on Julia master. |
It seems to me that PR #42358 only addresses this insofar as |
I think the issue here is that #42358 has not yet been backported to 1.6 and 1.7. |
Btw @DilumAluthge --- I did my undergrad degree at Brown, in BME. Small world. |
@DilumAluthge okay... now... I think I remember you. I believe we took APMA classes together! I graduated in 2015. Anyway, good coincidence, thanks for the great work here and on the other PRs! |
Originally, the test as written would always default to home. However, if someone sets a different
JULIA_DEPOT_PATH
, then the test would fail. This slight edit ensures it passes.xref: conda-forge/julia-feedstock#157
A simple test to confirm the problem: