Unverified Commit 93667cf8 authored by Arnout Engelen's avatar Arnout Engelen Committed by GitHub
Browse files

libbytesize: fix unreproducible builds by compiling .pyc files in the build phase (#395486)

parents c45ef5ee 36d16142
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -60,6 +60,9 @@ stdenv.mkDerivation (finalAttrs: {
  postInstall = ''
    substituteInPlace $out/${python3Packages.python.sitePackages}/bytesize/bytesize.py \
      --replace-fail 'CDLL("libbytesize.so.1")' "CDLL('$out/lib/libbytesize.so.1')"

    # Force compilation of .pyc files to make them deterministic
    ${python3Packages.python.interpreter} -m compileall $out/${python3Packages.python.sitePackages}/bytesize
  '';

  pythonImportsCheck = [ "bytesize" ];