Skip to content

Avoid mutable URL store path being too long - #245

Open
alfarelcynthesis wants to merge 1 commit into
andir:masterfrom
alfarelcynthesis:avoid-too-long-mutable-url-store-path
Open

Avoid mutable URL store path being too long#245
alfarelcynthesis wants to merge 1 commit into
andir:masterfrom
alfarelcynthesis:avoid-too-long-mutable-url-store-path

Conversation

@alfarelcynthesis

@alfarelcynthesis alfarelcynthesis commented Jul 12, 2026

Copy link
Copy Markdown

Fixes: #244

Not sure if there is a clearer/more idiomatic way to solve this.
A fix of some kind is needed to avoid the long names given by the use of fully resolved URLs and the inclusion of query parameters in fetchurl name detection, since store paths have limited length (211 chars).

Using the pin's name, which must (afaict) be supplied manually for mutable URLs, seems like a good compromise of should-always-work and is-accurate.

Of course, supplying a needlessly long name will still break this, but that's a reasonable "give very long pin name" -> "store path is too long" error, which seems like good enough UX.

I'm not familiar enough with npins to know if this is the correct way to bump the vendored default.nix version, but it does seem like it would be necessary here to cause a prompt about the change.
This shouldn't actually be a breaking change, unless someone is actually relying on the store path for a mutable URL pin having a specific structure from the underlying URL... that seems like not really a part of the API contract, though.

@alfarelcynthesis

alfarelcynthesis commented Jul 12, 2026

Copy link
Copy Markdown
Author

Still need to test out the upgrade prompt myself, but can confirm the mkUrlSource change does prevent the issue at the very least.

Can confirm that everything works as expected when compiled from my branch.

@alfarelcynthesis

Copy link
Copy Markdown
Author

This will also affect fetchTarball, which I haven't had a chance to check, but it makes sense that it could benefit as well (when behind a mutable URL, like for the latest GitHub release of something whose main repo is not in-sync with releases).

@piegamesde

Copy link
Copy Markdown
Collaborator

I mean let's try this out. Though no version bump needed here, as the format itself did not change

@alfarelcynthesis
alfarelcynthesis force-pushed the avoid-too-long-mutable-url-store-path branch from 737f5cd to 4e5d840 Compare July 27, 2026 15:12
@alfarelcynthesis

Copy link
Copy Markdown
Author

Sounds good to me, and thanks for the clarification, wasn't sure when version bumps were useful/necessary.

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.

Mutable URLs cause invalid outPath when they are too long

2 participants