Neither openexr nor ilmbase dependencies were actually being picked up
(checked with nix why-depends).
Instead, openvdb defaults to building its own vendored Half library since 8.1.0:
5c9f0f9685
Also, starting from 11.0.0, OpenEXR 2 will no longer be supported.
Someone else can look into fixing this properly to use system libraries.
1. Remove `rec` keyword in favor of passing a function to
`stdenv.mkDerivation`;
2. Reorder attributes;
3. Put build only dependencies --- Hare's third party libraries --- into
`nativeBuildInputs`;
4. Remove `preConfigure` hook in favor of setting the `HARECACHE` make
variable;
5. Use `stdenv.hostPlatform.uname.processor` for setting the
architecture needed for cross-compilation;
6. Substitute in place the `HAREFLAGS` make variable instead of the `-a`
flag directly, which is now set on the make variable (this should be
submitted upstream, since the make variable, as of now, does
absolutely nothing);
8. Pass the `-q` flag to `HAREFLAGS` to avoid polluting the logs when
hare is either being called with `test` or `build`;
9. Remove deprecated `agpl3` license in favor of `agpl3Plus`;
10. Add `bonsaictl` as `meta.mainProgram`; and
11. Enable parallel building.
This non-standard function has been deprecated since glibc 2.34 (August 2021),
and calls to it were breaking the build. This has since been fixed in the
upstream Synchronet tree, from which SyncTERM releases are cut, but this was
last done in 2020.
Big thanks to @aexoxea, who not only dug into this, but adapted the upstream
patches to the SyncTERM tree and posted almost this exact diff in #174749 -
where it completely slipped my mind until now, sorry!
Fixes#174749
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-macoshttp://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`
```