Skip to content

xcbuild: move top level override into package.nix - #485704

Merged
MattSturgeon merged 1 commit into
NixOS:masterfrom
qweered:xcbuild-remove-override
Feb 3, 2026
Merged

xcbuild: move top level override into package.nix#485704
MattSturgeon merged 1 commit into
NixOS:masterfrom
qweered:xcbuild-remove-override

Conversation

@qweered

@qweered qweered commented Jan 31, 2026

Copy link
Copy Markdown
Contributor

This is a step towards #454525, which will help enable checking for additional by-name directories (e.g. Python) in nixpkgs-vet.

Things done

@qweered
qweered requested a review from mdaniels5757 January 31, 2026 19:16
@nixpkgs-ci nixpkgs-ci 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 Jan 31, 2026
@mdaniels5757
mdaniels5757 force-pushed the xcbuild-remove-override branch from 0dc22bf to 9487586 Compare February 1, 2026 01:06
@mdaniels5757 mdaniels5757 changed the title xcbuild: move top level override into package.nixi xcbuild: move top level override into package.nix Feb 1, 2026
@nixpkgs-ci nixpkgs-ci Bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Feb 1, 2026
@nixpkgs-ci nixpkgs-ci Bot added 12.approvals: 2 This PR was reviewed and approved by two persons. and removed 12.approvals: 1 This PR was reviewed and approved by one person. labels Feb 2, 2026
ninja,
stdenv,
# xcbuild is included in the SDK. Avoid an infinite recursion by using a bootstrap stdenv
stdenv' ? if stdenv.hostPlatform.isDarwin then darwin.bootstrapStdenv else stdenv,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

stdenv' seems a bit riskier than other '-suffix params, but being able to override is still valuable.

I could envision someone deciding they want to add a pkgs.stdenv' at some point. Although I hope it is as unlikely as I think it is 😁

@gepbird gepbird Feb 3, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@MattSturgeon This was added to address #453948 (comment), more info on this pattern at #474456 (comment).

I'm still curious about other people's opinion on it, if we should apply this pattern at more places and in which scenarios, currently these made sense to me:

  • conditionally overriding stdenv or other dependency that is hard to "patch" -> ?
  • aliasing a package version (e.g. ffmpeg = ffmpeg_7) -> let in
  • enabling/disabling features of a package (e.g. codec2' = codec2.override { freedvSupport = true; } -> probably ? but maybe let in is enough?
  • extending package sets (e.g. beamPackages = beam27Packages.extend (self: super: { elixir = elixir_1_18; }); -> probably let in but maybe ??

stdenv' seems a bit riskier than other '-suffix params, but being able to override is still valuable.

I could envision someone deciding they want to add a pkgs.stdenv' at some point. Although I hope it is as unlikely as I think it is 😁

Thankfully ' at the top-level is rare, the only instance is a function rather than a package:

nix-repl> lib.filter (lib.hasInfix "'") (lib.attrNames pkgs) 
[ "makeScopeWithSplicing'" ]

If we want to be extra safe maybe this could be document not adding top-level packages with ' and/or add a nixpkgs-vet rule, but I don't think we would see new top level package's anyway.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah, that's essentially the same thought process I had. ' seems essentially impossible for package-specific names, and only slightly more likely for "hot" names like stdenv.

If we want to be extra safe maybe this could be document not adding top-level packages with ' and/or add a nixpkgs-vet rule, but I don't think we would see new top level package's anyway.

I agree, adding top-level ' names to the package set would be a big smell. I would get behind formalising it as guidance if someone took the time to write up a PR

Not strictly necessary, though. Clearly it's gone without saying until now 😁

@MattSturgeon
MattSturgeon added this pull request to the merge queue Feb 3, 2026
Merged via the queue into NixOS:master with commit 21ffc00 Feb 3, 2026
34 of 36 checks passed
@qweered
qweered deleted the xcbuild-remove-override branch February 19, 2026 01:02
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. 12.approvals: 2 This PR was reviewed and approved by two persons.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants