Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at gcc-offload 32 lines 1.2 kB view raw
1pytestForkedHook() { 2 pytestFlagsArray+=( 3 "--forked" 4 ) 5 6 # Using --forked on darwin leads to crashes when fork safety is 7 # enabled. This often happens when urllib tries to request proxy 8 # settings on MacOS through `urllib.request.getproxies()` 9 # - https://github.com/python/cpython/issues/77906 10 if [[ "$OSTYPE" == "darwin"* ]]; then 11 export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES 12 fi 13} 14 15# the flags should be added before pytestCheckHook runs so 16# until we have dependency mechanism in generic builder, we need to use this ugly hack. 17 18if [ -z "${dontUsePytestForked-}" ] && [ -z "${dontUsePytestCheck-}" ]; then 19 if [[ " ${preDistPhases[*]:-} " =~ " pytestCheckPhase " ]]; then 20 _preDistPhases="${preDistPhases[*]} " 21 _preDistPhases="${_preDistPhases/ pytestCheckPhase / pytestForkedHook pytestCheckPhase }" 22 if [[ -n "${__structuredAttrs-}" ]]; then 23 preDistPhases=() 24 else 25 preDistPhases="" 26 fi 27 appendToVar preDistPhases $_preDistPhases 28 unset _preDistPhases 29 else 30 appendToVar preDistPhases pytestForkedHook 31 fi 32fi