Simple example involving structured concurrency

I tried this countless times with different toolchains and different macOS versions and could never get it to work. I would export DYLD_LIBRARY_PATH=…, but then the DYLD_LIBRARY_PATH variable would not show up in the environment when I ran env.

It turns out that I had to disable System Integrity Protection because macOS doesn't pass DYLD_LIBRARY_PATH to SIP-protected processes when SIP is on.

You probably don't have to disable SIP completely. It should be enough to disable only SIP's debugging restrictions, as described in this comment on an rbenv GitHub issue from 2017: reboot into recovery mode, then type csrutil enable --without debug in Terminal. But I haven't tried that myself.

1 Like