From 118a214ac5f31abe7491d371f5153292fbcb939a Mon Sep 17 00:00:00 2001 From: Randy Eckenrode Date: Thu, 3 Oct 2024 07:47:30 -0400 Subject: [PATCH] xcbuild: warn when someone tries to override `sdkVer` xcbuild determines the SDK dynamically, so overriding the `sdkVer` no longer works. If packages want to change the SDK, they need to add one of the SDK packages to their inputs. --- pkgs/by-name/xc/xcbuild/package.nix | 31 ++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/xc/xcbuild/package.nix b/pkgs/by-name/xc/xcbuild/package.nix index 8fc3d74286f5..3f2560caa203 100644 --- a/pkgs/by-name/xc/xcbuild/package.nix +++ b/pkgs/by-name/xc/xcbuild/package.nix @@ -10,12 +10,41 @@ stdenv, zlib, - # These arguments are obsolete but required to avoid evaluation errors for now + # These arguments are obsolete but required to avoid evaluation errors (for now). CoreGraphics ? null, CoreServices ? null, ImageIO ? null, + + # These are deprecated and do nothing. They’re needed for compatibility and will + # warn eventually once in-tree uses are cleaned up. + xcodePlatform ? null, + xcodeVer ? null, + sdkVer ? null, + productBuildVer ? null, }: +let + attrs = { + inherit + xcodePlatform + xcodeVer + sdkVer + productBuildVer + ; + }; +in +assert lib.warnIf (lib.any (attr: attr != null) (lib.attrValues attrs)) '' + The following arguments are deprecated and do nothing: ${ + lib.concatStringsSep ", " (lib.attrNames (lib.filterAttrs (_: value: value != null) attrs)) + } + + xcbuild will dynamically pick up the SDK and SDK version based + on the SDK used in nixpkgs. If you need to use a different SDK, + add the appropriate SDK to your package’s `buildInputs`. + + See the stdenv documentation for how to use `apple-sdk`. +'' true; + let googletest = fetchFromGitHub { owner = "google";