Problem registering a new package

question

#1

HI all,

I recently (a few days ago) attempted to register a new package I’ve written - DependentBootstrap. However, I can’t see any sign of it in the offical METADATA, nor can I see a pull request for it on the official METADATA github page.

The package contains a REQUIRE file and LICENSE.md (MIT), and the commands I ran were:

using PkgDev
PkgDev.register("DependentBootstrap")
PkgDev.tag("DependentBootstrap", v"0.0.1")
PkgDev.publish()

The following issue is probably related: when I run Pkg.update() at the REPL, I get the following two lines when Julia attempts to update METADATA:

INFO: Updating METADATA...
WARNING: Cannot perform fast-forward merge.

Weirdly, I also get the same warning when updating the cache of DataFrames, ie:

INFO: Updating cache of DataFrames...
WARNING: Cannot perform fast-forward merge.

When I go into the METADATA directory on my local machine and run git status, I get the following:

On branch metadata-v2
Your branch is ahead of 'origin/metadata-v2' by 2 commits.
(use "git push" to publish your local commits)
nothing to commit, working directory clean

Can anyone offer any advice on how I should proceed from here?

Cheers,

Colin


#2

I would just use Git directly at this point. The biggest help for me was getting GitKraken to make it easier.

For packages, just go in to each directory which is having updating issues and update your master branch to the remote master branch. It may have “gotten stuck” by you updating something, or sometimes the way dependencies are done can cause this. No biggie.

For METADATA, these days I just do it by hand because PkgDev.publish() never seems to work. I do the following:

  • Go to the METADATA folder
  • Make sure you’re on the most current origin/metadata-v2
  • Setup a remote to your METADATA fork (I just use my name since that’s the name/branch) using remote add NAME URL
  • Make a branch
  • Go to the package directory
  • Pkg.register and Pkg.tag
  • Push the tags using either GitKraken’s GUI or git push --tags
  • Go to METADATA, check that you have the registration and tag commits. Check the folders to make sure everything exists (there should now be a folder with your package name and the version)
  • Push this branch to your fork: git push Name/branch or once again, just use GitKraken
  • Setup a PR by either dragging the branch over the remote metadata-v2 branch in GitKraken or if you go to Github there’ll be a button to setup the PR
  • Give a brief description of everything
  • Come back in about 10 minutes to check METADATA’s Travis output. It should end up green. If not, you did something wrong. The error messages are very helpful. Normal errors for me are forgetting to push the tags or when I first registered the repo having left off the .jl.

Since you’ve already done part of this (by using Pkg.publish), you won’t have to do all of it, but these are pretty much the steps so you can see where it went wrong.


How to properly add releases with PkgDev?
#3

I’ve run into the same problem. While it is useful to know that one can just do it directly as @ChrisRackauckas escribed, I’d also really like to know how to fix the

WARNING: Cannot perform fast-forward merge

message. E.g. I tried git reset --hard which worked, but then next day I was back to the same error (and I have no idea what I did to cause it)


#4

Just to follow up on this: I got the same error message again without touching Julia since I last updated. It now looks like overtime I run Pkg.update() I get this, and I have to go to the command line to do git reset --hard; git pull and only then can I run Pkg.update().


#5

Thanks for the detailed response! I’ll bookmark this as my go-to for the next time I need to do this. In the meantime, I’ll try and use this to fix my current issues tomorrow and report back here for anyone else having the same issue.

Cheers,

Colin


#6

Hi Chris, is there any chance you could explain this step slightly further? In particular, what URL is this command expecting to see? Other than that, I can follow everything in these instructions, so thanks again. Big +1 for GitKraken, I’ve been playing around with it for the last hour and it is wonderful.

Cheers and thanks,

Colin


#7

Sure thing. For me, my fork is this repository, so in GitKraken I would add a remote (hit the + next to the remotes) and add the Github repository ChrisRackauckas/METADATA.jl. It might take a little bit to show up if you just made the fork, but it’ll show up in the list of forks to add as remotes. Or I could do this in the terminal by

git remote add ChrisRackauckas https://github.com/ChrisRackauckas/METADATA.jl

Then when I push I make sure I push the branch to ChrisRackauckas/BranchName. In GitKraken, it’ll ask the first time you want to push the branch, so you just make sure to change to the right remote (it’s remote/branch).

Then in GitKraken after pushing your branch will show up under that remote. Take the remote branch and drop it on the metadata-v2 branch from origin and it will start the PR. Write in the PR comment and you’re good to go.


#8

Ah! I think I get it now! You make a remote fork under your name, make some local changes to METADATA, push your local changes to your own remote fork, and then PR to merge your remote fork back to the official METADATA. Is that right?

Thanks so much again for taking the time to type all this out.

Cheers,

Colin


#9

Yes, that is correct. This is what Pkg.publish() tries to do. Hope it helps.


#10

Very helpful. Thank you.