Skip to content
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

RFC 140 migration plan #258650

Open
infinisil opened this issue Oct 2, 2023 · 21 comments
Open

RFC 140 migration plan #258650

infinisil opened this issue Oct 2, 2023 · 21 comments
Labels
6.topic: architecture Relating to code and API architecture of Nixpkgs
Milestone

Comments

@infinisil
Copy link
Member

infinisil commented Oct 2, 2023

Here's my current plan to implement part 2 of RFC 140:

  1. Implement a strategy to make it easy to increase the strictness of the pkgs/by-name CI check:
  2. Require packages that use pkgs/by-name to not be defined with an { } argument in all-packages.nix:
  3. Require new packages using callPackage to use pkgs/by-name
  4. Try to migrate all packages that don't cause failures or output path changes

Ping the Nixpkgs Architecture Team, @roberth @Ericson2314 @tomberek @aakropotkin @DavHau @phaer

@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/2023-10-03-nixpkgs-architecture-team-meeting-44/33798/1

@SuperSandro2000
Copy link
Member

SuperSandro2000 commented Oct 22, 2023

What if I don't want my packages to be trapped in this experimental feature? It doesn't solve any problem for me personally, so it can only create new ones like breaking this fancy prepare-commit-msg hook I am using for a year (turns out I was confusing things) or it will likely break brittle update scripts (like the one for ArchiSteamFarm which are already pretty hard to test and I honestly don't know if it would work for r-rynatm even.

@phaer
Copy link
Member

phaer commented Oct 22, 2023

What if I don't want my packages to be trapped in this experimental feature?

Then you would have had about 7 months of time between the initial proposal and the end of FCP to add your concerns to the extensive discussion. You did so just now, so I would like to kindly ask you to keep this kind of the debate out of this thread which explicitly is about the implementation only. :)

@ghost
Copy link

ghost commented Oct 23, 2023

What if I don't want my packages

We don't have package owners. Everybody is allowed to submit PRs against any package.

to be trapped in this experimental feature?

This isn't an experimental feature; it's the future and it's long overdue.

I have plenty of automation that gets broken constantly because there is no reliable way to map from attrnames to files. Overlays get silently disabled when I rebase nixpkgs because there's no restrictions on what code can see which files -- I can't count the number of times my override-patches have been silently dropped because somebody rewired all-packages.nix and found a new way to reference the package's definition without going through the attrname I'd overridden. It's madness.

@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/2023-11-28-nixpkgs-architecture-team-meeting-46/36171/1

@SuperSandro2000
Copy link
Member

I have plenty of automation that gets broken constantly because there is no reliable way to map from attrnames to files.

There will be now for packages that are in this but there will be still plenty of interesting packages left, especially the more complicated ones.

Overlays get silently disabled when I rebase nixpkgs because there's no restrictions on what code can see which files -- I can't count the number of times my override-patches have been silently dropped because somebody rewired all-packages.nix and found a new way to reference the package's definition without going through the attrname I'd overridden. It's madness.

Except for versioned attrs people should create aliases which should make this manageable.

I also have a good forest of extra commits and overlays and I mostly touch them when things changed in the exact same files I was changing. Changing some things with overrides is a bit more complicated than directly touching the code especially if you plan to upstream it anyway.

With this change still everything sees everything. I don't see how that definitely solves your problems.

We don't have package owners. Everybody is allowed to submit PRs against any package.

If I tell that some people about some of their beloved packages then they would walk up the next wall.

Also this contradicts what you wrote below. If anyone can change anything at will then sure things break for others break left, right and center. Be it your overlays or my commits.

@ehmry
Copy link
Contributor

ehmry commented Dec 2, 2023

What happens to libsForQt5.callPackage ././. { } calls in all-packages.nix?

@infinisil
Copy link
Member Author

This PR makes progress on points 0. and 1.: #272395

@blaggacao
Copy link
Contributor

blaggacao commented Dec 13, 2023

@infinisil Maybe there's a way to reconcile the concerns about breaking update scripts. A regex fishing for ../.. patterns could with some probablility identify update scripts that break out of their unit folder-boundary and would thus likely break after migration. These could then be put in another shortlist and scheduled for manual migration. Would that be a viable way out for keeping the gameplan and reasonably addressing @SuperSandro2000 's concerns?

@infinisil
Copy link
Member Author

@blaggacao I think with the gradual transition enabled by approaches like #272395 that's totally a possibility. Once I get to running the automation, I'll do some quick grepping for ../.., update.sh and updateScript to hopefully catch most. Those would then just be excluded from the automated migration and have to be fixed manually.

@infinisil
Copy link
Member Author

@viraptor viraptor mentioned this issue Dec 21, 2023
13 tasks
@katexochen
Copy link
Contributor

  1. Try to migrate all packages that don't cause failures or output path changes
    [RFC 140 2b] pkgs/by-name: Automated migration #211832

Is the automatic migration still planned? Is this the next step, or do we need anything else?

@infinisil
Copy link
Member Author

infinisil commented Jan 26, 2024

@katexochen Indeed I'm still planning to do that, I'll try to get it done as soon as possible. It's the next and final step 😃

@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/nixpkgs-merge-bot-testing-and-plan/39824/1

@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/tweag-nix-dev-update-54/39990/1

@Atemu
Copy link
Member

Atemu commented Apr 6, 2024

Hi, what's the progress on this?

@infinisil
Copy link
Member Author

@Atemu In recent weeks we moved the tooling to a separate repo and got more people involved in contributions, so development speed is going faster now: https://github.com/NixOS/nixpkgs-check-by-name

Still not done, but work in on-going :)

@Aleksanaa
Copy link
Member

What about the automatic migration? Should we still wait now, or slowly migrate these packages during the update process?

@infinisil
Copy link
Member Author

Yeah that's still planned too, so I'd still wait. There's no real harm in delaying that until after, when we'll see the ones that can't be automatically migrated.

@infinisil
Copy link
Member Author

I just wrote down this thorough description of the current state and plan regarding the implementation of the automated migration: NixOS/nixpkgs-vet#56

tl;dr: It's quite tricky but doable!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: architecture Relating to code and API architecture of Nixpkgs
Projects
None yet
Development

No branches or pull requests

10 participants