Skip to content

--project=@script is broken or NEWS entry is incorrect (Julia 1.11.0-rc3) #55606

@StevenWhitaker

Description

@StevenWhitaker

This issue has two parts.

EDIT: Note that Issue 1 is a duplicate of #55069, but Issue 2 is not.

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 the foo 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or unintended behaviorduplicateIndicates similar issues or pull requests

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions