-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Nix 2.4 assumes refs are branch names and fails on tags (regression) #5291
Comments
Cross-reference (duplicate?): #5128 |
Due to changes in how Nix handles Git refs we need to specify `refs/tags/` prefix in `package.json` to avoid the following error: ``` fatal: couldn't find remote ref refs/heads/v2.0.3-status-v6 error: program 'git' failed with exit code 128 ``` Issue: NixOS/nix#5291 Signed-off-by: Jakub Sokołowski <jakub@status.im>
Due to changes in how Nix handles Git refs we need to specify `refs/tags/` prefix in `package.json` to avoid the following error: ``` fatal: couldn't find remote ref refs/heads/v2.0.3-status-v6 error: program 'git' failed with exit code 128 ``` Resolves: #12832 Issue: NixOS/nix#5291 Signed-off-by: Jakub Sokołowski <jakub@status.im>
Due to changes in how Nix handles Git refs we need to specify `refs/tags/` prefix in `package.json` to avoid the following error: ``` fatal: couldn't find remote ref refs/heads/v2.0.3-status-v6 error: program 'git' failed with exit code 128 ``` Resolves: #12832 Issue: NixOS/nix#5291 Signed-off-by: Jakub Sokołowski <jakub@status.im>
Due to changes in how Nix handles Git refs we need to specify `refs/tags/` prefix in `package.json` to avoid the following error: ``` fatal: couldn't find remote ref refs/heads/v2.0.3-status-v6 error: program 'git' failed with exit code 128 ``` Resolves: #12832 Issue: NixOS/nix#5291 Signed-off-by: Jakub Sokołowski <jakub@status.im>
Due to changes in how Nix handles Git refs we need to specify `refs/tags/` prefix in `package.json` to avoid the following error: ``` fatal: couldn't find remote ref refs/heads/v2.0.3-status-v6 error: program 'git' failed with exit code 128 ``` Resolves: #12832 Issue: NixOS/nix#5291 Signed-off-by: Jakub Sokołowski <jakub@status.im>
Due to changes in how Nix handles Git refs we need to specify `refs/tags/` prefix in `package.json` to avoid the following error: ``` fatal: couldn't find remote ref refs/heads/v2.0.3-status-v6 error: program 'git' failed with exit code 128 ``` Resolves: #12832 Issue: NixOS/nix#5291 Signed-off-by: Jakub Sokołowski <jakub@status.im>
Due to changes in how Nix handles Git refs we need to specify `refs/tags/` prefix in `package.json` to avoid the following error: ``` fatal: couldn't find remote ref refs/heads/v2.0.3-status-v6 error: program 'git' failed with exit code 128 ``` Resolves: #12832 Issue: NixOS/nix#5291 Signed-off-by: Jakub Sokołowski <jakub@status.im>
Due to changes in how Nix handles Git refs we need to specify `refs/tags/` prefix in `package.json` to avoid the following error: ``` fatal: couldn't find remote ref refs/heads/v2.0.3-status-v6 error: program 'git' failed with exit code 128 ``` Resolves: #12832 Issue: NixOS/nix#5291 Signed-off-by: Jakub Sokołowski <jakub@status.im>
Due to changes in how Nix handles Git refs we need to specify `refs/tags/` prefix in `package.json` to avoid the following error: ``` fatal: couldn't find remote ref refs/heads/v2.0.3-status-v6 error: program 'git' failed with exit code 128 ``` I also had to rewrite some logic in `nix/scripts/source.sh` in order to take account of single-user and multi-user installations. Resolves: #12832 Issue: NixOS/nix#5291 Signed-off-by: Jakub Sokołowski <jakub@status.im>
Due to changes in how Nix handles Git refs we need to specify `refs/tags/` prefix in `package.json` to avoid the following error: ``` fatal: couldn't find remote ref refs/heads/v2.0.3-status-v6 error: program 'git' failed with exit code 128 ``` I also had to rewrite some logic in `nix/scripts/source.sh` in order to take account of single-user and multi-user installations. Resolves: #12832 Issue: NixOS/nix#5291 Signed-off-by: Jakub Sokołowski <jakub@status.im>
Due to changes in how Nix handles Git refs we need to specify `refs/tags/` prefix in `package.json` to avoid the following error: ``` fatal: couldn't find remote ref refs/heads/v2.0.3-status-v6 error: program 'git' failed with exit code 128 ``` I also had to rewrite some logic in `nix/scripts/source.sh` in order to take account of single-user and multi-user installations. Resolves: #12832 Issue: NixOS/nix#5291 Signed-off-by: Jakub Sokołowski <jakub@status.im>
Due to changes in how Nix handles Git refs we need to specify `refs/tags/` prefix in `package.json` to avoid the following error: ``` fatal: couldn't find remote ref refs/heads/v2.0.3-status-v6 error: program 'git' failed with exit code 128 ``` I also had to rewrite some logic in `nix/scripts/source.sh` in order to take account of single-user and multi-user installations. Resolves: #12832 Issue: NixOS/nix#5291 Signed-off-by: Jakub Sokołowski <jakub@status.im>
Due to changes in how Nix handles Git refs we need to specify `refs/tags/` prefix in `package.json` to avoid the following error: ``` fatal: couldn't find remote ref refs/heads/v2.0.3-status-v6 error: program 'git' failed with exit code 128 ``` I also had to rewrite some logic in `nix/scripts/source.sh` in order to take account of single-user and multi-user installations. Resolves: #12832 Issue: NixOS/nix#5291 Signed-off-by: Jakub Sokołowski <jakub@status.im>
Due to changes in how Nix handles Git refs we need to specify `refs/tags/` prefix in `package.json` to avoid the following error: ``` fatal: couldn't find remote ref refs/heads/v2.0.3-status-v6 error: program 'git' failed with exit code 128 ``` I also had to rewrite some logic in `nix/scripts/source.sh` in order to take account of single-user and multi-user installations. Resolves: #12832 Issue: NixOS/nix#5291 Signed-off-by: Jakub Sokołowski <jakub@status.im>
Due to changes in how Nix handles Git refs we need to specify `refs/tags/` prefix in `package.json` to avoid the following error: ``` fatal: couldn't find remote ref refs/heads/v2.0.3-status-v6 error: program 'git' failed with exit code 128 ``` I also had to rewrite some logic in `nix/scripts/source.sh` in order to take account of single-user and multi-user installations. Resolves: #12832 Issue: NixOS/nix#5291 Signed-off-by: Jakub Sokołowski <jakub@status.im>
Due to changes in how Nix handles Git refs we need to specify `refs/tags/` prefix in `package.json` to avoid the following error: ``` fatal: couldn't find remote ref refs/heads/v2.0.3-status-v6 error: program 'git' failed with exit code 128 ``` I also had to rewrite some logic in `nix/scripts/source.sh` in order to take account of single-user and multi-user installations. Resolves: #12832 Issue: NixOS/nix#5291 Signed-off-by: Jakub Sokołowski <jakub@status.im>
Due to changes in how Nix handles Git refs we need to specify `refs/tags/` prefix in `package.json` to avoid the following error: ``` fatal: couldn't find remote ref refs/heads/v2.0.3-status-v6 error: program 'git' failed with exit code 128 ``` I also had to rewrite some logic in `nix/scripts/source.sh` in order to take account of single-user and multi-user installations. Resolves: #12832 Issue: NixOS/nix#5291 Signed-off-by: Jakub Sokołowski <jakub@status.im>
Due to changes in how Nix handles Git refs we need to specify `refs/tags/` prefix in `package.json` to avoid the following error: ``` fatal: couldn't find remote ref refs/heads/v2.0.3-status-v6 error: program 'git' failed with exit code 128 ``` I also had to rewrite some logic in `nix/scripts/source.sh` in order to take account of single-user and multi-user installations. Resolves: #12832 Issue: NixOS/nix#5291 Signed-off-by: Jakub Sokołowski <jakub@status.im>
Due to changes in how Nix handles Git refs we need to specify `refs/tags/` prefix in `package.json` to avoid the following error: ``` fatal: couldn't find remote ref refs/heads/v2.0.3-status-v6 error: program 'git' failed with exit code 128 ``` I also had to rewrite some logic in `nix/scripts/source.sh` in order to take account of single-user and multi-user installations. Resolves: #12832 Issue: NixOS/nix#5291 Signed-off-by: Jakub Sokołowski <jakub@status.im>
Due to changes in how Nix handles Git refs we need to specify `refs/tags/` prefix in `package.json` to avoid the following error: ``` fatal: couldn't find remote ref refs/heads/v2.0.3-status-v6 error: program 'git' failed with exit code 128 ``` I also had to rewrite some logic in `nix/scripts/source.sh` in order to take account of single-user and multi-user installations. Resolves: #12832 Issue: NixOS/nix#5291 Signed-off-by: Jakub Sokołowski <jakub@status.im>
Due to changes in how Nix handles Git refs we need to specify `refs/tags/` prefix in `package.json` to avoid the following error: ``` fatal: couldn't find remote ref refs/heads/v2.0.3-status-v6 error: program 'git' failed with exit code 128 ``` I also had to rewrite some logic in `nix/scripts/source.sh` in order to take account of single-user and multi-user installations. Resolves: #12832 Issue: NixOS/nix#5291 Signed-off-by: Jakub Sokołowski <jakub@status.im>
Due to changes in how Nix handles Git refs we need to specify `refs/tags/` prefix in `package.json` to avoid the following error: ``` fatal: couldn't find remote ref refs/heads/v2.0.3-status-v6 error: program 'git' failed with exit code 128 ``` I also had to rewrite some logic in `nix/scripts/source.sh` in order to take account of single-user and multi-user installations. Resolves: #12832 Issue: NixOS/nix#5291 Signed-off-by: Jakub Sokołowski <jakub@status.im>
Due to changes in how Nix handles Git refs we need to specify `refs/tags/` prefix in `package.json` to avoid the following error: ``` fatal: couldn't find remote ref refs/heads/v2.0.3-status-v6 error: program 'git' failed with exit code 128 ``` I also had to rewrite some logic in `nix/scripts/source.sh` in order to take account of single-user and multi-user installations. Resolves: #12832 Issue: NixOS/nix#5291 Signed-off-by: Jakub Sokołowski <jakub@status.im>
Due to changes in how Nix handles Git refs we need to specify `refs/tags/` prefix in `package.json` to avoid the following error: ``` fatal: couldn't find remote ref refs/heads/v2.0.3-status-v6 error: program 'git' failed with exit code 128 ``` I also had to rewrite some logic in `nix/scripts/source.sh` in order to take account of single-user and multi-user installations. Resolves: #12832 Issue: NixOS/nix#5291 Signed-off-by: Jakub Sokołowski <jakub@status.im>
Due to changes in how Nix handles Git refs we need to specify `refs/tags/` prefix in `package.json` to avoid the following error: ``` fatal: couldn't find remote ref refs/heads/v2.0.3-status-v6 error: program 'git' failed with exit code 128 ``` I also had to rewrite some logic in `nix/scripts/source.sh` in order to take account of single-user and multi-user installations. Resolves: #12832 Issue: NixOS/nix#5291 Signed-off-by: Jakub Sokołowski <jakub@status.im>
Due to changes in how Nix handles Git refs we need to specify `refs/tags/` prefix in `package.json` to avoid the following error: ``` fatal: couldn't find remote ref refs/heads/v2.0.3-status-v6 error: program 'git' failed with exit code 128 ``` I also had to rewrite some logic in `nix/scripts/source.sh` in order to take account of single-user and multi-user installations. Resolves: #12832 Depends on: status-im/status-jenkins-lib#37 Issue: NixOS/nix#5291 Signed-off-by: Jakub Sokołowski <jakub@status.im>
Due to changes in how Nix handles Git refs we need to specify `refs/tags/` prefix in `package.json` to avoid the following error: ``` fatal: couldn't find remote ref refs/heads/v2.0.3-status-v6 error: program 'git' failed with exit code 128 ``` I also had to rewrite some logic in `nix/scripts/source.sh` in order to take account of single-user and multi-user installations. Resolves: #12832 Depends on: status-im/status-jenkins-lib#37 Issue: NixOS/nix#5291 Signed-off-by: Jakub Sokołowski <jakub@status.im>
Due to changes in how Nix handles Git refs we need to specify `refs/tags/` prefix in `package.json` to avoid the following error: ``` fatal: couldn't find remote ref refs/heads/v2.0.3-status-v6 error: program 'git' failed with exit code 128 ``` I also had to rewrite some logic in `nix/scripts/source.sh` in order to take account of single-user and multi-user installations. Resolves: #12832 Depends on: status-im/status-jenkins-lib#37 Issue: NixOS/nix#5291 Signed-off-by: Jakub Sokołowski <jakub@status.im>
Due to changes in how Nix handles Git refs we need to specify `refs/tags/` prefix in `package.json` to avoid the following error: ``` fatal: couldn't find remote ref refs/heads/v2.0.3-status-v6 error: program 'git' failed with exit code 128 ``` I also had to rewrite some logic in `nix/scripts/source.sh` in order to take account of single-user and multi-user installations. Resolves: #12832 Depends on: status-im/status-jenkins-lib#37 Issue: NixOS/nix#5291 Signed-off-by: Jakub Sokołowski <jakub@status.im>
Due to changes in how Nix handles Git refs we need to specify `refs/tags/` prefix in `package.json` to avoid the following error: ``` fatal: couldn't find remote ref refs/heads/v2.0.3-status-v6 error: program 'git' failed with exit code 128 ``` I also had to rewrite some logic in `nix/scripts/source.sh` in order to take account of single-user and multi-user installations. Resolves: #12832 Depends on: status-im/status-jenkins-lib#37 Issue: NixOS/nix#5291 Signed-off-by: Jakub Sokołowski <jakub@status.im>
Due to changes in how Nix handles Git refs we need to specify `refs/tags/` prefix in `package.json` to avoid the following error: ``` fatal: couldn't find remote ref refs/heads/v2.0.3-status-v6 error: program 'git' failed with exit code 128 ``` I also had to rewrite some logic in `nix/scripts/source.sh` in order to take account of single-user and multi-user installations. Resolves: #12832 Depends on: status-im/status-jenkins-lib#37 Issue: NixOS/nix#5291 Signed-off-by: Jakub Sokołowski <jakub@status.im>
Due to changes in how Nix handles Git refs we need to specify `refs/tags/` prefix in `package.json` to avoid the following error: ``` fatal: couldn't find remote ref refs/heads/v2.0.3-status-v6 error: program 'git' failed with exit code 128 ``` I also had to rewrite some logic in `nix/scripts/source.sh` in order to take account of single-user and multi-user installations. Resolves: #12832 Depends on: status-im/status-jenkins-lib#37 Issue: NixOS/nix#5291 Signed-off-by: Jakub Sokołowski <jakub@status.im>
Due to changes in how Nix handles Git refs we need to specify `refs/tags/` prefix in `package.json` to avoid the following error: ``` fatal: couldn't find remote ref refs/heads/v2.0.3-status-v6 error: program 'git' failed with exit code 128 ``` I also had to rewrite some logic in `nix/scripts/source.sh` in order to take account of single-user and multi-user installations. Resolves: #12832 Depends on: status-im/status-jenkins-lib#37 Issue: NixOS/nix#5291 Signed-off-by: Jakub Sokołowski <jakub@status.im>
Due to changes in how Nix handles Git refs we need to specify `refs/tags/` prefix in `package.json` to avoid the following error: ``` fatal: couldn't find remote ref refs/heads/v2.0.3-status-v6 error: program 'git' failed with exit code 128 ``` I also had to rewrite some logic in `nix/scripts/source.sh` in order to take account of single-user and multi-user installations. Resolves: #12832 Depends on: status-im/status-jenkins-lib#37 Issue: NixOS/nix#5291 Signed-off-by: Jakub Sokołowski <jakub@status.im>
Due to changes in how Nix handles Git refs we need to specify `refs/tags/` prefix in `package.json` to avoid the following error: ``` fatal: couldn't find remote ref refs/heads/v2.0.3-status-v6 error: program 'git' failed with exit code 128 ``` I also had to rewrite some logic in `nix/scripts/source.sh` in order to take account of single-user and multi-user installations. Resolves: #12832 Depends on: status-im/status-jenkins-lib#37 Issue: NixOS/nix#5291 Signed-off-by: Jakub Sokołowski <jakub@status.im>
Due to changes in how Nix handles Git refs we need to specify `refs/tags/` prefix in `package.json` to avoid the following error: ``` fatal: couldn't find remote ref refs/heads/v2.0.3-status-v6 error: program 'git' failed with exit code 128 ``` I also had to rewrite some logic in `nix/scripts/source.sh` in order to take account of single-user and multi-user installations. We default to multi-user for Darwin, but not for any other OS due to discovered issues with `nix-daemon` socket on Arch and open file limits. Resolves: #12832 Depends on: status-im/status-jenkins-lib#37 Issues: * NixOS/nix#5291 * NixOS/nix#6007 Signed-off-by: Jakub Sokołowski <jakub@status.im>
Due to changes in how Nix handles Git refs we need to specify `refs/tags/` prefix in `package.json` to avoid the following error: ``` fatal: couldn't find remote ref refs/heads/v2.0.3-status-v6 error: program 'git' failed with exit code 128 ``` I also had to rewrite some logic in `nix/scripts/source.sh` in order to take account of single-user and multi-user installations. We default to multi-user for Darwin, but not for any other OS due to discovered issues with `nix-daemon` socket on Arch and open file limits. Resolves: #12832 Depends on: status-im/status-jenkins-lib#37 Issues: * NixOS/nix#5291 * NixOS/nix#6007 Signed-off-by: Jakub Sokołowski <jakub@status.im>
Due to changes in how Nix handles Git refs we need to specify `refs/tags/` prefix in `package.json` to avoid the following error: ``` fatal: couldn't find remote ref refs/heads/v2.0.3-status-v6 error: program 'git' failed with exit code 128 ``` I also had to rewrite some logic in `nix/scripts/source.sh` in order to take account of single-user and multi-user installations. We default to multi-user for Darwin, but not for any other OS due to discovered issues with `nix-daemon` socket on Arch and open file limits. Resolves: #12832 Depends on: status-im/status-jenkins-lib#37 Issues: * NixOS/nix#5291 * NixOS/nix#6007 Signed-off-by: Jakub Sokołowski <jakub@status.im>
Due to changes in how Nix handles Git refs we need to specify `refs/tags/` prefix in `package.json` to avoid the following error: ``` fatal: couldn't find remote ref refs/heads/v2.0.3-status-v6 error: program 'git' failed with exit code 128 ``` I also had to rewrite some logic in `nix/scripts/source.sh` in order to take account of single-user and multi-user installations. We default to multi-user for Darwin, but not for any other OS due to discovered issues with `nix-daemon` socket on Arch and open file limits. Resolves: #12832 Depends on: status-im/status-jenkins-lib#37 Issues: * NixOS/nix#5291 * NixOS/nix#6007 Signed-off-by: Jakub Sokołowski <jakub@status.im>
I marked this as stale due to inactivity. → More info |
This issue can be worked around by adding a |
Still important to me |
As I said over on #8790 I believe this is the fault of this line of code: Line 565 in 635df5e
I'd be happy to submit a patch that just... doesn't try to prefix the ref name and gives it to git as-is. However, I don't understand why the fetcher is doing that in the first place, so I don't know what other regressions that might cause. |
ha! found it. this was added in fb38459 which says
Additionally, some but not all of the nuances to this logic have been properly documented: https://nixos.org/manual/nix/stable/language/builtins.html#builtins-fetchGit
The Git reference under which to look for the requested revision. This is often a branch or tag name.
I note that the choice to link to upstream git documentation to define what a git reference is, along with the remark that it "is often a branch or tag name", seem to suggest that users should be able to pass anything that git would accept at the command line. Unfortunately this is directly at odds with prefixing it with None of those sources say this, but to me the best argument to sanitize the ref is that we don't want nix's behavior to depend too much on specific versions of git and their quirks. This leaves the question of how we should fix it. If we stick with the current logic that only makes one call to git, we can't know for sure whether we've got a branch or a tag, so turning off the sanitization is the only option. There is a chance that would break someone downstream. Alternatively, there could be fallback logic which first attempts to retrieve a tag, then a branch if that fails. (Surely tags are more common, right?) Unfortunately the code is a little more convoluted than I realized at first, I'm not sure I can be the one to implement this. |
oh um just to be more explicit, my preferred solution is the two-calls-to-git approach, trying it first as a tag and then as a branch. |
Describe the bug
Nix 2.4 assumes refs are branch names and fails on tags.
Steps To Reproduce
Try this with Nix 2.4:
Expected behavior
This worked with Nix 2.3.11:
nix-env --version
outputnix-env (Nix) 2.4pre20210908_3c56f62
Additional context
Changing to
ref = "refs/tags/1.0.5";
works as a workaround. (In my experience it's way more common to use tags for versioning than branches.)The text was updated successfully, but these errors were encountered: