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
Google clasp #43376
Google clasp #43376
Conversation
Rebased. Not sure whom to ping. @svanderburg would you be so kind to take a look or perhaps suggest another reviewer? |
Any updates on this pull request, please? |
Resurrected, but do not merge yet. Need to resolve a TypeError first:
|
a2d7e1b
to
9485df1
Compare
Useful for developing Google's Apps Scripts. Signed-off-by: Michal Minář <mic.liamg@gmail.com>
Fixed by a patch. @turboMaCk, @domenkozar PTAL (adding people having some experience with node packages, feel free to tag others) |
Signed-off-by: Michal Minář <mic.liamg@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a commiter btw so just a review.
- builds and runs on NixOS
- builds and runs on MacOS
I've found 2 minor things in the diff I'm unsure about but that's for someone more experienced to decide. I don't think either is a blocker for merge.
I would recommend squishing commits before merge.
})."@google/clasp-${version}".override rec { | ||
preRebuild = '' | ||
patch -p1 <<<"${builtins.readFile ./dotf.patch}" | ||
''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure but there might be hook patches
to which you can just simply list files. But I don't think I ever used it in case of node2nix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @turboMaCk. The unpacking of node packages takes place in the installPhase
:
checking outputs of '/nix/store/bd9fs5z96ypszcn0zqmh9lp2l29m51sp-node-_at_google_slash_clasp-2.2.1.drv'...
unpacking sources
patching sources
configuring
no configure script, doing nothing
building
installing
unpacking source archive /nix/store/xzbw3n2j4zq5nh1j4dkx0aqn1mr629lp-clasp-2.2.1.tgz
unpacking source archive /nix/store/ibwdid42ly8x7xidcvp0jr7jnnm281lf-fs.scandir-2.1.1.tgz
unpacking source archive /nix/store/zfpb0hszl9827qmhbkhy3sksrlyfnja0-fs.stat-2.0.1.tgz
unpacking source archive /nix/store/33qz58lq0f86hcbdi13jp04ndwp4c824-fs.walk-1.2.2.tgz
...
The patchPhase
does not have the sources available yet.
The nodePackages seem to patch the sources during in the preBuild
phase:
- https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/node-packages/default-v10.nix#L47
- https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/node-packages/default-v10.nix#L71
So this can be inconsistent either with a regular nix package build or node-package build. An alternative approach to this would be:
- list the package in node-packages-v10.json
- add another override like (pnpm = nodePackages.pnpm.override) in the default-v10.nix
I don't have a strong opinion on this one.
@adisbladis toughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was playing with this and I think the solution you come up with is fine and most straight forward at the moment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fine for now. However I'd like to refresh my knowledge about the node2nix codebase first to check if there's a proper workaround (otherwise I'd file an issue there later).
exec node2nix --nodejs-10 \ | ||
-i node-packages.json -o node-packages.nix \ | ||
-c google-clasp.nix \ | ||
--no-copy-node-env -e ../../../development/node-packages/node-env.nix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure if it's preferable to share node-env file this way or not. Can anyone more experienced clarify this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two other occurrences:
exec node2nix -8 -i pkg.json -c nixui.nix -e ../../../development/node-packages/node-env.nix --no-copy-node-env -e ../../../development/node-packages/node-env.nix -c node.nix
From my point of view, the less redundancy, the better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for references. My thinking was that this creates non obvious coupling between what appears as unrelated modules. Anyway this is not really up to me to decide so unless someone more experienced comes in and gives definite answer I would keep it as is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC we use a single node2nix in nixpkgs (hence the same node-env.nix) for everything, so this should be fine IMHO.
In the end we already have a lot of large diffs because of that, so I'd prefer to use the node-env.nix we already have unless we encounter issues that can be resolved by committing another one : )
@GrahamcOfBorg build google-clasp |
@Ma27 could you please take a look? |
After skimming through the diff, this appears to be fine. Before merging, I'd love to test this first. I'll probably be able to do this tonight, as soon as I have a better uplink to download all needed dependencies :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Unless there are further objections, I'd merge tomorrow :)
Thanks @Ma27 and @turboMaCk! |
Motivation for this change
Upstream's github page says it all:
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)