-
Notifications
You must be signed in to change notification settings - Fork 0
Pkg integration #29
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 integration #29
Conversation
Completed most of the checklist, The last thing to do is check of the GH releases works properly with the changes. |
release.nix
Outdated
@@ -59,13 +65,16 @@ let | |||
PKG_IGNORE_TAG = 1; | |||
buildPhase = '' | |||
cp ${./package.json} package.json | |||
mkdir -p output/prebuilds |
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.
Does this need output/prebuilds
? Why not just ./prebuilds
? The ./
is the working directory of the build. As long as this directory doesn't conflict with anything in the ./
which I believe is the produced source files from the upstream derivations.
Remember this is an overridden derivation, the $src
has already unpacked into the current directory.
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.
When I use ./
instead of a temp directory, the result included all of the src files.
I also feel that creating and using a temp directory makes the process more explicit.
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.
Is that because of:
--public-packages "*" \
Is the *
picking up everything?
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.
If you must use a a special directory for this. I'd say use pkg
as the special directory for vercel/pkg
related building. Not output
which is confusing with $out
.
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.
Ok, I can change it to pkg.
as for --public-packages "*" \
is just flagging everything is a public package since non public packages are included as bytecode by default.. This breaks with the --no-bytecode
flag.
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.
Using pkg 5.3.1 doesn't fix the issue for leveldown prebuilds, neither does adding them as assets.
this seems to be an issue with pkg itself, I've posted an issue at vercel/pkg#1264.
release.nix
Outdated
''; | ||
dontFixup = true; | ||
}; | ||
buildExe = arch: | ||
stdenv.mkDerivation rec { | ||
name = "${utils.basename}-${version}-win32-${arch}.exe"; | ||
name = "${utils.basename}-${version}-win32-${arch}"; |
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.
Why change this? The name of the windows executable has an extension of .exe
.
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.
The output is a directory now that includes the .exe
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.
You should leave it as the actual executable. Is there other files necessary for the actual $out
?
This is not a nix package, so the executable as $out
is totally fine.
Plus this actually is integrated into the Gitlab CI/CD which expects a single file as $out
. Changing it to a directory adds extra work to do there.
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.
We need to have the output as a directory since we need to include the prebuilds for leveldown.
we can have it as a zip file if needed.
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.
Can this be resolved now back to the way it was?
Is there a way for you test the CI/CD execution of your changes. You just need to go into the gitlab yaml file and enable this for your branch as well. Then go to https://gitlab.com/MatrixAI/open-source/typescript-demo-lib/-/pipelines to manually trigger it. Or https://gitlab.com/MatrixAI/open-source/typescript-demo-lib/-/jobs. |
Oh if you do this, make sure to switch it back later, we only want builds to occur on master, not on every branch. |
We need `--no-bytecode` because without this flag it doesn't work inside
Nix and it isn't deterministic. So up to your decision. As I said if you
really need a directory, try `pkg` as the directory name to avoid confusion.
…On 7/22/21 2:28 PM, Brian Botha wrote:
***@***.**** commented on this pull request.
------------------------------------------------------------------------
In release.nix
<#29 (comment)>:
> @@ -59,13 +65,16 @@ let
PKG_IGNORE_TAG = 1;
buildPhase = ''
cp ${./package.json} package.json
+ mkdir -p output/prebuilds
Ok, I can change it to pkg.
as for |--public-packages "*" \| is just flagging everything is a
public package since non public packages are included as bytecode by
default.. This breaks with the |--no-bytecode| flag.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#29 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAE4OHJ6LPSIJSE7VDU7XRLTY6M7PANCNFSM5AXJKZ6Q>.
|
You mean nixpkgs commit from master? Does this all work with just the
revision provided by nixpkgs?
NixOS/nixpkgs@3d64b60
The above is the just the one that brought in `pkg`.
…On 7/22/21 4:28 PM, Brian Botha wrote:
***@***.**** commented on this pull request.
------------------------------------------------------------------------
In pkgs.nix
<#29 (comment)>:
> @@ -1,5 +1,6 @@
import (
# let rev = "60cce7e5e1fdf62421ef6d4184ee399b46209366"; in
- let rev = "04a48a2fcd2370f4e8a8c9fd3394531ccdb30f1e"; in
+ # let rev = "04a48a2fcd2370f4e8a8c9fd3394531ccdb30f1e"; in
+ let rev = "53caacaf56640d04180775aee016d2f16d6f083c"; in
I picked the latest pkgs commit when I started on this issue.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#29 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAE4OHITJMVXE5N4SW42KT3TY63A5ANCNFSM5AXJKZ6Q>.
|
I have created an upstram PR addressing the issue with the leveldown warnings. |
When this is done, the changes for js-polykey are not far behind. the only complication would be the jose/jwt throwing warnings. But I've added them as an asset and it seems to be working with manual testing e.g. starting agent + starting a session. |
I'm checking out your change to Firstly: git fetch origin pull/1273/head:pr-1273
git checkout pr-1273
# setup nix-shell here
npm install
npm run build
# the build outputs to ./lib-es5, however the executable requires the node interpreter
node ./lib-es5/bin.js --help The output:
I'm going to assume you manage to make it work.. so he main thing is that we need to get node2nix to work against your fork's branch. |
@tegefaulkes In the future for this sort of work you would want to create the forks under MatrixAI group in github rather than your personal account: https://github.com/tegefaulkes/pkg It makes it easier for us to maintain forks and maintain overrides in our nixpkgs overlay. So to start I'm going to fork from vercel/pkg and pull your branch in there https://github.com/MatrixAI/pkg. |
The other really important thing is to always branch off from So for now I'll just create a feature branch off |
This is now done here: https://github.com/MatrixAI/pkg/tree/leveldown The steps were:
So now:
This repository and branch will now be the target of our Nix override. |
The nix override work in our overlay is located here: https://gitlab.com/MatrixAI/Engineering/nixpkgs-overlay/-/merge_requests/15 |
Ok, should be working now. Last thing is to check if the github CI still works. |
I don't think anything needs to change in our So please fix up my comments, ensure any linting is done, and also clean up the README and format it and squash all the commits. |
Misclicked closed. My bad. |
Failing on tests. I'll look it over and fix it up tomorrow. |
Checks are passing, looks like it's working. this should be good for a merge after a review. @CMCDragonkai |
1fd6f5e
to
ca5313b
Compare
Squashed. |
ca5313b
to
d94a3f3
Compare
That should be the last of it.
|
d94a3f3
to
f1241b1
Compare
Just fixed up a few things:
|
I noticed you also enabled source map for this repo. This is a good idea for a library. For a end-user application, not sure if it is relevant. |
Ah, jest was throwing some minor errors without it. It's not needed I think. |
You should also always test: Also we now have a custom override for our Until upstream merges. Our overlay can also have this change applied too in the mean time. |
The application build is currently failing due to the missing |
So it turns out that what's required is that:
The Interestingly you cannot make this work if you use |
Now I find that you need This makes sense as the Now that override and |
Yea I checked |
f1241b1
to
21decb8
Compare
… from source and removes pkg warnings
Regarding override issues: svanderburg/node2nix#178 I've changed to using Regarding the build warnings of creating a homeless shelter that's cause This is solved with this environment variable in the release builds:
Regarding the application build, both dev and prod require the @tegefaulkes still has to fix up the executable itself, the arguments to This is also important for the docker output which doesn't pass any parameters to the command. It will look like something is broken without this being fixed. |
My last commit ensures parity between nix-shell and nix-build. This should ensure that At the final point make sure to test all builds, application, docker, and the executables. And then merging time! |
Description
This PR is to test using vercel/pkg with native modules.
It imports the following node modules:
It should be able to build via pkg and nix-build method.
Issues Fixed
Tasks
Final checklist
Related issues and PRs: