Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 16ffc74a3239
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 6f38c93e3c08
Choose a head ref
  • 6 commits
  • 6 files changed
  • 1 contributor

Commits on Jan 31, 2020

  1. stdenv: make darwin builds reproducable

    Fixes #21629
    
    Passing these extra linker flags removes both the semi-random uuid
    included in most binaries as well as making the sdk version consistent
    instead of based on the current os version.
    
        Load command 8
             cmd LC_UUID
         cmdsize 24
            uuid 70FAF921-5DC8-371C-B814-4F121FADFDF4
    
        Load command 9
              cmd LC_VERSION_MIN_MACOSX
          cmdsize 16
          version 10.12
              sdk 10.13
    
    The -macosx_version_min flag isn't strictly necessary since that's
    already handled by MACOSX_DEPLOYMENT_TARGET.
    LnL7 committed Jan 31, 2020

    Verified

    This commit was signed with the committer’s verified signature.
    mkg20001 Maciej Krüger
    Copy the full SHA
    a826b49 View commit details
  2. Copy the full SHA
    6567823 View commit details
  3. Copy the full SHA
    9b57984 View commit details
  4. cmake: remove CMAKE_OSX_DEPLOYMENT_TARGET overrides

    We _do_ want minimum versions in our packages.
    LnL7 committed Jan 31, 2020
    Copy the full SHA
    b984c22 View commit details
  5. cmake: move CMAKE_OSX_ARCHITECTURES out of the stdenv

    This was initially introduced in 92188d9,
    not clear how relevant this still is but i686 isn't supported anymore so
    disable it explicitly.
    LnL7 committed Jan 31, 2020
    Copy the full SHA
    68513e4 View commit details
  6. Merge pull request #77632 from LnL7/darwin-macos-version-min

    stdenv: make darwin builds reproducable
    LnL7 authored Jan 31, 2020
    Copy the full SHA
    6f38c93 View commit details
7 changes: 3 additions & 4 deletions pkgs/development/tools/build-managers/cmake/setup-hook.sh
Original file line number Diff line number Diff line change
@@ -50,13 +50,12 @@ cmakeConfigurePhase() {
# because we usually do not package the framework
cmakeFlags="-DCMAKE_FIND_FRAMEWORK=last $cmakeFlags"

# on macOS i686 was only relevant for 10.5 or earlier.
cmakeFlags="-DCMAKE_OSX_ARCHITECTURES=x86_64 $cmakeFlags"

# we never want to use the global macOS SDK
cmakeFlags="-DCMAKE_OSX_SYSROOT= $cmakeFlags"

# disable OSX deployment target
# we don't want our binaries to have a "minimum" OSX version
cmakeFlags="-DCMAKE_OSX_DEPLOYMENT_TARGET= $cmakeFlags"

# correctly detect our clang compiler
cmakeFlags="-DCMAKE_POLICY_DEFAULT_CMP0025=NEW $cmakeFlags"

5 changes: 1 addition & 4 deletions pkgs/development/tools/misc/ccls/default.nix
Original file line number Diff line number Diff line change
@@ -15,10 +15,7 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ cmake ];
buildInputs = with llvmPackages; [ clang-unwrapped llvm rapidjson ];

cmakeFlags = [
"-DCCLS_VERSION=${version}"
"-DCMAKE_OSX_DEPLOYMENT_TARGET=10.12"
];
cmakeFlags = [ "-DCCLS_VERSION=${version}" ];

preConfigure = ''
cmakeFlagsArray+=(-DCMAKE_CXX_FLAGS="-fvisibility=hidden -fno-rtti")
1 change: 0 additions & 1 deletion pkgs/development/tools/misc/cquery/default.nix
Original file line number Diff line number Diff line change
@@ -26,7 +26,6 @@ stdenv.mkDerivation {
cmakeFlags = [
"-DSYSTEM_CLANG=ON"
"-DCLANG_CXX=ON"
"-DCMAKE_OSX_DEPLOYMENT_TARGET=10.12"
];

shell = runtimeShell;
7 changes: 6 additions & 1 deletion pkgs/os-specific/darwin/apple-sdk/default.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
{ stdenv, fetchurl, xar, cpio, pkgs, python3, pbzx, lib }:

let version = "10.12"; in

# Ensure appleSdkVersion is up to date.
assert stdenv.isDarwin -> stdenv.appleSdkVersion == version;

let
# sadly needs to be exported because security_tool needs it
sdk = stdenv.mkDerivation rec {
version = "10.12";
pname = "MacOS_SDK";
inherit version;

# This URL comes from https://swscan.apple.com/content/catalogs/others/index-10.12.merged-1.sucatalog, which we found by:
# 1. Google: site:swscan.apple.com and look for a name that seems appropriate for your version
1 change: 0 additions & 1 deletion pkgs/servers/sql/mysql/8.0.x.nix
Original file line number Diff line number Diff line change
@@ -31,7 +31,6 @@ self = stdenv.mkDerivation rec {
outputs = [ "out" "static" ];

cmakeFlags = [
"-DCMAKE_OSX_DEPLOYMENT_TARGET=10.12" # For std::shared_timed_mutex.
"-DCMAKE_SKIP_BUILD_RPATH=OFF" # To run libmysql/libmysql_api_test during build.
"-DFORCE_UNSUPPORTED_COMPILER=1" # To configure on Darwin.
"-DWITH_ROUTER=OFF" # It may be packaged separately.
26 changes: 16 additions & 10 deletions pkgs/stdenv/darwin/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{ lib
, localSystem, crossSystem, config, overlays, crossOverlays ? []

# The version of darwin.apple_sdk used for sources provided by apple.
, appleSdkVersion ? "10.12"
# Minimum required macOS version, used both for compatibility as well as reproducability.
, macosVersionMin ? "10.12"
# Allow passing in bootstrap files directly so we can test the stdenv bootstrap process when changing the bootstrap tools
, bootstrapFiles ? let
fetch = { file, sha256, executable ? true }: import <nix/fetchurl.nix> {
@@ -28,15 +31,19 @@ let
];
in rec {
commonPreHook = ''
export NIX_ENFORCE_PURITY="''${NIX_ENFORCE_PURITY-1}"
export NIX_ENFORCE_NO_NATIVE="''${NIX_ENFORCE_NO_NATIVE-1}"
export NIX_ENFORCE_NO_NATIVE=''${NIX_ENFORCE_NO_NATIVE-1}
export NIX_ENFORCE_PURITY=''${NIX_ENFORCE_PURITY-1}
export NIX_IGNORE_LD_THROUGH_GCC=1
stripAllFlags=" " # the Darwin "strip" command doesn't know "-s"
export MACOSX_DEPLOYMENT_TARGET=10.12
export SDKROOT=
export CMAKE_OSX_ARCHITECTURES=x86_64
# Ensure consistent LC_VERSION_MIN_MACOSX and remove LC_UUID.
export MACOSX_DEPLOYMENT_TARGET=${macosVersionMin}
export NIX_LDFLAGS+=" -macosx_version_min ${macosVersionMin} -sdk_version ${appleSdkVersion} -no_uuid"
# Workaround for https://openradar.appspot.com/22671534 on 10.11.
export gl_cv_func_getcwd_abort_bug=no
stripAllFlags=" " # the Darwin "strip" command doesn't know "-s"
'';

bootstrapTools = derivation {
@@ -130,8 +137,7 @@ in rec {
__extraImpureHostDeps = commonImpureHostDeps;

extraAttrs = {
inherit platform;
parent = last;
inherit macosVersionMin appleSdkVersion platform;
};
overrides = self: super: (overrides self super) // { fetchurl = thisStdenv.fetchurlBoot; };
};
@@ -400,9 +406,9 @@ in rec {
extraBuildInputs = [ pkgs.darwin.CF ];

extraAttrs = {
inherit platform bootstrapTools;
libc = pkgs.darwin.Libsystem;
libc = pkgs.darwin.Libsystem;
shellPackage = pkgs.bash;
inherit macosVersionMin appleSdkVersion platform bootstrapTools;
};

allowedRequisites = (with pkgs; [