8000 chore: give a clearer message when `nurl` cannot be found by jfly · Pull Request #876 · nix-community/nix-init · GitHub
[go: up one dir, main page]

Skip to content

chore: give a clearer message when nurl cannot be found - #876

Merged
figsoda merged 1 commit into
nix-community:mainfrom
jfly:clearer-message-when-missing-nurl
Nov 4, 2026
Merged

figsoda merged 1 commit into
nix-community:mainfrom
jfly:clearer-message-when-missing-nurl

Conversation

@jfly
@jfly jfly commented Sep 13, 2026 •
Copy link
Copy Markdown
Contributor

I naively tried building and running this with cargo, and ran into this pretty useless error message:

cargo build && ./target/debug/nix-init -u https://github.com/SatAgro/suntime
   Compiling nix-init v0.3.6 (/home/jeremy/src/github.com/nix-community/nix-init)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 5.94s
Error: No such file or directory (os error 2)

With this change, we get a much more useful message:

cargo build && ./target/debug/nix-init -u https://github.com/SatAgro/suntime
   Compiling nix-init v0.3.6 (/home/jeremy/src/github.com/nix-community/nix-init)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 5.79s
Error: failed to run nurl

Caused by:
    No such file or directory (os error 2)

The "real" issue here is that I didn't have nurl on my PATH, because the full devShell doesn't include it (this was a bug, fixed in #877). However, I do think it's a kindness to give a clearer error message here.

I naively tried building and running this with cargo, and ran into this
pretty useless error message:

```console
cargo build && ./target/debug/nix-init -u https://github.com/SatAgro/suntime
   Compiling nix-init v0.3.6 (/home/jeremy/src/github.com/nix-community/nix-init)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 5.94s
Error: No such file or directory (os error 2)
```

With this change, we get a much more useful message:

```console
cargo build && ./target/debug/nix-init -u https://github.com/SatAgro/suntime
   Compiling nix-init v0.3.6 (/home/jeremy/src/github.com/nix-community/nix-init)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 5.79s
Error: failed to run nurl

Caused by:
    No such file or directory (os error 2)
```

The "real" issue here is that I didn't have `nurl` on my `PATH`, because the
`full` devShell doesn't include it (this seems like a bug, I'll fix it
in a followup PR). However, I do think it's a kindness to give a
clearer error message here.
@figsoda
figsoda merged commit 3fc356b into nix-community:main Nov 4, 2026
3 checks passed
@jfly
jfly deleted the clearer-message-when-missing-nurl branch November 4, 2026 03:39
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