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 #332073

Closed
ElrohirGT opened this issue Aug 3, 2024 · 2 comments
Labels
0.kind: bug Something is broken

Comments

@ElrohirGT
Copy link
Contributor

ElrohirGT commented Aug 3, 2024

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 NixOS/nix#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 0.kind: bug Something is broken label Aug 3, 2024
@ghpzin
Copy link
Contributor

ghpzin commented Aug 3, 2024

  1. https://github.com/NixOS/nix is probably a better place for this issue.
    Because there is not much related to nixpkgs in how nix handles nix run, flakes or submodules.
  2. You may need to use git instead of github for nix to handle submodules correctly even with ?submodules=1:
    nix run 'git+https://github.com/ElrohirGT/Gr-ficasComputador?submodules=1#hornystein'

@ElrohirGT
Copy link
Contributor Author

  1. Oh, yeah that makes sense! I'm gonna post it there right now.
  2. You're right! That last command works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken
Projects
None yet
Development

No branches or pull requests

2 participants