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

Cannot generate package when removing default env #759

Closed
jannefiluren opened this issue Sep 18, 2018 · 10 comments · Fixed by #2492
Closed

Cannot generate package when removing default env #759

jannefiluren opened this issue Sep 18, 2018 · 10 comments · Fixed by #2492

Comments

@jannefiluren
Copy link

If I remove the default environment from the LOAD_PATH, I cannot generate a package environment. I have tested this on Julia v0.7 and Windows.

julia> LOAD_PATH
2-element Array{String,1}:
 "@"
 "@stdlib"

pkg> generate Test
ERROR: no active project
Stacktrace:
 [1] error(::String) at .\error.jl:33
 [2] find_project_file(::Nothing) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v0.7\Pkg\src\Types.jl:243
 [3] Pkg.Types.EnvCache(::Nothing) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v0.7\Pkg\src\Types.jl:285 (repeats 2 times)
 [4] Type at .\none:0 [inlined]
 [5] Context!(::Array{Pair{Symbol,Any},1}) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v0.7\Pkg\src\Types.jl:367
 [6] Context! at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v0.7\Pkg\src\REPLMode.jl:497 [inlined]
 [7] do_generate!(::Dict{Symbol,Any}, ::Array{String,1}, ::Dict{Symbol,Any}) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v0.7\Pkg\src\REPLMode.jl:598
 [8] #invokelatest#1(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Any, ::Any, ::Vararg{Any,N} where N) at .\essentials.jl:691
 [9] invokelatest(::Any, ::Any, ::Vararg{Any,N} where N) at .\essentials.jl:690
 [10] do_cmd!(::Pkg.REPLMode.PkgCommand, ::REPL.LineEditREPL) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v0.7\Pkg\src\REPLMode.jl:542
 [11] #do_cmd#30(::Bool, ::Function, ::REPL.LineEditREPL, ::String) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v0.7\Pkg\src\REPLMode.jl:507
 [12] do_cmd at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v0.7\Pkg\src\REPLMode.jl:503 [inlined]
 [13] (::getfield(Pkg.REPLMode, Symbol("##41#44")){REPL.LineEditREPL,REPL.LineEdit.Prompt})(::REPL.LineEdit.MIState, ::Base.GenericIOBuffer{Array{UInt8,1}}, ::Bool) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v0.7\Pkg\src\REPLMode.jl:842
 [14] #invokelatest#1 at .\essentials.jl:691 [inlined]
 [15] invokelatest at .\essentials.jl:690 [inlined]
 [16] run_interface(::REPL.Terminals.TextTerminal, ::REPL.LineEdit.ModalInterface, ::REPL.LineEdit.MIState) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v0.7\REPL\src\LineEdit.jl:2261
 [17] run_frontend(::REPL.LineEditREPL, ::REPL.REPLBackendRef) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v0.7\REPL\src\REPL.jl:1029
 [18] run_repl(::REPL.AbstractREPL, ::Any) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v0.7\REPL\src\REPL.jl:191
 [19] (::getfield(Base, Symbol("##831#833")){Bool,Bool,Bool,Bool})(::Module) at .\logging.jl:311
 [20] #invokelatest#1 at .\essentials.jl:691 [inlined]
 [21] invokelatest at .\essentials.jl:690 [inlined]
 [22] macro expansion at .\logging.jl:308 [inlined]
 [23] run_main_repl(::Bool, ::Bool, ::Bool, ::Bool, ::Bool) at .\client.jl:340
 [24] exec_options(::Base.JLOptions) at .\client.jl:252
 [25] _start() at .\client.jl:432
@StefanKarpinski
Copy link
Sponsor Member

This is working as intended. You don't have any project that anything can be generated or added to.

@KristofferC
Copy link
Sponsor Member

generate creates a new Project so not sure why you need one active?

@StefanKarpinski
Copy link
Sponsor Member

Which directory is it supposed to generate into? Presumably the active one, but there is no active one.

@KristofferC
Copy link
Sponsor Member

It generates to the directory you specify (just like mkdir).

@StefanKarpinski
Copy link
Sponsor Member

Oh sure, that makes sense. add should fail though, right?

@StefanKarpinski
Copy link
Sponsor Member

Is it normal to generate a project that isn't in the load path anywhere?

@KristofferC
Copy link
Sponsor Member

add fails indeed since that is trying to modify an existing environment.

Is it normal to generate a project that isn't in the load path anywhere?

You would often cd to the newly created project and activate it.

@StefanKarpinski
Copy link
Sponsor Member

So if this worked, it would generate a new project which would then not be in the load path unless you took further actions, e.g. to activate it or push it onto the load path otherwise.

@KristofferC
Copy link
Sponsor Member

That is already what is happening right now.

@KristofferC
Copy link
Sponsor Member

Anyway, the whole generate things should be deferred to PkgDev whenever that PR there is finished.

pazner added a commit to pazner/Pkg.jl that referenced this issue Apr 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants