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: dd6261cabec2
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 90be4c2c7875
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Oct 14, 2019

  1. pythonPackages.setuptools: Remove windows files and make reproducible

    - setuptools includes *.exe files by default, but can be excluded with an ENV variable.
    - setuptools was built as an egg, which had reproducibility problems. Instead use a wheel
    
    These are various *.exe and *.xml files used only on windows. setuptools
    includes them by default since it normally creates a single release for
    all operating systems.
    
    This reduces the size from 1020.0K to 801.6K according to `nix-path -sh`.
    
    The egg is a zip file. setuptools leaves timestamps in the egg,
    which makes the build unreproducible. Unfortunately the files aren't
    compressed so the size of setuptools increases to 2.3M from 0.8M
    according to `nix path-info -sh`.
    
    With this change, setuptools is reproducible according to
    
        nix-build -A python37Packages.setuptools --check
    singron authored and FRidh committed Oct 14, 2019
    Copy the full SHA
    90be4c2 View commit details
Showing with 15 additions and 10 deletions.
  1. +15 −10 pkgs/development/python-modules/setuptools/default.nix
25 changes: 15 additions & 10 deletions pkgs/development/python-modules/setuptools/default.nix
Original file line number Diff line number Diff line change
@@ -6,11 +6,17 @@
, unzip
, callPackage
, bootstrapped-pip
, lib
, pipInstallHook
, setuptoolsBuildHook
}:

buildPythonPackage rec {
pname = "setuptools";
version = "41.2.0";
# Because of bootstrapping we don't use the setuptoolsBuildHook that comes with format="setuptools" directly.
# Instead, we override it to remove setuptools to avoid a circular dependency.
# The same is done for pip and the pipInstallHook.
format = "other";

src = fetchPypi {
@@ -19,19 +25,18 @@ buildPythonPackage rec {
sha256 = "66b86bbae7cc7ac2e867f52dc08a6bd064d938bac59dfec71b9b565dd36d6012";
};

# There is nothing to build
dontBuild = true;
nativeBuildInputs = [
bootstrapped-pip
(pipInstallHook.override{pip=null;})
(setuptoolsBuildHook.override{setuptools=null; wheel=null;})
];

nativeBuildInputs = [ bootstrapped-pip ];

installPhase = ''
dst=$out/${python.sitePackages}
mkdir -p $dst
export PYTHONPATH="$dst:$PYTHONPATH"
${python.pythonForBuild.interpreter} setup.py install --prefix=$out
wrapPythonPrograms
preBuild = lib.strings.optionalString (!stdenv.hostPlatform.isWindows) ''
export SETUPTOOLS_INSTALL_WINDOWS_SPECIFIC_FILES=0
'';

pipInstallFlags = [ "--ignore-installed" ];

# Adds setuptools to nativeBuildInputs causing infinite recursion.
catchConflicts = false;