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

Darwin stdenv bump LLVM to 11 #126411

Merged
merged 54 commits into from
Nov 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
d4f8b6b
stdenv: update darwin bootstrap tools for llvm11
LnL7 Jun 9, 2021
83f1f89
xnu: Fix python3 patch
toonn Apr 13, 2021
7ce2c4c
darwin.Libsystem: Patch TargetConditionals.h
toonn Apr 21, 2021
84a2d7f
darwin.stdenv: Update to LLVM 11 and clang 11.1.0
toonn Apr 15, 2021
c1e7403
all-packages: Define LLVM 11 as the default for Darwin
toonn Apr 19, 2021
3f99f97
stdenv: libcxxabi dropped standalone in favor of useLLVM
toonn Apr 19, 2021
acb3b40
cmake: Temporarily pass flags
toonn Apr 20, 2021
e0c636a
darwin.CF: Include missing TARGET_OS_* defines
toonn Apr 26, 2021
9827cc1
darwin.CF: Drop clang 7 workaround
toonn Apr 27, 2021
25962d6
darwin.CF: Add pre-/postBuild hooks to buildPhase
SuperSandro2000 Apr 30, 2021
be88e55
bootstrap-tools: Introduce getLib for lib outputs
toonn Jun 1, 2021
7501da7
stdenv: Darwin no longer needs 10.11 workaround
toonn Jun 10, 2021
0a678b4
libtiff: Disable OpenGL entirely for Darwin
toonn Jul 4, 2021
dcc5734
cups: Include TargetConditionals.h on Darwin
toonn Jun 27, 2021
0571d21
mariadb: Avoid building with clang-11
toonn Jul 4, 2021
aded7c9
portaudio: Disable new clang-11 warning
toonn Jul 6, 2021
af78560
libtiff: Reenable OpenGL support on Darwin
toonn Jul 6, 2021
3d67386
libcxxabi: Use standalone instead of expression
toonn Jul 6, 2021
9e9782a
portaudio: Fix version mashup
toonn Jul 7, 2021
2ac563c
cups: Change condition so patch won't remain forever
toonn Jul 7, 2021
2260084
sphinx: Patch source file for normalization
toonn Jul 12, 2021
1bf996c
Qt5: WebEngine turn off warning causing errors
toonn Jul 12, 2021
193202c
mariadb: Rename "version" files for LLVM 11
toonn Jul 12, 2021
4e54a20
Qt5: WebEngine build with old LLVM
toonn Jul 12, 2021
48511c3
groonga: Fix LLVM 11 build by removing version file
toonn Jul 14, 2021
6e8058f
sphinx: Disable test_inspect_main_url on Darwin
toonn Jul 19, 2021
a831970
sphinx: Disable most networking tests on Darwin
toonn Jul 20, 2021
001b24c
cups: Apply patch unconditionally
toonn Jul 20, 2021
f0d2130
Libc: stdlib uses undefined TARGET_OS_EMBEDDED
toonn Jul 26, 2021
8808d7b
Libc: Define target instead of including
toonn Jul 27, 2021
b813413
Libc: Define target in stdio too
toonn Jul 27, 2021
ae6aeb1
wheel: Fix hash mismatch due to filesystem normalization
toonn Jul 28, 2021
2d58a98
pulseaudio: Remove /usr/include impurity on Darwin
toonn Aug 3, 2021
fb48ffb
pulseaudio: Drop Apple SDK dependency
toonn Aug 11, 2021
0cc7659
pulseaudio: Stop passing sdk argument
toonn Aug 11, 2021
0456f72
libtiff: fix case-insensitive build
r-burns Sep 23, 2021
205fd0f
sphinx: Update FOD source hash
toonn Sep 28, 2021
ae0def4
cryptography: Drop impure host deps
toonn Oct 11, 2021
65e530a
cffi: Drop unnecessary libm substitutes
toonn Oct 11, 2021
bd455d1
cffi: Reenable checks to reveal Darwin problem
toonn Oct 11, 2021
039825b
cffi: Include pkg-config
toonn Oct 11, 2021
0aaca4b
cffi: Silence warning causing test failures
toonn Oct 11, 2021
c6de599
wheel: Normalize the filename with NFC
toonn Oct 13, 2021
2c5c8ce
sphinx: Normalize the filename with NFC
toonn Oct 13, 2021
9343b9c
release.nix: Re-enable full stdenv bootstrap test
toonn Oct 22, 2021
d22ee62
libtiff: Clarify patch comments
toonn Oct 22, 2021
b1122c2
Libc: Merge TARGET_OS_EMBEDDED patches
toonn Oct 22, 2021
b91a3f7
mariadb: Add comment to clarify version file renames
toonn Oct 22, 2021
4cabdf3
groonga: Switch to autoreconfHook
toonn Oct 22, 2021
799a69c
cups: Only apply patch for appropriate version
toonn Oct 25, 2021
efb10ab
llvmPackages_11.libcxxabi: More precise libunwind inclusion
toonn Nov 15, 2021
5442a41
llvmPackages_12.libcxxabi: Align with 11 libcxxabi
toonn Nov 15, 2021
f61c760
llvmPackages_13.libcxxabi: Align with 11 libcxxabi
toonn Nov 23, 2021
ecce906
stdenv: Pass standalone argument for libcxxabi
toonn Nov 23, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions pkgs/development/compilers/llvm/11/libcxxabi/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{ lib, stdenv, llvm_meta, cmake, fetch, libcxx, libunwind, llvm, version
, enableShared ? !stdenv.hostPlatform.isStatic
, standalone ? stdenv.hostPlatform.useLLVM or false
, withLibunwind ? !stdenv.isDarwin && !stdenv.isFreeBSD && !stdenv.hostPlatform.isWasm
Copy link
Member

Choose a reason for hiding this comment

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

When changing LLVM files like this, please make the change to all appropriate versions, or the changes will be lost next time we upgrade.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've done this for LLVM 12 and 13 now. Older LLVM posed some challenges so I'd rather skip them. The only place this is in use so far is the Darwin stdenv and we wouldn't use older LLVMs for that anyway, going forward.

I do want to note that this is basically a cargo-cult of the changes for LLVM 7. I did run into this problem here but I can't find a way to reproduce it. Even the example from the commit making the changes for LLVM 7 (fece3eb) doesn't help because I cannot figure out how to generate <hash>-libc++-<version>, note the ++ rather than xx.

Copy link
Member

Choose a reason for hiding this comment

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

Older LLVM posed some challenges so I'd rather skip them.

That's unfortunate, but the main thing is that it's in the most recent version, so it gets carried forward when 13 is copied to 14, etc, so I think it's okay.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Talked to @thefloweringash about this. The reason I couldn't generate a path with libc++ is that this changed in a refactor...

}:

stdenv.mkDerivation {
Expand Down Expand Up @@ -29,10 +31,11 @@ stdenv.mkDerivation {
];

nativeBuildInputs = [ cmake ];
buildInputs = lib.optional (!stdenv.isDarwin && !stdenv.isFreeBSD && !stdenv.hostPlatform.isWasm) libunwind;
buildInputs = lib.optional withLibunwind libunwind;

cmakeFlags = lib.optionals (stdenv.hostPlatform.useLLVM or false) [
cmakeFlags = lib.optionals standalone [
"-DLLVM_ENABLE_LIBCXX=ON"
] ++ lib.optionals (standalone && withLibunwind) [
"-DLIBCXXABI_USE_LLVM_UNWINDER=ON"
] ++ lib.optionals stdenv.hostPlatform.isWasm [
"-DLIBCXXABI_ENABLE_THREADS=OFF"
Expand Down
8 changes: 5 additions & 3 deletions pkgs/development/compilers/llvm/12/libcxxabi/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{ lib, stdenv, llvm_meta, cmake, python3, fetch, libcxx, libunwind, llvm, version
, enableShared ? !stdenv.hostPlatform.isStatic
, standalone ? stdenv.hostPlatform.useLLVM or false
, withLibunwind ? !stdenv.isDarwin && !stdenv.isFreeBSD && !stdenv.hostPlatform.isWasm
}:

stdenv.mkDerivation {
Expand Down Expand Up @@ -28,9 +30,9 @@ stdenv.mkDerivation {
];

nativeBuildInputs = [ cmake python3 ];
buildInputs = lib.optional (!stdenv.isDarwin && !stdenv.isFreeBSD && !stdenv.hostPlatform.isWasm) libunwind;
buildInputs = lib.optional withLibunwind libunwind;

cmakeFlags = lib.optionals (stdenv.hostPlatform.useLLVM or false) [
cmakeFlags = lib.optionals standalone [
"-DLLVM_ENABLE_LIBCXX=ON"
"-DLIBCXXABI_USE_LLVM_UNWINDER=ON"
] ++ lib.optionals stdenv.hostPlatform.isWasm [
Expand All @@ -47,7 +49,7 @@ stdenv.mkDerivation {
# the magic combination of necessary CMake variables
# if you fancy a try, take a look at
# https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/RPATH-handling
install_name_tool -id $out/$file $file
${stdenv.cc.targetPrefix}install_name_tool -id $out/$file $file
done
make install
install -d 755 $out/include
Expand Down
10 changes: 6 additions & 4 deletions pkgs/development/compilers/llvm/13/libcxxabi/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{ lib, stdenv, llvm_meta, cmake, python3, src, libunwind, version
{ lib, stdenv, llvm_meta, cmake, python3, src, libunwind, libcxx, version
, enableShared ? !stdenv.hostPlatform.isStatic
, libcxx
, standalone ? stdenv.hostPlatform.useLLVM or false
, withLibunwind ? !stdenv.isDarwin && !stdenv.isFreeBSD && !stdenv.hostPlatform.isWasm
}:

stdenv.mkDerivation rec {
Expand All @@ -23,12 +24,13 @@ stdenv.mkDerivation rec {
];

nativeBuildInputs = [ cmake python3 ];
buildInputs = lib.optional (!stdenv.isDarwin && !stdenv.isFreeBSD && !stdenv.hostPlatform.isWasm) libunwind;
buildInputs = lib.optional withLibunwind libunwind;

cmakeFlags = [
"-DLIBCXXABI_LIBCXX_INCLUDES=${libcxx.dev}/include/c++/v1"
] ++ lib.optionals (stdenv.hostPlatform.useLLVM or false) [
] ++ lib.optionals standalone [
"-DLLVM_ENABLE_LIBCXX=ON"
] ++ lib.optionals (standalone && withLibunwind) [
"-DLIBCXXABI_USE_LLVM_UNWINDER=ON"
] ++ lib.optionals stdenv.hostPlatform.isWasm [
"-DLIBCXXABI_ENABLE_THREADS=OFF"
Expand Down
21 changes: 18 additions & 3 deletions pkgs/development/libraries/libtiff/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
, libjpeg
, xz
, zlib

, Cocoa
, GLUT
, libGL
, libGLU
}:

#FIXME: fix aarch64-darwin build and get rid of ./aarch64-darwin.nix
Expand All @@ -21,8 +26,17 @@ stdenv.mkDerivation rec {
sha256 = "1j3snghqjbhwmnm5vz3dr1zm68dj15mgbx1wqld7vkl7n2nfaihf";
};

# FreeImage needs this patch
patches = [ ./headers.patch ];
patches = [
toonn marked this conversation as resolved.
Show resolved Hide resolved
# FreeImage needs this patch
./headers.patch
# libc++abi 11 has an `#include <version>`, this picks up files name
# `version` in the project's include paths
./rename-version.patch
toonn marked this conversation as resolved.
Show resolved Hide resolved
];

postPatch = ''
mv VERSION VERSION.txt
'';

outputs = [ "bin" "dev" "dev_private" "out" "man" "doc" ];

Expand All @@ -38,7 +52,8 @@ stdenv.mkDerivation rec {

propagatedBuildInputs = [ libjpeg xz zlib ]; #TODO: opengl support (bogus configure detection)

buildInputs = [ libdeflate ]; # TODO: move all propagatedBuildInputs to buildInputs.
buildInputs = [ libdeflate ] # TODO: move all propagatedBuildInputs to buildInputs.
++ lib.optionals (stdenv.isDarwin) [ Cocoa GLUT libGL libGLU ];

enableParallelBuilding = true;

Expand Down
20 changes: 20 additions & 0 deletions pkgs/development/libraries/libtiff/rename-version.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
--- a/Makefile.am
+++ b/Makefile.am
@@ -34,7 +34,7 @@ docfiles = \
README.md \
RELEASE-DATE \
TODO \
- VERSION
+ VERSION.txt

EXTRA_DIST = \
cmake \
@@ -61,7 +61,7 @@ SUBDIRS = port libtiff tools build contrib test man html

release:
(rm -f $(top_srcdir)/RELEASE-DATE && echo $(LIBTIFF_RELEASE_DATE) > $(top_srcdir)/RELEASE-DATE)
- (rm -f $(top_srcdir)/VERSION && echo $(LIBTIFF_VERSION) > $(top_srcdir)/VERSION)
+ (rm -f $(top_srcdir)/VERSION.txt && echo $(LIBTIFF_VERSION) > $(top_srcdir)/VERSION.txt)
(rm -f $(top_srcdir)/libtiff/tiffvers.h && sed 's,LIBTIFF_VERSION,$(LIBTIFF_VERSION),;s,LIBTIFF_RELEASE_DATE,$(LIBTIFF_RELEASE_DATE),' $(top_srcdir)/libtiff/tiffvers.h.in > $(top_srcdir)/libtiff/tiffvers.h)

pkgconfigdir = $(libdir)/pkgconfig
6 changes: 2 additions & 4 deletions pkgs/development/libraries/portaudio/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

stdenv.mkDerivation rec {
pname = "portaudio";
version = "190700_20210406";
version = "190700_20210406";

src = fetchurl {
url = "http://files.portaudio.com/archives/pa_stable_v${version}.tgz";
Expand All @@ -23,9 +23,7 @@ stdenv.mkDerivation rec {

configureFlags = [ "--disable-mac-universal" "--enable-cxx" ];

postConfigure = ''
substituteInPlace Makefile --replace "-Werror" ""
'';
NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=nullability-inferred-on-nested-type -Wno-error=nullability-completeness-on-arrays -Wno-error=implicit-const-int-float-conversion";

propagatedBuildInputs = lib.optionals stdenv.isDarwin [ AudioUnit AudioToolbox CoreAudio CoreServices Carbon ];

Expand Down
1 change: 1 addition & 0 deletions pkgs/development/libraries/qt-5/5.12/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ let
inherit (darwin.apple_sdk.libs) sandbox;
inherit (darwin.apple_sdk.frameworks) ApplicationServices AVFoundation Foundation ForceFeedback GameController AppKit
ImageCaptureCore CoreBluetooth IOBluetooth CoreWLAN Quartz Cocoa LocalAuthentication;
stdenv = stdenvActual;
};
qtwebglplugin = callPackage ../modules/qtwebglplugin.nix {};
qtwebkit = callPackage ../modules/qtwebkit.nix {
Expand Down
2 changes: 2 additions & 0 deletions pkgs/development/libraries/qt-5/modules/qtwebengine.nix
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ qtModule {
# it fails when compiled with -march=sandybridge https://github.com/NixOS/nixpkgs/pull/59148#discussion_r276696940
# TODO: investigate and fix properly
"-march=westmere"
] ++ lib.optionals stdenv.cc.isClang [
"-Wno-elaborated-enum-base"
] ++ lib.optionals stdenv.isDarwin [
"-DMAC_OS_X_VERSION_MAX_ALLOWED=MAC_OS_X_VERSION_10_12"
"-DMAC_OS_X_VERSION_MIN_REQUIRED=MAC_OS_X_VERSION_10_12"
Expand Down
25 changes: 11 additions & 14 deletions pkgs/development/python-modules/cffi/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{ lib, stdenv, buildPythonPackage, isPyPy, fetchPypi, libffi, pycparser, pytestCheckHook }:
{ lib, stdenv, buildPythonPackage, isPyPy, fetchPypi, pytestCheckHook,
libffi, pkg-config, pycparser
}:

if isPyPy then null else buildPythonPackage rec {
pname = "cffi";
Expand All @@ -13,27 +15,22 @@ if isPyPy then null else buildPythonPackage rec {

buildInputs = [ libffi ];

nativeBuildInputs = [ pkg-config ];

propagatedBuildInputs = [ pycparser ];

# On Darwin, the cffi tests want to hit libm a lot, and look for it in a global
# impure search path. It's obnoxious how much repetition there is, and how difficult
# it is to get it to search somewhere else (since we do actually have a libm symlink in libSystem)
prePatch = lib.optionalString stdenv.isDarwin ''
substituteInPlace testing/cffi0/test_parsing.py \
--replace 'lib_m = "m"' 'lib_m = "System"' \
--replace '"libm" in name' '"libSystem" in name'
substituteInPlace testing/cffi0/test_unicode_literals.py --replace 'lib_m = "m"' 'lib_m = "System"'
substituteInPlace testing/cffi0/test_zdistutils.py --replace 'self.lib_m = "m"' 'self.lib_m = "System"'
substituteInPlace testing/cffi1/test_recompiler.py --replace 'lib_m = "m"' 'lib_m = "System"'
substituteInPlace testing/cffi0/test_function.py --replace "lib_m = 'm'" "lib_m = 'System'"
substituteInPlace testing/cffi0/test_verify.py --replace "lib_m = ['m']" "lib_m = ['System']"
# Remove setup.py impurities
substituteInPlace setup.py --replace "'-iwithsysroot/usr/include/ffi'" ""
substituteInPlace setup.py --replace "'/usr/include/ffi'," ""
substituteInPlace setup.py --replace '/usr/include/libffi' '${lib.getDev libffi}/include'
'';

# The tests use -Werror but with python3.6 clang detects some unreachable code.
NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang
"-Wno-unused-command-line-argument -Wno-unreachable-code";
"-Wno-unused-command-line-argument -Wno-unreachable-code -Wno-c++11-narrowing";

doCheck = !stdenv.hostPlatform.isMusl && !stdenv.isDarwin; # TODO: Investigate
doCheck = !stdenv.hostPlatform.isMusl;
Copy link
Member

Choose a reason for hiding this comment

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

Excellent!

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this broke aarch64-darwin:

_____________ ERROR collecting testing/cffi1/test_parse_c_type.py ______________
testing/cffi1/test_parse_c_type.py:74: in <module>
    def fetch_constant_five(p):
cffi/api.py:396: in callback_decorator_wrap
    return self._backend.callback(cdecl, python_callable,
E   MemoryError: Cannot allocate write+execute memory for ffi.callback(). You might be running on a system that prevents this. For more information, see https://cffi.readthedocs.io/en/latest/using.html#callbacks

Copy link
Contributor

Choose a reason for hiding this comment

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


checkInputs = [ pytestCheckHook ];

Expand Down
4 changes: 0 additions & 4 deletions pkgs/development/python-modules/cryptography/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,6 @@ buildPythonPackage rec {
py.test ${pytestFlags} tests
'';

# IOKit's dependencies are inconsistent between OSX versions, so this is the best we
# can do until nix 1.11's release
__impureHostDeps = [ "/usr/lib" ];

Copy link
Member

Choose a reason for hiding this comment

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

Woohoo!

meta = with lib; {
description = "A package which provides cryptographic recipes and primitives";
longDescription = ''
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
From 181617387841b695ee77b162babf9fb177002fcb Mon Sep 17 00:00:00 2001
From: toonn <toonn@toonn.io>
Date: Mon, 20 Sep 2021 11:39:46 +0200
Subject: [PATCH] test-images: Use normalization equivalent character
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

One of the test images used a combining character `ä` that can be
encoded multiple ways. This means the file's name can end up encoded
differently depending on whether/which normal form the filesystem uses.

For Nix this causes a different hash for a FOD depending on the
filesystem where it is evaluated. This is problematic because hashes
fail to match up when evaluating the FOD across multiple platforms.
---
tests/roots/test-images/index.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/roots/test-images/index.rst b/tests/roots/test-images/index.rst
index 14a2987..219842e 100644
--- a/tests/roots/test-images/index.rst
+++ b/tests/roots/test-images/index.rst
@@ -13,7 +13,7 @@ test-image

The caption of img

-.. image:: testimäge.png
+.. image:: testimæge.png

.. image:: rimg.png
:target: https://www.sphinx-doc.org/
--
2.17.2 (Apple Git-113)

32 changes: 30 additions & 2 deletions pkgs/development/python-modules/sphinx/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{ lib
{ stdenv
, lib
, buildPythonPackage
, pythonOlder
, fetchFromGitHub
Expand Down Expand Up @@ -35,7 +36,13 @@ buildPythonPackage rec {
owner = "sphinx-doc";
repo = pname;
rev = "v${version}";
sha256 = "1i38n5bxqiycjwmiv9dl72r3f5ks4zmif30znqg8zilclbx6g16x";
sha256 = "129x3kljxq7sbg5cc12z3cmjsili6l3qrsxllkx97id1a85f7zmj";
extraPostFetch = ''
cd $out
mv tests/roots/test-images/testimäge.png \
tests/roots/test-images/testimæge.png
patch -p1 < ${./0001-test-images-Use-normalization-equivalent-character.patch}
'';
};

propagatedBuildInputs = [
Expand Down Expand Up @@ -76,6 +83,27 @@ buildPythonPackage rec {
# requires imagemagick (increases build closure size), doesn't
# test anything substantial
"test_ext_imgconverter"
] ++ lib.optional stdenv.isDarwin [
# Due to lack of network sandboxing can't guarantee port 7777 isn't bound
"test_inspect_main_url"
"test_auth_header_uses_first_match"
"test_linkcheck_request_headers"
"test_linkcheck_request_headers_no_slash"
"test_follows_redirects_on_HEAD"
"test_invalid_ssl"
"test_connect_to_selfsigned_with_tls_verify_false"
"test_connect_to_selfsigned_with_tls_cacerts"
"test_connect_to_selfsigned_with_requests_env_var"
"test_connect_to_selfsigned_nonexistent_cert_file"
"test_TooManyRedirects_on_HEAD"
"test_too_many_requests_retry_after_int_del"
"test_too_many_requests_retry_after_HTTP_date"
"test_too_many_requests_retry_after_without_header"
"test_too_many_requests_user_timeout"
"test_raises_for_invalid_status"
"test_auth_header_no_match"
"test_follows_redirects_on_GET"
"test_connect_to_selfsigned_fails"
];

meta = with lib; {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
From 5879a4bbc34d1eb25e160b15b2f5a4f10eac6bd2 Mon Sep 17 00:00:00 2001
From: toonn <toonn@toonn.io>
Date: Mon, 13 Sep 2021 18:07:26 +0200
Subject: [PATCH] =?UTF-8?q?tests:=20Rename=20a=CC=8Aa=CC=88o=CC=88=5F?=
=?UTF-8?q?=E6=97=A5=E6=9C=AC=E8=AA=9E.py=20=3D>=20=C3=A6=C9=90=C3=B8=5F?=
=?UTF-8?q?=E6=97=A5=E6=9C=AC=E5=83=B9.py?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

`åäö_日本語.py` normalizes differently in NFC and NFD normal forms. This
means a hash generated for the source directory can differ depending on
whether or not the filesystem is normalizing and which normal form it
uses.

By renaming the file to `æɐø_日本價.py` we avoid this issue by using a
name that has the same encoding in each normal form.
---
tests/test_bdist_wheel.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/test_bdist_wheel.py b/tests/test_bdist_wheel.py
index 651c034..9b94ac8 100644
--- a/tests/test_bdist_wheel.py
+++ b/tests/test_bdist_wheel.py
@@ -58,7 +58,7 @@ def test_unicode_record(wheel_paths):
with ZipFile(path) as zf:
record = zf.read('unicode.dist-0.1.dist-info/RECORD')

- assert u'åäö_日本語.py'.encode('utf-8') in record
+ assert u'æɐø_日本價.py'.encode('utf-8') in record


def test_licenses_default(dummy_dist, monkeypatch, tmpdir):
--
2.17.2 (Apple Git-113)

8 changes: 7 additions & 1 deletion pkgs/development/python-modules/wheel/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,14 @@ buildPythonPackage rec {
owner = "pypa";
repo = pname;
rev = version;
sha256 = "sha256-8lK2UvqBIxUYm6IOuT+Jk71wYbEEjvI7typS3749N9g=";
sha256 = "13bj49psan1s1fxfrq613dm2l7jvrg2dpgb36lz81z3b1h7zig6j";
name = "${pname}-${version}-source";
extraPostFetch = ''
cd $out
mv tests/testdata/unicode.dist/unicodedist/åäö_日本語.py \
tests/testdata/unicode.dist/unicodedist/æɐø_日本價.py
patch -p1 < ${./0001-tests-Rename-a-a-o-_-.py-_-.py.patch}
'';
};

nativeBuildInputs = [
Expand Down
1 change: 1 addition & 0 deletions pkgs/development/tools/build-managers/cmake/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ stdenv.mkDerivation rec {
'';

configureFlags = [
"CXXFLAGS=-Wno-elaborated-enum-base"
"--docdir=share/doc/${pname}${version}"
] ++ (if useSharedLibraries then [ "--no-system-jsoncpp" "--system-libs" ] else [ "--no-system-libs" ]) # FIXME: cleanup
++ lib.optional withQt5 "--qt-gui"
Expand Down
Loading