julia
julia copied to clipboard
`--project=@script` is broken or NEWS entry is incorrect (Julia 1.11.0-rc3)
This issue has two parts.
Issue 1
The following NEWS entry is incorrect:
If no path is given after (i.e.
--project=@script
) then (like--project=@.
) the directory and its parents are searched for a Project.toml
In particular, it appears --project=@script
has the same behavior as --project=@.
, which doesn't seem intended (though maybe I'm reading the NEWS entry incorrectly).
MWE
In <current_directory>/script_test/test.jl
:
println("Current directory: ", pwd())
println("Active project: ", Base.active_project())
Result:
$ julia +1.11 --project=@script script_test/test.jl
Current directory: <current_directory>
Active project: <current_directory>/Project.toml # Expected: <current_directory>/script_test/Project.toml
See #55069 for more details.
Issue 2
The previous part of the same NEWS entry is also incorrect:
The
--project
argument now accepts@script
to give a path to a directory with a Project.toml relative to the passed script file.--project=@script/foo
for thefoo
subdirectory.
In particular, --project=@script/script_test
activates /script_test/Project.toml
. (Note this is an absolute path, not a relative path!)
MWE
Same test.jl
file as above.
Result:
$ julia +1.11 --project=@script/foo script_test/test.jl
Current directory: <current_directory>
Active project: /script_test/Project.toml # Expected: <current_directory>/script_test/foo/Project.toml