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: replace darwin.apple_sdk_11_0.stdenv with stdenv on darwin #370661

Merged
merged 1 commit into from
Jan 3, 2025

Conversation

wegank
Copy link
Member

@wegank wegank commented Jan 3, 2025

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/)
  • 25.05 Release Notes (or backporting 24.11 and 25.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.

@wegank wegank force-pushed the darwin-stdenv-1 branch 2 times, most recently from 4a01d44 to c73a057 Compare January 3, 2025 16:39
Comment on lines 9204 to 9206
stdenv = if stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64
then overrideSDK darwin.apple_sdk_11_0.stdenv { darwinMinVersion = "10.13"; }
then overrideSDK stdenv { darwinMinVersion = "10.13"; }
else stdenv;
Copy link
Member

Choose a reason for hiding this comment

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

Not necessary.

Copy link
Member Author

Choose a reason for hiding this comment

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

I guess dropping overrideSDK here will result in 500+ rebuilds...

Copy link
Member

Choose a reason for hiding this comment

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

Maybe best to do it in a separate PR and handle the darwin.apple_sdk_11_0.callPackage for it there too.

Copy link
Member Author

Choose a reason for hiding this comment

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

Moved to #370670 and a subsequent PR.

pkgs/top-level/all-packages.nix Outdated Show resolved Hide resolved
Comment on lines 7747 to 7749
stdenv = if stdenv.hostPlatform.isDarwin then stdenv
else if stdenv.cc.isClang then llvmPackages.stdenv
else stdenv;
Copy link
Member

Choose a reason for hiding this comment

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

if stdenv.cc.isClang && !stdenv.hostPlatform.isDarwin? (But also: What on earth is this doing? Probably it can just be dropped?)

Copy link
Member

Choose a reason for hiding this comment

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

Tracked it down to f863703. This is doing nothing useful and can just be dropped.

Copy link
Member Author

@wegank wegank Jan 3, 2025

Choose a reason for hiding this comment

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

I'll do it in #370672. Currently, all Bazel versions fail to build on darwin, I guess some Clang overrides will be needed: https://hydra.nixos.org/eval/1810825?filter=bazel&compare=1810818&full=#tabs-still-fail

@github-actions github-actions 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 3, 2025
@github-actions github-actions bot added 10.rebuild-darwin: 1-10 and removed 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin labels Jan 3, 2025
@github-actions github-actions bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin and removed 10.rebuild-darwin: 1-10 labels Jan 3, 2025
@wegank wegank marked this pull request as ready for review January 3, 2025 18:17
@@ -27,7 +26,6 @@ makeScopeWithSplicing' {
inherit (self) callPackage;
noExtraAttrs = set: lib.attrsets.removeAttrs set [ "extend" "override" "overrideScope" "overrideDerivation" ];
in (noExtraAttrs qt6) // {
inherit stdenv;
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we should add a warning here for a release cycle first. LGTM otherwise.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've reverted this change, since I'm not sure how to properly add a warning here...

Copy link
Member

Choose a reason for hiding this comment

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

I think just stdenv = lib.warn "qt6Packages.stdenv: this is going away!!" stdenv; would do it, as long as there’s nothing else in the tree using it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Indeed, thanks. I wonder what I was worried about...

@wegank wegank force-pushed the darwin-stdenv-1 branch 2 times, most recently from e356f1e to 81f8fea Compare January 3, 2025 19:08
@@ -27,7 +27,10 @@ makeScopeWithSplicing' {
inherit (self) callPackage;
noExtraAttrs = set: lib.attrsets.removeAttrs set [ "extend" "override" "overrideScope" "overrideDerivation" ];
in (noExtraAttrs qt6) // {
inherit stdenv;
stdenv =
lib.warnIf (lib.oldestSupportedReleaseIsAtLeast 2411)
Copy link
Member

@emilazy emilazy Jan 3, 2025

Choose a reason for hiding this comment

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

24.11 still supports 10.12, so this advice is only wholly applicable for 25.05 and higher; I think you want 2505 here.

(OTOH, most Qt‐using applications don’t need the macOS 11 SDK anyway, and those that do should just use apple-sdk_11 directly, even on 24.11. But it’s only a month’s difference.)

Copy link
Member Author

Choose a reason for hiding this comment

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

I think 2411 actually works, because for 24.11 branches lib.trivial.oldestSupportedRelease should be 2405...

Copy link
Member

Choose a reason for hiding this comment

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

I guess I don’t understand oldestSupportedReleaseIsAtLeast. Isn’t this just true unconditionally, even right now? I thought the idea was that you’d write something that becomes true after release so that unstable doesn’t throw up warnings that can’t be fixed on supported stable versions (so I assumed 2505 was the right thing).

Copy link
Member Author

Choose a reason for hiding this comment

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

That's true, I'll just put a lib.warn.

@emilazy emilazy merged commit 4491046 into NixOS:master Jan 3, 2025
22 checks passed
@wegank wegank deleted the darwin-stdenv-1 branch January 3, 2025 20:12
@emilazy
Copy link
Member

emilazy commented Jan 3, 2025

Seems like there’s a few more of these references remaining in all-packages.nix and elsewhere (and not just because of stuff that needs to go to staging)? I ran into one while preparing another clean‐up PR. (Happy to deal with them myself since I have like ~100 commits for this kind of thing queued up anyway.)

@@ -62,8 +62,7 @@ buildPythonPackage rec {
hash = "sha256-slBJleeDi0mCVThty4NUX4M9vaCLV+E8rnp1Ab77TmE=";
};

stdenv =
if python.stdenv.hostPlatform.isDarwin then darwin.apple_sdk_11_0.stdenv else python.stdenv;
stdenv = python.stdenv;
Copy link
Member

Choose a reason for hiding this comment

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

BTW, I think these are no‐ops (probably should have caught them during review).

@emilazy
Copy link
Member

emilazy commented Jan 4, 2025

We need to revert the Qt thing because of the scope (e.g. qt6Packages.callPackage with a stdenv argument).

@infinisil It looks like GHA eval breaks compatibility with the critical ofborg feature of failing the eval if anything in Nixpkgs triggers warnings. Unless I’m misunderstanding something we really need to get that fixed now that ofborg is gone.

@wegank
Copy link
Member Author

wegank commented Jan 4, 2025

Would something like this help? Though it looks terrible...

{
  stdenv = lib.warn "qt6Packages.stdenv is deprecated. Use stdenv instead." stdenv;
}
// makeScopeWithSplicing' {
  ...
}

@emilazy
Copy link
Member

emilazy commented Jan 4, 2025

Yeah, that might be a good idea; I’ll test it. Or we could just remove it entirely under the assumption that most people are getting it from the scope.

(These warnings are actually channel blockers, so this is a pretty huge CI footgun… Sorry for not realizing it when I suggested it.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: python 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.

2 participants