- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Closed
Labels
REPLJulia's REPL (Read Eval Print Loop)Julia's REPL (Read Eval Print Loop)
Description
Found when trying to run tests on master but this happens all the way back to at least 1.5.
Discovered because of new tests.
Test Failed at /Users/christian/.julia/juliaup/julia-nightly/share/julia/stdlib/v1.12/REPL/test/repl.jl:1971
Expression: prompt == "(@v$(VERSION.major).$(VERSION.minor)) pkg> "
Evaluated: "(v1.12) pkg> " == "(@v1.12) pkg> "
Seems like projname(project_file::String)
only checks abspath
instead of safe_realpath
when comparing envdir
and project_file
julia/stdlib/REPL/src/Pkg_beforeload.jl
Lines 89 to 94 in fc9f147
for depot in Base.DEPOT_PATH | |
envdir = joinpath(depot, "environments") | |
if startswith(abspath(project_file), abspath(envdir)) | |
return "@" * name | |
end | |
end |
Repl walkthrough of my investigation:
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.12.0-DEV.1238 (2024-09-23)
_/ |\__'_|_|_|\__'_| | Commit 0fade450a18 (0 days old master)
|__/ |
julia> withenv("JULIA_DEPOT_PATH" => mktempdir(), "JULIA_LOAD_PATH" => nothing) do
run(`$(Base.julia_cmd()[1]) --startup-file=no`)
end
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.12.0-DEV.1238 (2024-09-23)
_/ |\__'_|_|_|\__'_| | Commit 0fade450a18 (0 days old master)
|__/ |
julia> using REPL; REPL.Pkg_promptf()
[ Info: Precompiling REPL [3fa0cd96-eef1-5676-8a61-b3b8758bbffb]
"(v1.12) pkg> "
julia> depot = Base.DEPOT_PATH |> first
"/var/folders/4g/lnkpkf3s4rxd_wbl8vwnqs4r0000gn/T/jl_KEaptd"
julia> envdir = joinpath(depot, "environments")
"/var/folders/4g/lnkpkf3s4rxd_wbl8vwnqs4r0000gn/T/jl_KEaptd/environments"
julia> project_file = REPL.find_project_file()
"/private/var/folders/4g/lnkpkf3s4rxd_wbl8vwnqs4r0000gn/T/jl_KEaptd/environments/v1.12/Project.toml"
julia> startswith(abspath(project_file), abspath(envdir)) # Line 91 in Pkg_beforeload.jl
false
Metadata
Metadata
Assignees
Labels
REPLJulia's REPL (Read Eval Print Loop)Julia's REPL (Read Eval Print Loop)
Activity
Fix JuliaLang#55850
safe_realpath
instead ofabspath
inprojname
#55851[-]Wrong default REPL prompt when root of `Base.active_project()` is a symlink to another root directory[/-][+]Wrong default REPL prompt when `JULIA_DEPOT_PATH` is a symlink[/+]Backports release 1.11 (#55936)
Fix JuliaLang#55850
[REPL] Fix #55850 by using `safe_realpath` instead of `abspath` in `p…
[REPL] Fix #55850 by using `safe_realpath` instead of `abspath` in `p…
Backports for 1.11.1 (#56025)
Updating dev (#67)