-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
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
[staging] fetchFromGitHub: name source with content intristic to the value #153386
base: staging
Are you sure you want to change the base?
Conversation
cc @infinisil who has lead RFCs trying to get around this cc @domenkozar who had concerns around flake usage cc @edolstra to make sure I'm not dumb :) |
I believe ofborg timed out. As this is essentially a stdenv rebuild |
@GrahamcOfBorg eval |
21dc904
to
576e26b
Compare
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/merge-fast-and-break-things/16957/10 |
a8f43bb
to
83660f9
Compare
@@ -287,7 +287,7 @@ in { | |||
# Components that require access to serial devices (/dev/tty*) | |||
# List generated from home-assistant documentation: | |||
# git clone https://github.com/home-assistant/home-assistant.io/ | |||
# cd source/_integrations | |||
# cd ${src.name}/_integrations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please drop this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to try and factor out all of the package updates to separate PRs, eventually this should just be the fetcher change and sha fixes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess I could mark this as draft until then
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is editing a comment that isn't fetcher related at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
correct, but eventually I'll fix it when pruning the commits :)
No, we shouldn't do it even temporarily (since temporary things have a tendency to become permanent). Like I said before, I don't want to go back to every fetcher in the Nix ecosystem producing inconsistent names. And it shouldn't be the case that changing the name of a repo or switching from a tag to a revision triggers a rebuild. |
I agree that this isn't ideal. However, there's not a single instance (that I could find) of I guess I'm optimizing for the human experience, and trying to avoid stale FODs. While retaining "source" as the derivation name is optimising for the nix experience. I think it makes sense for the exception be: "To use alongside builtins.fetch*, please pass With the changes in this PR, the default is: " |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/how-to-reference-src-directory-in-nix/18956/4 |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/why-is-the-r-ryantm-bot-using-refs-tags-in-the-version/20519/7 |
Over a year ago, @Ericson2314 suggested waiting up to a year and then revisiting this. Can we revisit this? I would love to lose both the footgun of forgetting to update a hash and the confusion of looking at a list of paths named |
bump, I still think this is a major QoL win |
Building towards element-desktop this is what I see. 🤡
|
patchPhase = ''sed "s@ldconfig.*@@" -i source/Makefile''; | ||
patchPhase = ''sed "s@ldconfig.*@@" -i ${src.name}/Makefile''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default name
of the FOD produced by fetchurl
is the basename of the URL, with file name extension included. In this case, it is currently "aeolus-0.10.4.tar.bz2"
, and the sensible value is "aeolus-0.10.4"
.
In my opinion, commands in phases should respect "$sourceRoot"
, so that overriding with src
from a different fetcher is possible. I'll put the discussion under the RFC PR.
@oxij's recent work
... #49862 was born in 2018. It will go to school this year.
To be a bit more serious, though, yes, this appears to want to do exactly the same thing my PR does, motivation here is part of my motivation there, and I got exactly the same pushback on it.
Though, I did recently propose a solution to make everyone happy by adding a `nixpkgs.config` option so Hydra can have its `*-source` and developers can have all those sources named prettily in `/nix/store` and force rebuilds on revision change, exactly as here, yes.
|
Now an RFC
NixOS/rfcs#171
Pre-RFC text:
Motivation for this change
DRAFT until package failures around src name are factored out
Just giving the derivation a name of "source" by default causes
a lot of pain when someone may update the rev, but fail to
compute the new sha256 or invalidate the existing sha256. A stale
sha256 will still be "valid" in the eyes of nix, as only the way
in which the sources are fetched has changed, but the previous
.drv and sha256 relationship is still preserved.
This change forces the FODs to be recomputed as the related .drv
has changed.
This will not require all of the FOD sha256s to be recomputed, as
the contents will not have changed. However, it will be a mass
rebuild as it will create a new DAG for packages which didn't
already pass a "name" value to fetchFromGitHub.
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)nixos/doc/manual/md-to-db.sh
to update generated release notes