Weird (and wrong) paths shown for source files in Julia 0.7 under Windows

I just downloaded and installed the Julia 0.7.0 nightly build for Windows. Something seems to have gone wonky with the installation though, since the paths Julia REPL messages output are weird non-existent ones.

julia> @which Markdown.parse("md *md* `md`")
parse(markdown::AbstractString) in Markdown at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v0.7\Markdown\src\Markdown.jl:31

The actual path to the file is C:\Programs\Julia-0.7.0-DEV\share\julia\stdlib\v0.7\Markdown\src\Markdown.jl. The Julia installation folder C:\Programs\Julia-0.7.0-DEV\ has been replaced in the output by some non-existent path C:\cygwin\home\Administrator\... Because the reconstructed path is wrong, commands like @less and @edit don’t work:

julia> @less Markdown.parse("md *md* `md`")
C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v0.7\Markdown\src\Markdown.jl: No such file or directory

The weird part is that actual calls seem to work and use the correct path, but calls that generate an error have the wrongly constructed path in the output:

julia> Markdown.parse("asdf")
  asdf

julia> Markdown.parse(13)
ERROR: MethodError: no method matching parse(::Int64)
Closest candidates are:
  parse(::IO; flavor) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v0.7\Markdown\src\parse\parse.jl:94
  parse(::IO, ::Markdown.MD; breaking) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v0.7\Markdown\src\parse\parse.jl:90
  parse(::IO, ::Markdown.MD, ::Markdown.Config; breaking) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v0.7\Markdown\src\parse\parse.jl:82
  ...

I first assumed this to be a Cygwin issue, or at least a consequence of running Julia under Cygwin, but the same thing happens in the Windows PowerShell command line too. The path shown there is also the C:\cygwin\home\Administrator\... one, which makes me think it’s a general issue of Julia reconstructing the path wrongly - perhaps the path prefix is something that got set during a cross-compilation that created the nightly build.

Is this a known issue? Or is it something set wrong in my local environment?

I guess precompiled system image caches line numbers and files of the functions at compile time. Maybe introduced from constant propagation improvements. I had seen them too. Does this happen in version 0.6

No, 0.6 sidesteps the issue by printing only the relative path (relative to share/julia/base).

Actually, while investigating this I found that this seems to happen only for the code under stdlib/. The base methods still print out only a relative path in 0.7:

julia> @which sin(3)
sin(x::Real) in Base.Math at special/trig.jl:53

(and @less works for these) while external packages print the full correct path:

julia> @which Primes.isprime(3)
isprime(n::Integer) in Primes at C:\Users\Sundar\.julia\v0.7\Primes\src\Primes.jl:150

It’s the methods in the stdlib code that get an absolute path output and get the wrong one as in the original post.

Any progress on this/is there a github issue yet? I still have the same problem in Julia 1.0 on Windows 10.

https://github.com/JuliaLang/julia/issues/28052

1 Like

Same issue with 1.0 (no surprise):

julia> which(rank, (Matrix,))

rank(A::AbstractArray{T,2} where T) in LinearAlgebra at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.0/LinearAlgebra/src/generic.jl:742