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

Maintenance of psa, pscid, pulp, purescript-language-server, purs-tidy #192

Open
jamesdbrock opened this issue Mar 31, 2022 · 5 comments
Open

Comments

@jamesdbrock
Copy link
Collaborator

So what I have been doing is keeping an uncommitted package.json around the folders. For instance this in purs-tidy:

{
  "name": "purs-tidy",
  "version": "0.7.1",
  "dependencies": {
    "purs-tidy": "0.7.1"
  }
}

When I new version comes in, I bump these numbers to match the NPM release. Following this I just run node2nix with the latest node2nix version (Node v12 is deprecated, and node2nix seems to favor the latest maintenance version instead of latest LTS).

After node2nix does it's thing. I run git checkout on the default.nix to keep the modifications Justin did way back when. Then I go back and nvim default.nix and edit the version number to match the package.json and generated code.

I git add *.nix, git commit and write my merge request message, then git push github $BRANCH. The diff this creates is usually minimal which Justin tends to approve of in <48 hours because it's just a few version bumps to read on his end.

Originally posted by @toastal in #146 (comment)

@justinwoo
Copy link
Owner

we should write this as a bash script sometime

@jamesdbrock
Copy link
Collaborator Author

jamesdbrock commented Mar 31, 2022

I’ve been trying to do an import-from-derivation with node2nix for pulp and it’s very hard.

We want:

  • When a new version of a package comes out we can edit default.nix and paste in the new version number and a sha256 and then commit.
  • The new version gets the locked versions of NPM dependencies from the package-lock.json.

Problems:

  • We can get hashes for the dependencies from package-lock.json in the source repository, but there is no place to get a hash for the package itself. So there is no way to create a pure derivation for the package.
  • When we do this with @toastal ’s method then I think we don't get the locked dependency versions from package-lock.json.
  • We don't want to build from source because then all the source-building tools have to be in the derivation. So we want the pre-built code from npmjs.com.

@jamesdbrock
Copy link
Collaborator Author

(Thank you very much for the work you’ve done on this @toastal )

@toastal
Copy link
Contributor

toastal commented Apr 19, 2022

BTW, I found that I had also used process substitution at one point: node2nix --input (echo '{"name":"purescript-psa",version:"0.8.2",dependencies":{"purescript-psa": "0.8.2"}}' | psub)

@jamesdbrock
Copy link
Collaborator Author

There's a new method for maintaining these derivations, see the default.nix files in each package’s directory.

# How to generate the files in this directory:
#
# nix run nixpkgs#node2nix -- -i <(echo '["psa"]') -c composition.nix -18
#

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

No branches or pull requests

3 participants