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

add packages to Nix flake config, move to repo root #6180

Merged
merged 1 commit into from May 6, 2024

Conversation

jakubgs
Copy link
Member

@jakubgs jakubgs commented Apr 6, 2024

This way we can actually build and run a beacon node using just:

nix run 'github:status-im/nimbus-eth2?submodules=1'

The ?submodules=1 part should eventually not be necessary. For more details see:

@jakubgs jakubgs self-assigned this Apr 6, 2024
@jakubgs
Copy link
Member Author

jakubgs commented Apr 6, 2024

Looks like the submodule=1 flag doesn't work remotely with branch name for some reason:

 > nix run 'github:status-im/nimbus-eth2/nix-flake-packages?submodules=1#beacon_node'
error: builder for '/nix/store/kdf1l45rx93mz70nf7hzjgfb7m0szkzz-nimbus-eth2-unknown.drv' failed with exit code 2;
...
       > find: 'vendor/nimbus-build-system/scripts': No such file or directory

Seems like a bug. It works fie locally using nix run '.?submodule=1#beacon_node'.

nix/default.nix Outdated Show resolved Hide resolved
Copy link

github-actions bot commented Apr 7, 2024

Unit Test Results

         9 files  ±0    1 322 suites  ±0   36m 25s ⏱️ -10s
  4 982 tests ±0    4 634 ✔️ ±0  348 💤 ±0  0 ±0 
20 829 runs  ±0  20 425 ✔️ ±0  404 💤 ±0  0 ±0 

Results for commit 4a1a2c8. ± Comparison against base commit c41fe69.

♻️ This comment has been updated with latest results.

@jakubgs jakubgs marked this pull request as ready for review April 11, 2024 11:46
nix/default.nix Outdated Show resolved Hide resolved
jakubgs added a commit to status-im/Nim that referenced this pull request Apr 18, 2024
Because `isGitRepo()` call requires `/bin/sh` it will always fail when
building Nim in a Nix build sandbox, and the check doesn't even make
sense if Nix already provides Nimble source code.

Since for Nimble `allowBundled` is set to `true` this effectlvely does
not change behavior for normal builds, but does avoid ugly hacks when
building in Nix.

Reference:
status-im/nimbus-eth2#6180 (comment)

Signed-off-by: Jakub Sokołowski <jakub@status.im>
jakubgs added a commit to status-im/Nim that referenced this pull request Apr 18, 2024
Because `isGitRepo()` call requires `/bin/sh` it will always fail when
building Nim in a Nix build sandbox, and the check doesn't even make
sense if Nix already provides Nimble source code.

Since for Nimble `allowBundled` is set to `true` this effectlvely does
not change behavior for normal builds, but does avoid ugly hacks when
building in Nix which lacks `/bin/sh` and fails to call `git`.

Reference:
status-im/nimbus-eth2#6180 (comment)

Signed-off-by: Jakub Sokołowski <jakub@status.im>
@jakubgs jakubgs force-pushed the nix-flake-packages branch 3 times, most recently from e63c47c to 6d02a0f Compare April 18, 2024 09:53
Araq pushed a commit to nim-lang/Nim that referenced this pull request Apr 18, 2024
Because `isGitRepo()` call requires `/bin/sh` it will always fail when
building Nim in a Nix build sandbox, and the check doesn't even make
sense if Nix already provides Nimble source code.

Since for Nimble `allowBundled` is set to `true` this effectlvely does
not change behavior for normal builds, but does avoid ugly hacks when
building in Nix which lacks `/bin/sh` and fails to call `git`.

Reference:
*
status-im/nimbus-eth2#6180 (comment)

Signed-off-by: Jakub Sokołowski <jakub@status.im>
narimiran pushed a commit to nim-lang/Nim that referenced this pull request Apr 18, 2024
Because `isGitRepo()` call requires `/bin/sh` it will always fail when
building Nim in a Nix build sandbox, and the check doesn't even make
sense if Nix already provides Nimble source code.

Since for Nimble `allowBundled` is set to `true` this effectlvely does
not change behavior for normal builds, but does avoid ugly hacks when
building in Nix which lacks `/bin/sh` and fails to call `git`.

Reference:
*
status-im/nimbus-eth2#6180 (comment)

Signed-off-by: Jakub Sokołowski <jakub@status.im>
(cherry picked from commit d6823f4)
@jakubgs jakubgs force-pushed the nix-flake-packages branch 3 times, most recently from e77cd7c to bc3d838 Compare April 19, 2024 07:54
This way we can actually build and run a node using just:
```sh
nix run 'github:status-im/nimbus-eth2?submodules=1'
```
The `?submodules=1` part should eventually not be necessary.
For more details see:
NixOS/nix#4423

Signed-off-by: Jakub Sokołowski <jakub@status.im>
Copy link
Contributor

@apentori apentori left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tersec
Copy link
Contributor

tersec commented May 6, 2024

jenkins/nimbus-eth2/linux/x86_64/nimv2 CI failure is because nim-lang/Nim#23568

@jakubgs jakubgs merged commit 4a1a2c8 into unstable May 6, 2024
15 checks passed
@jakubgs jakubgs deleted the nix-flake-packages branch May 6, 2024 17:58
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

Successfully merging this pull request may close these issues.

None yet

6 participants