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

allow Nix builds by not calling git in isGitRepo for Nimble #23515

Merged
merged 1 commit into from
Apr 18, 2024

Conversation

jakubgs
Copy link
Contributor

@jakubgs jakubgs commented 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:

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 changed the title allow Nix builds by skipping isGitRepo for Nimble allow Nix builds by not calling git in isGitRepo for Nimble Apr 18, 2024
@Araq Araq merged commit d6823f4 into nim-lang:devel Apr 18, 2024
17 of 19 checks passed
narimiran pushed a commit 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)
Copy link
Contributor

Thanks for your hard work on this PR!
The lines below are statistics of the Nim compiler built from d6823f4

Hint: mm: orc; opt: speed; options: -d:release
178484 lines; 8.269s; 752.293MiB peakmem

@narimiran narimiran deleted the fix-nix-build branch April 26, 2024 12:31
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

2 participants