Files
nixpkgs/pkgs/development/python2-modules/cffi/default.nix
T
Artturin e0464e4788 treewide: replace stdenv.is with stdenv.hostPlatform.is
In preparation for the deprecation of `stdenv.isX`.

These shorthands are not conducive to cross-compilation because they
hide the platforms.

Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way

One example of why this is bad and especially affects compiler packages
https://www.github.com/NixOS/nixpkgs/pull/343059

There are too many files to go through manually but a treewide should
get users thinking when they see a `hostPlatform.isX` in a place where it
doesn't make sense.

```
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is"
fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is"
```
2024-09-25 00:04:37 +03:00

46 lines
1.2 KiB
Nix

{ lib, stdenv, cffi }:
if cffi == null then null else cffi.overridePythonAttrs {
disabledTests = lib.optionals stdenv.hostPlatform.isDarwin [
# cannot load library 'c'
"test_FILE"
"test_FILE_object"
"test_FILE_only_for_FILE_arg"
"test_load_and_call_function"
"test_load_library"
# cannot load library 'dl'
"test_dlopen_handle"
# cannot load library 'm'
"test_dir_on_dlopen_lib"
"test_dlclose"
"test_dlopen"
"test_dlopen_constant"
"test_dlopen_flags"
"test_function_typedef"
"test_line_continuation_in_defines"
"test_missing_function"
"test_remove_comments"
"test_remove_line_continuation_comments"
"test_simple"
"test_sin"
"test_sinf"
"test_stdcall_only_on_windows"
"test_wraps_from_stdlib"
# MemoryError
"test_callback_as_function_argument"
"test_callback_crash"
"test_callback_decorator"
"test_callback_large_struct"
"test_callback_returning_void"
"test_cast_functionptr_and_int"
"test_function_pointer"
"test_functionptr_intptr_return"
"test_functionptr_simple"
"test_functionptr_void_return"
"test_functionptr_voidptr_return"
];
}