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

Enabling submodules for self doesn't work when referencing github repo from nix run #11251

Open
ElrohirGT opened this issue Aug 3, 2024 · 1 comment
Labels

Comments

@ElrohirGT
Copy link

Describe the bug

I'm trying to make available a rust program I made using nix and flakes. The problem is when I'm inside a local copy of the repo I can enable submodules but when I try to run the same command using the github reference, it fails with the same error it gave me at the very beginning when submodules where not enabled. (See #4423 for more information on submodules and flakes).

Steps To Reproduce

Steps to reproduce the behavior:

  1. git clone --recurse-submodules -j8 https://github.com/ElrohirGT/Gr-ficasComputador
  2. cd Gr-ficasComputador
  3. nix run '.?submodules=1#hornystein'
  4. The 3rd command will probably fail in the compilation step of the program, this is fine. Is expected. What it I didn't expect was that when I try to run the same command without cloning the repo first, nix run 'github:ElrohirGT/Gr-ficasComputador?submodules=1#hornystein' it fails with:
image

Which is exactly the same error I was getting before finding out you need to enable submodules in your flake command.

Expected behavior

I expected the command nix run '.?submodules=1#hornystein' and nix run 'github:ElrohirGT/Gr-ficasComputador?submodules=1#hornystein' to be exactly the same in behaviour just that one uses the flake in . and the other downloads it.

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

Add any other context about the problem here.

Notify maintainers

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
- system: `"aarch64-darwin"`
 - host os: `Darwin 23.5.0, macOS 14.5`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.18.2`
 - channels(root): `"nixpkgs"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixpkgs`

Add a 👍 reaction to issues you find important.

@ElrohirGT ElrohirGT added the bug label Aug 3, 2024
@ElrohirGT
Copy link
Author

I previously posted this issue on the incorrect repository (NixOS/nixpkgs#332073). Still they were kind enough to answer my questions and suggest using: nix run 'git+https://github.com/ElrohirGT/Gr-ficasComputador?submodules=1#hornystein'.

That command works! But it's unintuitive really, ideally it should work with the github: syntax too!

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

No branches or pull requests

1 participant