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

treewide/nixos: remove with lib; part 12 #369419

Merged

Conversation

Stunkymonkey
Copy link
Contributor

Description of changes

part of #208242

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 6.topic: xfce The Xfce Desktop Environment 6.topic: pantheon The Pantheon desktop environment 6.topic: cinnamon Desktop environment 6.topic: LXQt The Lightweight Qt Desktop Environment 6.topic: Lumina DE The Lumina Desktop Environment 6.topic: Enlightenment DE The Enlightenment Desktop Environment 6.topic: mate The MATE Desktop Environment labels Dec 30, 2024
@Stunkymonkey Stunkymonkey changed the title Treewide nixos remove with lib 12 treewide/nixos: remove with lib; part 12 Dec 30, 2024
@Stunkymonkey Stunkymonkey force-pushed the treewide-nixos-remove-with-lib-12 branch from 63c3423 to 6549f0d Compare December 30, 2024 15:53
@Stunkymonkey Stunkymonkey force-pushed the treewide-nixos-remove-with-lib-12 branch from 6549f0d to b122789 Compare December 30, 2024 15:57
@Stunkymonkey Stunkymonkey marked this pull request as ready for review December 30, 2024 15:59
@github-actions github-actions bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 labels Dec 30, 2024
Copy link
Contributor

@philiptaron philiptaron left a comment

Choose a reason for hiding this comment

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

Everything looks good. I'm planning on merging after running a few nixosTests.

@philiptaron philiptaron merged commit 194a74c into NixOS:master Dec 31, 2024
41 checks passed
@vcunat
Copy link
Member

vcunat commented Dec 31, 2024

Again, breaking things.

       error: undefined variable 'optional'
       at /nix/store/1jvzqyay4rb8bqyv0jbdwk9wb0frrhfs-source/nixos/modules/services/x11/desktop-managers/xfce.nix:130:10:
          129|     ] # TODO: NetworkManager doesn't belong here
          130|       ++ optional config.networking.networkmanager.enable networkmanagerapplet
             |          ^

@philiptaron
Copy link
Contributor

philiptaron commented Dec 31, 2024

Damn it! Ugh. I'm not merging any more of these because I can't verify correctness if I can't trust the tool to mutate the right areas. I checked on the commit that introduced the error (4b798ee). It's within a "with pkgs" context and I suspect that's what caused the issue, but I can't tell.

philiptaron added a commit to philiptaron/nixpkgs that referenced this pull request Dec 31, 2024
@K900
Copy link
Contributor

K900 commented Dec 31, 2024

I'm going to ask the same question I've asked before:

How many of these do we need to explode to realize that we need better testing?

@Ma27
Copy link
Member

Ma27 commented Dec 31, 2024

Now that I'm thinking again about this: can somebody explain to me why we're doing it like this in the first place?

Like, new usages of the same pattern will come up so I think the time people "invested" on that would be way better served if tooling was developed that does this reliably and can be used by contributors easily on their new changes (and by maintainers on their code).

Fixing behind everyone's back is something that we'll never be done with given that new usages will arise every now and then (and yes, I consider it a horrible contribution experience if we'd actually block PRs by asking people to... idk... remove withs or add spaces between {} or what not).

@vcunat
Copy link
Member

vcunat commented Dec 31, 2024

There were more of them, e.g. certmgr. A suspect list:
https://hydra.nixos.org/eval/1810800#tabs-removed

@philiptaron
Copy link
Contributor

philiptaron commented Dec 31, 2024

I'm clicking the revert button. I regret merging.

@philiptaron
Copy link
Contributor

Reverted in #369795

@vcunat
Copy link
Member

vcunat commented Jan 1, 2025

Oh, that hydra diff contains multiple of these "remove with lib;" pull requests, e.g. nixosTests.tor was broken by another one.

@vcunat
Copy link
Member

vcunat commented Jan 1, 2025

Actually, all of the stuff detected by trunk-combined job removals was from other PRs or fixed in the meantime 🤦🏽 as we can see from the eval after merging the revert.

@philiptaron
Copy link
Contributor

philiptaron commented Jan 1, 2025

Actually, all of the stuff detected by trunk-combined job removals was from other PRs or fixed in the meantime 🤦🏽 as we can see from the eval after merging the revert.

Sigh. I am trying to learn the "mass-evaluate-all-NixOS-tests" strategy that Mic92 alluded to in the previous PR. It took me a few tries to understand the output and how to discern something was already broken vs. newly broken, but I think I got it dialed in.

I've fixed everything that I found in this PR:

There may be more latent issues for modules without a NixOS test, or in the same modules without a NixOS test covering them.

@vcunat
Copy link
Member

vcunat commented Jan 2, 2025

Laziness can bite us here?

@vcunat
Copy link
Member

vcunat commented Jan 2, 2025

I suppose I'll make the nixos-unstable channel avoid these in-between commits where several services had evaluation issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: cinnamon Desktop environment 6.topic: Enlightenment DE The Enlightenment Desktop Environment 6.topic: Lumina DE The Lumina Desktop Environment 6.topic: LXQt The Lightweight Qt Desktop Environment 6.topic: mate The MATE Desktop Environment 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: pantheon The Pantheon desktop environment 6.topic: xfce The Xfce Desktop Environment 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants