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

Support commit hashes in Package Set #200

Closed
shmish111 opened this issue May 14, 2019 · 7 comments · Fixed by #188
Closed

Support commit hashes in Package Set #200

shmish111 opened this issue May 14, 2019 · 7 comments · Fixed by #188
Assignees
Milestone

Comments

@shmish111
Copy link

      ace =
          mkPackage
          [ "effect"
          , "web-html"
          , "web-uievents"
          , "arrays"
          , "foreign"
          , "nullable"
          , "prelude"
          ]
          "https://github.com/slamdata/purescript-ace.git"
          "1fcf4f85f8f6c0bb83f4ef9b6de2adad9af82ad3"

gives me

error: no such remote ref 1fcf4f85f8f6c0bb83f4ef9b6de2adad9af82ad3

If I use "master" then it works, however I am using this all within a nix project and pp2n creates derivations that cannot use branch names. Not sure what I'm supposed to do 👎

@f-f
Copy link
Member

f-f commented May 14, 2019

Hi @shmish111!

Yeah a current limitation is that you cannot reference to commits in the package set, but only branches or tags.

This is documented in the section about adding dependencies:

Note: currently only "branches" and "tags" work as a version, and tags are recommended over branches (as for example if you push new commits to a branch, spago won't pick them up unless you delete the .spago folder).
Commit hashes are not supported yet, but hopefully will be at some point.

It mentions that commit hashes support is happening at some point, and in fact it's coming with #188.

In the meanwhile you can fork the upstream and make a branch pointing at the commit you want.

E.g. assuming you pulled your fork locally:

$ git checkout 1fcf4f85f8f6c0bb83f4ef9b6de2adad9af82ad3
$ git checkout -b my-temp-branch1
$ git push --set-upstream origin my-temp-branch1

And then in the packages.dhall:

      ace =
          mkPackage
          [ "effect"
          , "web-html"
          , "web-uievents"
          , "arrays"
          , "foreign"
          , "nullable"
          , "prelude"
          ]
          "https://github.com/shmish111/purescript-ace.git"
          "my-temp-branch1"

@f-f
Copy link
Member

f-f commented May 14, 2019

Update: sorry I missed the fact that you cannot point at branches. If you fork the upstream then you can also make tags. Does psc-package2nix support tags?

If this doesn't work I don't have any more workarounds to suggest, so I'd say you could raise this issue upstream to pp2n

@f-f f-f added the question label May 14, 2019
@f-f
Copy link
Member

f-f commented May 14, 2019

@shmish111 update: looking at the source for pp2n it looks like it should be able to work with branch names? E.g. see

https://github.com/justinwoo/psc-package2nix/blob/6e8f6dc6dea896c71b30cc88a2d95d6d1e48a6f0/pp2n.hs#L206-L208

Are you using the latest of pp2n?

@shmish111
Copy link
Author

thanks @f-f
it's actually nix that can't deal with branch names :(

I haven't tried tags yet as I've finished work for the day, it's my last hope, otherwise I don't know what I can do.

@shmish111
Copy link
Author

phew, tags work. So it's not the end of the world but currently if you want to use spago and nix you have to tag everything. This initially makes sense as releases are tagged and that's how bower works normally however one of the main reasons you would want to add something to packages.dhall is if you want to use something that hasn't been released. In this case you really want to point to a sha I think.

Looking forward to #188 and thanks for your help. I think I should leave this open as it won't be resolved until #188 is merged.

@f-f
Copy link
Member

f-f commented May 15, 2019

You're welcome! 🙂

And yes, I'll pivot this issue towards tracking support for commit hashes, I'll rename accordingly and leave open

@f-f f-f changed the title unable to fetch remote ref Support commit hashes in Package Set May 15, 2019
@f-f f-f added this to the 0.9 milestone May 15, 2019
@f-f f-f self-assigned this May 15, 2019
@f-f f-f closed this as completed in #188 May 28, 2019
@f-f
Copy link
Member

f-f commented May 29, 2019

@shmish111 update: I just cut a new release that includes support for commit hashes, could you try it out?

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

Successfully merging a pull request may close this issue.

2 participants