nixpkgs/pkgs/tools/package-management
Jean-François Roche 4844b997d4 nix: fix installCheckPhase crashes on Darwin
While building nix on Darwin, I encountered an error in the `installCheckPhase`:

```
nix>     building '/private/tmp/nix-build-nix-2.17.1.drv-1/nix-test/tests/fetchurl/store/mkc9z3arar02wi5jii655cjhdinx4npy-fetchurl.sh.drv'...
nix>     waiting for children
nix>     building of '/private/tmp/nix-build-nix-2.17.1.drv-1/nix-test/tests/fetchurl/store/mkc9z3arar02wi5jii655cjhdinx4npy-fetchurl.sh.drv^out' from .drv file: read 377 bytes
nix>     objc[70707]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called.
nix>     objc[70707]: +[__NSCFConstantString initialize] may have been in progress in another thread when fork() was called. We cannot safely call it or ignore it in the fork() child process. Crashing instead. Set a breakpoint on objc_initializeAfterForkError to debug.
nix>     waiting for children
```

I noticed that #278802 should have addressed this problem, but it didn't.
The solution for me was to replace `yes` with `YES`.

As it turns out, most of the references to `OBJC_DISABLE_INITIALIZE_FORK_SAFETY` use `YES` instead of `yes`.

https://airflow.apache.org/blog/airflow-1.10.10/#running-airflow-on-macos
http://sealiesoftware.com/blog/archive/2017/6/5/Objective-C_and_fork_in_macOS_1013.html

The objective C code that parses the environment variable is defined in
the function `environ_init` in [here](cd5e62a559/runtime/objc-runtime.mm (L265)) and it does
`*opt->var = (0 == strcmp(value, "YES"));`.

```
% nix-info -m
 - system: `"aarch64-darwin"`
 - host os: `Darwin 21.3.0, macOS 12.2.1`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.19.2`
 - channels(hetzner): `"darwin, nixpkgs-22.05-darwin"`
 - channels(root): `"darwin, nixpkgs-23.05-darwin"`
 - nixpkgs: `/Users/hetzner/git/nixpkgs`
```
2024-01-23 11:05:12 +01:00
..
akku treewide: add mainProgram 2023-11-27 02:17:53 +01:00
apk-tools treewide: add mainProgram 2023-11-27 02:17:53 +01:00
apkg treewide: add mainProgram 2023-11-27 02:17:53 +01:00
appimage-run
appimagekit pkgs/tools/package-management: remove dead code 2023-07-25 12:12:32 -04:00
apt-dater
apx apx: 2.2.0 -> 2.3.0 2024-01-15 12:02:20 +00:00
cde
checkinstall
ciel treewide: update meta.description to fit the guidelines 2024-01-09 17:12:31 +01:00
clib clib: 2.8.3 -> 2.8.5 2023-11-09 06:38:11 +00:00
comma comma: add meta.mainProgram 2023-10-13 14:34:25 +02:00
conda fix: Trailing whitespace 2024-01-02 03:40:00 -05:00
createrepo_c
deploy-rs deploy-rs: unstable-2023-09-12 -> unstable-2023-12-20 2024-01-04 17:26:10 +01:00
disnix DisnixWebService: add meta.{changelog,homepage} 2023-11-23 00:14:16 +01:00
dnf5 dnf5: 5.1.9 -> 5.1.10 2024-01-02 14:44:14 +01:00
dpkg dpkg: 1.22.0 -> 1.22.1 2023-11-03 07:28:15 +00:00
elm-github-install treewide: add mainProgram 2023-11-27 02:17:53 +01:00
emplace treewide: add mainProgram 2023-11-27 02:17:53 +01:00
fortran-fpm fortran-fpm: 0.9.0 -> 0.10.0 2024-01-09 10:11:02 +00:00
fpm treewide: add mainProgram 2023-11-27 02:17:53 +01:00
fusesoc treewide: add mainProgram 2023-11-27 02:17:53 +01:00
gx treewide: add mainProgram 2023-11-27 02:17:53 +01:00
harmonia harmonia: fix build on darwin 2023-12-21 22:56:44 +01:00
holo-build treewide: add mainProgram 2023-11-27 02:17:53 +01:00
home-manager home-manager: unstable-2023-12-31 -> unstable-2024-01-05 2024-01-07 05:15:55 +00:00
libcomps libcomps: init at 0.1.20 2023-12-05 11:31:07 +01:00
libdnf libdnf: add katexochen as maintainer 2023-12-05 11:31:06 +01:00
librepo
licensee licensee: 9.16.0 -> 9.16.1 2024-01-16 21:49:55 +01:00
microdnf treewide: add mainProgram 2023-11-27 02:17:53 +01:00
micromamba micromamba: 1.5.3 -> 1.5.4 2023-12-06 20:57:03 +08:00
morph treewide: add mainProgram 2023-11-27 02:17:53 +01:00
mynewt-newt treewide: vendorSha256 → vendorHash 2023-09-13 01:03:44 -06:00
nfpm nfpm: 2.35.1 -> 2.35.2 2024-01-05 09:37:49 +00:00
niff treewide: add mainProgram 2023-11-27 02:17:53 +01:00
nix nix: fix installCheckPhase crashes on Darwin 2024-01-23 11:05:12 +01:00
nix-bundle
nix-doc nix-doc: 0.6.2 -> 0.6.4 2023-12-03 15:39:16 -08:00
nix-du nix-du: 1.1.1 -> 1.2.0 2023-12-30 22:20:45 +01:00
nix-eval-jobs nix-eval-jobs: 2.19.3 -> 2.19.4 2023-12-18 09:50:31 +01:00
nix-index nix-index-unwrapped: 0.1.6 -> 0.1.7 2023-08-24 20:57:28 +02:00
nix-pin treewide: add mainProgram 2023-11-27 02:17:53 +01:00
nix-prefetch treewide: add mainProgram 2023-11-27 02:17:53 +01:00
nix-prefetch-scripts
nix-serve treewide: add mainProgram 2023-11-27 02:17:53 +01:00
nix-simple-deploy treewide: add mainProgram 2023-11-27 02:17:53 +01:00
nix-template treewide: add mainProgram 2023-11-27 02:17:53 +01:00
nix-top treewide: add mainProgram 2023-11-27 02:17:53 +01:00
nix-universal-prefetch treewide: add mainProgram 2023-11-27 02:17:53 +01:00
nix-update nix-update: set meta.mainProgram 2023-11-16 21:42:13 +01:00
nix-update-source treewide: add mainProgram 2023-11-27 02:17:53 +01:00
nixpkgs-review nixpkgs-review: 2.10.2 -> 2.10.3 2023-10-22 15:49:52 +02:00
nox
npm-check-updates npm-check-updates: 16.14.0 -> 16.14.12 2024-01-09 19:13:53 +00:00
nvd nvd: reformat using nixpkgs-fmt and update minor things 2023-08-17 14:12:22 +02:00
opkg Merge pull request #263366 from r-ryantm/auto-update/opkg 2023-11-04 01:03:58 +01:00
opkg-utils
packagekit packagekit-qt: add Qt6 support 2023-12-03 14:48:56 +03:00
pacman pacman: fix build with strictDeps = true; 2024-01-12 23:09:19 -05:00
pacup treewide: add mainProgram 2023-11-27 02:17:53 +01:00
pdm pdm: 2.10.4 -> 2.12.1, fix build 2024-01-17 08:51:08 +01:00
pkg treewide: add mainProgram 2023-11-27 02:17:53 +01:00
poetry poetry: fix tests on Darwin 2024-01-16 13:06:06 -08:00
poetry2conda treewide: add mainProgram 2023-11-27 02:17:53 +01:00
protontricks Merge master into staging-next 2024-01-11 12:01:18 +00:00
repro-get treewide: add mainProgram 2023-11-27 02:17:53 +01:00
rpm rpm: declare darwin as badPlatform 2023-11-24 13:34:39 +01:00
smlpkg treewide: add mainProgram 2023-11-27 02:17:53 +01:00
wapm/cli
xbps xbps: 0.59.1 -> 0.59.2; fix build 2023-11-16 21:37:24 +00:00
yarn-lock-converter treewide: add mainProgram 2023-11-27 02:17:53 +01:00