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

assert submodules are available to Nix derivation #6835

Open
wants to merge 1 commit into
base: unstable
Choose a base branch
from

Conversation

jakubgs
Copy link
Member

@jakubgs jakubgs commented Jan 10, 2025

This should result in a human-readable error when ?submodules=1# is not appended to the project URL as the README explains:

 > nix build '.'
       error: Unable to build without submodules. Append '?submodules=1#' to the URL.

 > nix build '.?submodules=1#'

This should result in a human-readable error when `?submodules=1#` is
not appended to the project URL as the README explains:
```
 > nix build '.'
       error: Unable to build without submodules. Append '?submodules=1#' to the URL.

 > nix build '.?submodules=1#'
```

Signed-off-by: Jakub Sokołowski <[email protected]>
@tersec
Copy link
Contributor

tersec commented Jan 10, 2025

Why would this error condition happen to begin with?

Copy link

Unit Test Results

       12 files  ±0    1 822 suites  ±0   57m 53s ⏱️ - 1m 35s
  5 347 tests ±0    5 000 ✔️ ±0  347 💤 ±0  0 ±0 
29 565 runs  ±0  29 121 ✔️ ±0  444 💤 ±0  0 ±0 

Results for commit 9ccd1c7. ± Comparison against base commit c63862c.

@jakubgs
Copy link
Member Author

jakubgs commented Jan 10, 2025

Because if we do not specify ?submodules=1# in the URL when building the node via Nix then submodules will not be present and the build will fail. In a perfect would this would be configurable in the flake.nix itself, but currently it is not. For more context on problems with submodules you can read this issue:

I've added this assert because without it the error is incomprehensible to a mere mortal.

@tersec
Copy link
Contributor

tersec commented Jan 10, 2025

Because if we do not specify ?submodules=1# in the URL when building the node via Nix then submodules will not be present and the build will fail. In a perfect would this would be configurable in the flake.nix itself, but currently it is not. For more context on problems with submodules you can read this issue:

* [Submodules of flakes are not working NixOS/nix#6633](https://github.com/NixOS/nix/issues/6633)

I've added this assert because without it the error is incomprehensible to a mere mortal.

Ok, but why would it be intermittent, in that case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants