NixOS / hydra

Hydra, the Nix-based continuous build system
http://nixos.org/hydra
GNU General Public License v3.0
1.2k stars 309 forks source link

Git submodules not checked out in flake project, even with '?submodules=1' in flake uri. #1353

Open RichardWarfield opened 10 months ago

RichardWarfield commented 10 months ago

Describe the bug In a flake-based project that has a git submodule, the submodule seems not to get checked out, even with '?submodules=1' in the flake URI. The build fails with "No such file or directory" on a file in the submodule.

To Reproduce A reproducing example is proj2 here and has proj1 as a git submodule.

Create a jobset with flake URI of git+ssh://git@github.com/RichardWarfield/proj2?submodules=1

Expected behavior The job checks out the git repo with the required submodule and builds the project successfully

Log

Running phase: unpackPhase
unpacking source archive /nix/store/cadzicaa78vyvbdy1f7r4aqv1h4fiwnf-ijhnhy852xcxdb1qd8166gs4x3l9a4r3-source
source root is ijhnhy852xcxdb1qd8166gs4x3l9a4r3-source
Running phase: patchPhase
Running phase: updateAutotoolsGnuConfigScriptsPhase
Running phase: configurePhase
no configure script, doing nothing
Running phase: buildPhase
cc1: fatal error: ./proj1/src/hello_world.c: No such file or directory
compilation terminated.

Hydra Server:

[nix-shell:/etc/nixos]# hydra-server --version
/nix/store/pyh4fx1ak03nl96rawdka35a8y30v3pq-hydra-2023-12-24/bin/.hydra-server-wrapped
(Getopt::Long::GetOptions version 2.54; Perl version 5.38.2)
nixos-discourse commented 10 months ago

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/recommendations-for-a-simple-ci-build-server-setup/39068/1