Skip to content
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

Julia dislikes living under a file system path including : #57092

Open
nsajko opened this issue Jan 18, 2025 · 2 comments
Open

Julia dislikes living under a file system path including : #57092

nsajko opened this issue Jan 18, 2025 · 2 comments
Labels
bug Indicates an unexpected problem or unintended behavior compiler:precompilation Precompilation of modules packages Package management and loading

Comments

@nsajko
Copy link
Contributor

nsajko commented Jan 18, 2025

When the path that Julia lives under on the file system includes :, Julia refuses to precompile many packages, even stdlibs:

$ pwd  # contains `:`
/home/nsajko/tmp/jl/jl/pr_nsajko:any_all_vectorized_tuple_bool/julia-a6a6f6b074/bin
$ ./julia -e 'using Statistics'
  ✗ Statistics
Precompiling Statistics finished.
  0 dependencies successfully precompiled in 0 seconds
ERROR: LOAD_PATH entries cannot contain ':'
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:44
  [2] create_expr_cache(pkg::Base.PkgId, input::String, output::String, output_o::String, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, flags::Cmd, cacheflags::Base.CacheFlags, internal_stderr::IO, internal_stdout::IO, loadable_exts::Nothing)
    @ Base ./loading.jl:3058
  [3] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool; flags::Cmd, cacheflags::Base.CacheFlags, reasons::Dict{String, Int64}, loadable_exts::Nothing)
    @ Base ./loading.jl:3202
  [4] (::Base.var"#__require_prelocked##0#__require_prelocked##1"{Base.PkgId})()
    @ Base ./loading.jl:2676
  [5] mkpidlock(f::Base.var"#__require_prelocked##0#__require_prelocked##1"{Base.PkgId}, at::String, pid::Int32; kwopts::@Kwargs{stale_age::Int64, wait::Bool})
    @ FileWatching.Pidfile ~/tmp/jl/jl/pr_nsajko:any_all_vectorized_tuple_bool/julia-a6a6f6b074/share/julia/stdlib/v1.12/FileWatching/src/pidfile.jl:93
  [6] #mkpidlock#7
    @ ~/tmp/jl/jl/pr_nsajko:any_all_vectorized_tuple_bool/julia-a6a6f6b074/share/julia/stdlib/v1.12/FileWatching/src/pidfile.jl:88 [inlined]
  [7] trymkpidlock(::Function, ::Vararg{Any}; kwargs::@Kwargs{stale_age::Int64})
    @ FileWatching.Pidfile ~/tmp/jl/jl/pr_nsajko:any_all_vectorized_tuple_bool/julia-a6a6f6b074/share/julia/stdlib/v1.12/FileWatching/src/pidfile.jl:114
  [8] #invokelatest#1
    @ ./essentials.jl:1058 [inlined]
  [9] invokelatest
    @ ./essentials.jl:1052 [inlined]
 [10] maybe_cachefile_lock(f::Base.var"#__require_prelocked##0#__require_prelocked##1"{Base.PkgId}, pkg::Base.PkgId, srcpath::String; stale_age::Int64)
    @ Base ./loading.jl:3853
 [11] maybe_cachefile_lock
    @ ./loading.jl:3850 [inlined]
 [12] __require_prelocked(pkg::Base.PkgId, env::String)
    @ Base ./loading.jl:2662
 [13] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:2487
 [14] macro expansion
    @ ./loading.jl:2415 [inlined]
 [15] macro expansion
    @ ./lock.jl:376 [inlined]
 [16] __require(into::Module, mod::Symbol)
    @ Base ./loading.jl:2372
 [17] #invoke_in_world#2
    @ ./essentials.jl:1091 [inlined]
 [18] invoke_in_world
    @ ./essentials.jl:1087 [inlined]
 [19] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:2364
 [20] eval(m::Module, e::Any)
    @ Core ./boot.jl:485
 [21] exec_options(opts::Base.JLOptions)
    @ Base ./client.jl:295
 [22] _start()
    @ Base ./client.jl:558

To reproduce, one might need to delete $HOME/.julia/compiled or similar, to force precompilation to be attempted again.

Not a recent regression, reproduced on all of v1.10, v1.11, v1.12.

@nsajko nsajko added bug Indicates an unexpected problem or unintended behavior compiler:precompilation Precompilation of modules packages Package management and loading labels Jan 18, 2025
@giordano
Copy link
Contributor

That's not Julia-specific, lots of tools have problems on Unix with colons in paths because of its use as separator in path lists, for example you can't have a directory containing a colon in the environment variable PATH. Quoting from the POSIX standard

Since <colon> is a separator in this context, directory names that might be used in PATH should not include a <colon> character.

Colons are historically a problem on Unix, that's what it is.

@nsajko
Copy link
Contributor Author

nsajko commented Jan 18, 2025

Hypothetically changing the LOAD_PATH syntax could lead to a fix, but that's too breaking, I guess? Maybe a less invasive fix is possible 🤷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior compiler:precompilation Precompilation of modules packages Package management and loading
Projects
None yet
Development

No branches or pull requests

2 participants