Since updating to JUCE 7.0.4 it seems that some of my build pipelines are hitting this error when building LV2 plugins:
terminate called after throwing an instance of 'std::system_error'
what(): Enable multithreading to use std::thread: Operation not permitted
Seems like that’s happening when generating the LV2 TTL files, but it’s hard to tell for sure. The builds will sometimes succeed and sometimes fail, but I haven’t been able to find a pattern just yet.
According to this SO answer the problem may be due to the order in which libraries are loaded. I’m not sure of the best way to test this, but a good start would be to try adding the LD_PRELOAD variable to your environment to see whether that also fixes the problem. If it does, then I think we can be fairly confident that the problem is to do with library loading order, in which case I think the fix you’ve suggested seems sensible.
Ah okay, after some more tests I’ve got a clearer picture of what’s going on:
The issue occurs consistently on GitHub Actions runners using the ubuntu-18.04 image. With the ubuntu-22.04 image, the issue no longer occurs.
While using ubuntu-18.04, using either the diff I pasted above, or the LD_PRELOAD environment variable as described in the SO answer, the issue no longer occurs.
This page has the exact specs for the different GitHub Actions runner images.