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

instantiate command error in Windows Subsystem for Linux (WSL) ( on windows 10 ) #1785

Open
zhangliye opened this issue Apr 20, 2020 · 7 comments
Labels

Comments

@zhangliye
Copy link

When I run instantiate on WSL (windows 10), I got the following error. It looks like some error related to the path. The error information is as follows.

(Hotspot) pkg> instantiate
ERROR: MethodError: no method matching joinpath(::Nothing)
Closest candidates are:
joinpath(::String, ::String) at path.jl:265
joinpath(::AbstractString) at path.jl:247
joinpath(::AbstractString, ::AbstractString) at path.jl:274
...
Stacktrace:
[1] stat(::Nothing) at ./stat.jl:109
[2] isdir(::Nothing) at ./stat.jl:311
[3] is_instantiated(::Pkg.Types.Context) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Pkg/src/Operations.jl:83
[4] #instantiate#114(::Nothing, ::Bool, ::Bool, ::Pkg.BinaryPlatforms.Linux, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::typeof(Pkg.API.instantiate), ::Pkg.Types.Context) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Pkg/src/API.jl:738
[5] instantiate(::Pkg.Types.Context) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Pkg/src/API.jl:720
[6] do_instantiate!(::Dict{Symbol,Any}, ::Array{String,1}, ::Dict{Symbol,Any}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Pkg/src/REPLMode.jl:477
[7] #invokelatest#1(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::typeof(Base.invokelatest), ::Any, ::Any, ::Vararg{Any,N} where N) at ./essentials.jl:709
[8] invokelatest(::Any, ::Any, ::Vararg{Any,N} where N) at ./essentials.jl:708
[9] do_cmd!(::Pkg.REPLMode.Command, ::REPL.LineEditREPL) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Pkg/src/REPLMode.jl:412
[10] #do_cmd#23(::Bool, ::typeof(Pkg.REPLMode.do_cmd), ::REPL.LineEditREPL, ::String) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Pkg/src/REPLMode.jl:391
[11] do_cmd at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Pkg/src/REPLMode.jl:387 [inlined]
[12] (::Pkg.REPLMode.var"#28#31"{REPL.LineEditREPL,REPL.LineEdit.Prompt})(::REPL.LineEdit.MIState, ::Base.GenericIOBuffer{Array{UInt8,1}}, ::Bool) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/Pkg/src/REPLMode.jl:619
[13] #invokelatest#1 at ./essentials.jl:709 [inlined]
[14] invokelatest at ./essentials.jl:708 [inlined]
[15] run_interface(::REPL.Terminals.TextTerminal, ::REPL.LineEdit.ModalInterface, ::REPL.LineEdit.MIState) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/REPL/src/LineEdit.jl:2306
[16] run_frontend(::REPL.LineEditREPL, ::REPL.REPLBackendRef) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/REPL/src/REPL.jl:1045
[17] run_repl(::REPL.AbstractREPL, ::Any) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.3/REPL/src/REPL.jl:201
[18] (::Base.var"#770#772"{Bool,Bool,Bool,Bool})(::Module) at ./client.jl:382
[19] #invokelatest#1 at ./essentials.jl:709 [inlined]
[20] invokelatest at ./essentials.jl:708 [inlined]
[21] run_main_repl(::Bool, ::Bool, ::Bool, ::Bool, ::Bool) at ./client.jl:366
[22] exec_options(::Base.JLOptions) at ./client.jl:304
[23] _start() at ./client.jl:460

The Julia version information,
Julia Version 1.3.1
Commit 2d5741174c (2019-12-30 21:36 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
CPU: Intel(R) Core(TM) i7-7600U CPU @ 2.80GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-6.0.1 (ORCJIT, skylake)

@zhangliye zhangliye changed the title instantiate command error in Windows Subsystem for Linux (WSL) on windows instantiate command error in Windows Subsystem for Linux (WSL) ( on windows 10 ) Apr 20, 2020
@fredrikekre
Copy link
Member

fredrikekre commented Apr 20, 2020

This codepath is rewritten, can you try with Julia 1.4.1?

Edit: Nevermind.

@fredrikekre
Copy link
Member

Maybe you have a weird Manifest? I wonder why

Pkg.jl/src/Operations.jl

Lines 38 to 44 in 2f953bb

function source_path(ctx, pkg::PackageSpec)
return is_stdlib(pkg.uuid) ? Types.stdlib_path(pkg.name) :
pkg.path !== nothing ? joinpath(dirname(ctx.env.project_file), pkg.path) :
pkg.repo.source !== nothing ? find_installed(pkg.name, pkg.uuid, pkg.tree_hash) :
pkg.tree_hash !== nothing ? find_installed(pkg.name, pkg.uuid, pkg.tree_hash) :
nothing
end
returns nothing...

@KristofferC
Copy link
Member

KristofferC commented Apr 20, 2020

Maybe it is an stdlib but the is_stdlib fails..?

@zhangliye
Copy link
Author

The package Hotspot depends on MariUtil and MariRisk, which are two private packages in a local directory and are not registered.

I am not sure if it is caused by the relative path of the local private package.
The directories of these two private packages in Manifest.toml of Julia language are as following.
~/.julia/environments/v1.4/Manifest.toml

[[MariRisk]]
deps = ["ArchGDAL", "JSON", "MariUtil", "Test"]
path = "/Users/zhangliye/julia_dev/mt/maririsk"
uuid = "ac6df864-b67b-11e9-31d0-393f57996eae"
version = "0.1.0"

[[MariUtil]]
deps = ["Test"]
path = "../../../julia_dev/mt/mariutil"
uuid = "688ada90-b669-11e9-294c-230928970753"
version = "0.1.0"

@zhangliye
Copy link
Author

I also find very strange behavior when when I run command dev.
package local MariRisk depends on local package MariUtil. I make these package visible according to the following steps.


Step1:  (@v1.4) pkg> dev --local /Users/zhangliye/julia_dev/mt/mariutil
In Julia Manifest.toml,  the MariUtil
[[MariUtil]]
deps = ["Test"]
path = " /Users/zhangliye/julia_dev/mt/mariutil"
uuid = "688ada90-b669-11e9-294c-230928970753"
version = "0.1.0"

Step2: (@v1.4) pkg> dev --local /Users/zhangliye/julia_dev/mt/maririsk

The path of package `MariUtil` is changed to relative path as following.
[[MariRisk]]
deps = ["ArchGDAL", "JSON", "MariUtil", "Test"]
path = "/Users/zhangliye/julia_dev/mt/maririsk"
uuid = "ac6df864-b67b-11e9-31d0-393f57996eae"
version = "0.1.0"

[[MariUtil]]
deps = ["Test"]
path = "../../../julia_dev/mt/mariutil"
uuid = "688ada90-b669-11e9-294c-230928970753"
version = "0.1.0"

@zhangliye
Copy link
Author

The problem is solved by removing all user-defined local packages. Then, run dev command for all local package and run add to add dependent packages. Then, it works again.
I think it is caused by the relative path of the local packages.

@zsoerenm
Copy link

zsoerenm commented Sep 2, 2022

I have got the same error in v1.6:
https://github.com/JuliaGNSS/GNSSReceiver.jl/runs/8154848031?check_suite_focus=true#step:18:52
The error does not appear in v1.8 though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants