Skip to content

Revert "nv-codec-headers: recreate under by-name"#325242

Merged
flokli merged 1 commit intoNixOS:masterfrom
flokli:revert-nv-codec-headers
Jul 7, 2024
Merged

Revert "nv-codec-headers: recreate under by-name"#325242
flokli merged 1 commit intoNixOS:masterfrom
flokli:revert-nv-codec-headers

Conversation

@flokli
Copy link
Member

@flokli flokli commented Jul 7, 2024

This reverts commit 01f7c8a.

It broke NixOS config evaluation, as in
#324199 (comment).

Description of changes

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.

This reverts commit 01f7c8a.

It broke NixOS config evaluation, as in
NixOS#324199 (comment).
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Jul 7, 2024
@Aleksanaa
Copy link
Member

Did you have a pkgs.sources sitting somewhere in your config? While this does seem like it could cause a problem, we haven't encountered it yet (in Nixpkgs)?

@flokli
Copy link
Member Author

flokli commented Jul 7, 2024

Did you have a pkgs.sources sitting somewhere in your config? While this does seem like it could cause a problem, we haven't encountered it yet (in Nixpkgs)?

I have a sources in my NixOS config, yes (and use Niv to pin dependencies), I define it in an overlay like this:

  sources = import ./sources.nix { inherit (super) system; };

… and use sources. in various places in my NixOS configuration.

@Aleksanaa
Copy link
Member

Still don't get it, we even don't have any nv-codec matches in nixos modules?

@Aleksanaa
Copy link
Member

Oh

@flokli
Copy link
Member Author

flokli commented Jul 7, 2024

Ah, it's because pkgs/by-name/nv/nv-codec-headers/package.nixdoes getcallPackage`'ed. Yeah, this is bad.

@Aleksanaa
Copy link
Member

That should be ideal though, I guess that's where the "default version" comes from

@flokli
Copy link
Member Author

flokli commented Jul 7, 2024

I don't think this sources defaulting to ./sources.nixshould be an overridable argument.
Same for other bits to produce different variants (like majorVersion).

AFAIK, the only inputs should be packages defined in the package set, and if things get too fancy, they should live outside by-name, to avoid these sudden surprises.

@Aleksanaa
Copy link
Member

So every time I tell people a joke, it becomes something serious (Remember dbus-broker, Huh)

@flokli
Copy link
Member Author

flokli commented Jul 7, 2024

(cc @infinisil )

@Aleksanaa
Copy link
Member

I don't think this sources defaulting to ./sources.nixshould be an overridable argument. Same for other bits to produce different variants (like majorVersion).

AFAIK, the only inputs should be packages defined in the package set, and if things get too fancy, they should live outside by-name, to avoid these sudden surprises.

Agree, this is too non-trivial to put in by-name.

Copy link
Member

@Aleksanaa Aleksanaa left a comment

Choose a reason for hiding this comment

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

We have no rebuilds.

@flokli
Copy link
Member Author

flokli commented Jul 7, 2024

Alright, so let's merge this revert. I'll propose a PR updating pkgs/by-name/README.md, so we get this written down more clearly.

@TomaSajt
Copy link
Contributor

TomaSajt commented Jul 7, 2024

I don' think the main issue is pkgs/by-name.
It's just callPackage being callPackage
You would have encountered the same issue in a package that's not in by-name, since you're supposed to call packages with callPackage anyways.

The fact that the package broke was because they also refactored the code.
The main issue was just having sources being present in the override-able argument list.
(Which, IMO, should have just be placed into the let in block, since you would probably only ever have to override the majorVersion anyways)

@AndersonTorres
Copy link
Member

The main issue was just having sources being present in the override-able argument list.

This was intentional: the source list is treated as part of calling interface.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants