8000 fix: rust: cargoLock: clear query and fragment from package urls by jullanggit · Pull Request #865 · nix-community/nix-init · GitHub
[go: up one dir, main page]

Skip to content

fix: rust: cargoLock: clear query and fragment from package urls - #865

Merged
figsoda merged 1 commit into
nix-community:mainfrom
jullanggit:main
Aug 30, 2026
Merged

figsoda merged 1 commit into
nix-community:mainfrom
jullanggit:main

Conversation

@jullanggit
@jullanggit jullanggit commented Aug 29, 2026 •
Copy link
Copy Markdown
Contributor

It could otherwise result in flake references like git+https://github.com/user/repo?rev=short#long?allRefs=1&rev=long&submodules=1, which is illegal and would fail.

The specific issue I ran into is:

nix-init . --url https://github.com/2e3s/aw-watcher-media-player
Enter tag or revision (defaults to v1.1.4)
❯ v1.1.4
Enter version
❯ 1.1.4
Enter pname
❯ aw-watcher-media-player
How should this package be built?
❯ 2 - buildRustPackage - cargoLock
2026-08-29T20:46:13.427492Z ERROR nix_init::lang::rust: src/lang/rust/mod.rs:155: command exited with exit status: 1
stdout:

stderr:
$ nix flake prefetch --extra-experimental-features 'nix-command flakes' --json git+https://github.com/ActivityWatch/aw-server-rust?rev=448312d#448312d410980d4a92a0fb4d4bb3fa3494cf6c89?allRefs=1&rev=448312d410980d4a92a0fb4d4bb3fa3494cf6c89&submodules=1
error: unexpected fragment '448312d410980d4a92a0fb4d4bb3fa3494cf6c89?allRefs=1&rev=448312d410980d4a92a0fb4d4bb3fa3494cf6c89&submodules=1' in flake reference 'git+https://github.com/ActivityWatch/aw-server-rust?rev=448312d#448312d410980d4a92a0fb4d4bb3fa3494cf6c89?allRefs=1&rev=448312d410980d4a92a0fb4d4bb3fa3494cf6c89&submodules=1'
Error: command exited with exit status: 1

Location:
    src/prefetch.rs:22:13

This now works with these changes (at least on my machine™ :) )

@figsoda figsoda left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

thank you!

8000

@figsoda
figsoda merged commit 6a36096 into nix-community:main Aug 30, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0