checkInputs used to be added to nativeBuildInputs. Now we have
nativeCheckInputs to do that instead. Doing this treewide change allows
to keep hashes identical to before the introduction of
nativeCheckInputs.
We run pytest with `--forked` in nixpkgs, to reduce side effects that
can occur when multiple tests mutate their environment in incompatible
ways.
Forking on macOS 10.13 and later is unsafe when an application does work
between calls to fork() and its followup exec(). This may lead to
crashes when calls into the Objective-C runtime are issued, which will
in turn coredump the Python interpreter.
One good reproducer for this scenario is when the urllib module tries
to lookup proxy configurations in `urllib.request.getproxies()` through
`get_proxies_macos_sysconf` into the native `_scproxy` module.
This is a class of issues that is of course not limited to the urllib
module. The general recommendation is to use `spawn` instead of `fork`,
but we don't have any influence on upstream developers to do one or the
other.
One often cited workaround would be to disable fork safety entirely on
calls to `initialize()`, which is probably a better solution than
running without multithreading (slow) or without the `--forked` (prone
to side effects) mode.
This currently happens on aarch64-linux only, where we use more recent
11.0 SDK version, while x86_64-darwin has been stuck on 10.12 for a
while now.
https://github.com/python/cpython/issues/77906#issuecomment-1093788352http://www.sealiesoftware.com/blog/archive/2017/6/5/Objective-C_and_fork_in_macOS_1013.htmlCloses: #194290
many of our packages have pytest-xdist in their inputs however
oftentimes the required flags aren't added to pytest flags
since we dont use tox and other frameworks
some examples of improvements
(my pc has ryzen 9 5900x)
hypothesis 11m:15s on hydra -> <1m on my pc
hypothesmith 8m on my pc -> <1m on my pc
the whole graph from pytest-xdist (tested by adding postPatch with true to xdist)
time nix build ".#python3Packages.hypothesmith"
19m:57s -> 9m:13s
pytest extensions should not propagate pytest. Doing so makes it
impossible to combine the package with another version of pytest, which
sometimes is needed.