nixpkgs/pkgs/tools
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
..
admin Merge pull request #282868 from teutat3s/manta-5.4.2 2024-01-23 06:53:07 +09:00
archivers Merge pull request #277688 from r-ryantm/auto-update/xarchiver 2024-01-20 07:59:07 +01:00
audio Merge pull request #282682 from r-ryantm/auto-update/patray 2024-01-21 22:12:36 +00:00
backup Merge pull request #281833 from rhoriguchi/gphotos-sync 2024-01-22 18:21:45 +01:00
bluetooth bluez-alsa: migrate to by-name 2024-01-13 19:27:28 -03:00
bootloaders/refind
cd-dvd treewide: update meta.description to fit the guidelines 2024-01-09 17:12:31 +01:00
compression efficient-compression-tool: fixup build with gcc13 2024-01-11 16:16:45 +01:00
dotool
filesystems Merge pull request #277096 from katexochen/convoy/remove 2024-01-23 07:16:44 +01:00
games er-patcher: 1.10-1 -> 1.10.1-1 2024-01-22 16:14:26 +00:00
graphics resvg: 0.37.0 -> 0.38.0 2024-01-21 04:20:00 +00:00
inputmethods Merge pull request #275026 from bew/patch-1 2024-01-23 01:43:59 +01:00
llm python311Packages.open-interpreter: init at 0.2.0 2024-01-17 12:56:11 -08:00
misc Merge pull request #282982 from r-ryantm/auto-update/esphome 2024-01-23 00:29:34 +01:00
networking Merge pull request #278355 from elesiuta/picosnitch-update 2024-01-23 10:48:12 +01:00
nix Merge master into staging-next 2024-01-04 18:00:54 +00:00
package-management nix: fix installCheckPhase crashes on Darwin 2024-01-23 11:05:12 +01:00
security Merge pull request #270985 from maxbrunet/fix/argocd-vault-plugin/version 2024-01-23 03:22:38 +01:00
system Merge pull request #280843 from kirillrdy/unpin-go 2024-01-22 20:28:38 +09:00
text Merge pull request #282501 from r-ryantm/auto-update/fanficfare 2024-01-23 02:58:12 +01:00
typesetting texlive: create outputsToInstall outputs in main derivation (#270232) 2024-01-20 22:13:40 -05:00
video Merge remote-tracking branch 'origin/master' into staging-next 2024-01-02 10:55:23 +03:00
virtualization Merge pull request #282885 from alyssais/maintainership 2024-01-23 10:08:11 +01:00
wayland hyprland-per-window-layout: 2.5 -> 2.6 2024-01-19 18:42:00 +00:00
X11 ffcast: 2.5.0 -> 2.5.1 2024-01-21 07:24:25 +00:00