Skip to content

Workaround for fetching git submodules for flakes#1356

Open
RichardWarfield wants to merge 2 commits intoNixOS:masterfrom
litxio:flake-submodules-fix
Open

Workaround for fetching git submodules for flakes#1356
RichardWarfield wants to merge 2 commits intoNixOS:masterfrom
litxio:flake-submodules-fix

Conversation

@RichardWarfield
Copy link

Workaround/fix for 1353

If a flake URI contains 'submodules=1' in the query part then any submodules should be fetched/initialized.

At present, hydra-eval-jobset uses the 'url' field of the flake metadata as the flake URI. This URI is missing the 'submodules=1' query, which is present elsewhere in the metadata.

This PR appends "&submodules=1" if the flake metadata indicates submodules are used (specifically, if the resolved.submodules field is true).

If a flake URI contains 'submodules=1' in the query part then any
submodules should be fetched/initialized.

At present, hydra-eval-jobset uses the 'url' field of the flake
metadata as the flake URI.  This URI is missing the 'submodules=1'
query, which is present elsewhere in the metadata.

This PR appends "&submodules=1" if the flake metadata indicates
submodules are used (specifically, if the resolved.submodules field
is true).
Copy link
Member

@Ma27 Ma27 left a comment

Choose a reason for hiding this comment

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

I think a testcase for that would be nice.

my $decoded = decode_json($json);
my $url = $decoded->{'url'}; # Doesn't have the &submodules=1, so add it back if needed
if ($decoded->{'resolved'}->{'submodules'}) {
$url = $url . "&submodules=1";
Copy link
Member

Choose a reason for hiding this comment

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

Is it safe that each $url has a query param already (i.e. ?foo=bar), otherwise the URL (git+file://foo&submodules=1 e.g.) is probably invalid.

@dasJ dasJ added the evaluator hydra-evaluator component label Jan 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

evaluator hydra-evaluator component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants