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

Pkg.update() fails for package with local-only branch #16372

Closed
kmsquire opened this issue May 14, 2016 · 10 comments
Closed

Pkg.update() fails for package with local-only branch #16372

kmsquire opened this issue May 14, 2016 · 10 comments
Labels
packages Package management and loading

Comments

@kmsquire
Copy link
Member

Specifically, I have Graphs.jl checked out on a branch which does not exist remotely:

julia> Pkg.status("Graphs")
 - Graphs                        0.6.0+             kms/remove_extra_imports

Pkg.update() doesn't like this:

julia> Pkg.update()
INFO: Updating METADATA...
...
INFO: Computing changes...
INFO: No packages to install, update or remove
ERROR: Update finished with errors.
=> Package Graphs cannot be updated.
GitError(Code:ERROR, Class:Merge, There is no tracking information for the current branch.)
 [inlined code] from ./libgit2.jl:393
 in with(::Base.LibGit2.##113#118{Base.LibGit2.GitRepo}, ::Void) at ./libgit2/types.jl:581
 in (::Base.LibGit2.##109#114{String,String,Bool,Base.LibGit2.MergeOptions,Base.LibGit2.CheckoutOptions,Base.LibGit2.GitRepo})(::Base.LibGit2.GitReference) at ./libgit2.jl:391
 in with(::Base.LibGit2.##109#114{String,String,Bool,Base.LibGit2.MergeOptions,Base.LibGit2.CheckoutOptions,Base.LibGit2.GitRepo}, ::Base.LibGit2.GitReference) at ./libgit2/types.jl:581
 in (::Base.#kw##merge!)(::Array{Any,1}, ::Base.#merge!, ::Base.LibGit2.GitRepo) at /Users/kevin/Source/julia/usr/lib/julia/sys.dylib:-1
 in (::Base.Pkg.Entry.##31#34)(::Base.LibGit2.GitRepo) at ./pkg/entry.jl:390
 in with(::Base.Pkg.Entry.##31#34, ::Base.LibGit2.GitRepo) at ./libgit2/types.jl:581
 in update(::String) at ./pkg/entry.jl:381
 [inlined code] from ./promotion.jl:248
 in (::Base.Pkg.Dir.##2#3{Array{Any,1},Base.Pkg.Entry.#update,Tuple{String}})() at ./pkg/dir.jl:31
 in cd(::Base.Pkg.Dir.##2#3{Array{Any,1},Base.Pkg.Entry.#update,Tuple{String}}, ::String) at ./file.jl:48
 in #cd#1(::Array{Any,1}, ::Function, ::Function, ::String, ::Vararg{String,N}) at ./pkg/dir.jl:31
 [inlined code] from ./pkg/dir.jl:25
 in update() at ./pkg.jl:201
 in eval(::Module, ::Any) at ./boot.jl:226
 [inlined code] from ./REPL.jl:3
 in eval_user_input(::Any, ::Base.REPL.REPLBackend) at ./REPL.jl:62
 [inlined code] from ./REPL.jl:92
 in (::Base.REPL.##1#2{Base.REPL.REPLBackend})() at ./event.jl:46
 [inlined code] from ./operators.jl:40
 in update(::String) at ./pkg/entry.jl:420
 [inlined code] from ./promotion.jl:248
 in (::Base.Pkg.Dir.##2#3{Array{Any,1},Base.Pkg.Entry.#update,Tuple{String}})() at ./pkg/dir.jl:31
 in cd(::Base.Pkg.Dir.##2#3{Array{Any,1},Base.Pkg.Entry.#update,Tuple{String}}, ::String) at ./file.jl:48
 in #cd#1(::Array{Any,1}, ::Function, ::Function, ::String, ::Vararg{String,N}) at ./pkg/dir.jl:31
 [inlined code] from ./pkg/dir.jl:25
 in update() at ./pkg.jl:201
 in eval(::Module, ::Any) at ./boot.jl:226

This is on a fresh master:

julia> versioninfo()
Julia Version 0.5.0-dev+4088
Commit 91c0db7* (2016-05-14 00:51 UTC)
Platform Info:
  System: Darwin (x86_64-apple-darwin14.5.0)
  CPU: Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.7.1 (ORCJIT, haswell)
@kshyatt kshyatt added the packages Package management and loading label May 14, 2016
@wildart
Copy link
Member

wildart commented May 14, 2016

That is the correct behavior. You cannot merge updates, which usually come from remote master branch, into your local branch.

@tkelman
Copy link
Contributor

tkelman commented May 15, 2016

Maybe we can suppress the backtrace for this specific "There is no tracking information for the current branch" error. Lets do that only on a case by case basis as we see them happen from real usage though.

edit: might also be useful to include the branch name in the error message

@wildart
Copy link
Member

wildart commented May 15, 2016

You could see branch name by running Pkg.status. As a next step I wanted to create for update a verbose mode which would show exceptions (as it is right now) , and normal mode that would report only problems.

@tkelman
Copy link
Contributor

tkelman commented May 15, 2016

I don't think we should suppress backtraces unless we've seen something at least once and know it's harmless and expected to happen fairly often. There are bugs that happen intermittently and won't be reproducible by calling Pkg.update a second time with a verbose flag, we shouldn't suppress backtraces for those.

edit: Pkg.status is also a bit slow, what's the harm in adding the branch name to the error message if it's known?

@kmsquire
Copy link
Member Author

Thanks for getting to the core of this. The main part that isn't clear here is that everything that was supposed to succeed, did so.

@vchuravy
Copy link
Member

@wildart but isn't it the case here that there is no remote tracking branch so there is nothing to update? I agree that we shouldn't be doing anything clever here and try to update from remote master or something like that. But everybody who does local package development, without creating a remote branch for the local branch is going to run into this.

@wildart
Copy link
Member

wildart commented Aug 29, 2016

In order to update a local branch, it needs a remove tracking branch specified - no exceptions. Indeed, nothing clever should be done in this case. I believe we create tracking branch when you do Pkg.checkout. If you created branch with git, use git for updating it or switch to master.

Pkg commands are not git commands. It would be wrong to think that they perform in a similar manner.

@vchuravy
Copy link
Member

How about we change the current warning which is quite noisy and looks scary, to something more succinct like "Did not update package X, because no remote tracking branch is specified."

It confused me because it says "Updated finished with errors", but for me not updating a branch that has no remote branch is not an error, but rather expected behaviour.

@alecloudenback
Copy link
Contributor

I'm having trouble with this as I've updated a package locally that I'm developing (and previously published in METADATA). Now I'd like to publish the updated package, but I can't PkgDev.Publish() because my Pkg.update() doesn't complete. What's the appropriate action to take in this situation? I understand the logic in the error message, but I'm not sure how to get myself out of this situation.

@simonbyrne
Copy link
Contributor

This has changed considerably with the new Pkg. If still an issue, please open at https://github.com/JuliaLang/Pkg.jl

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

No branches or pull requests

7 participants