Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix macOS tests with meson #11527

Merged
merged 4 commits into from
Sep 18, 2024
Merged

Fix macOS tests with meson #11527

merged 4 commits into from
Sep 18, 2024

Conversation

Mic92
Copy link
Member

@Mic92 Mic92 commented Sep 18, 2024

With these changes meson test in the devshell works.

@github-actions github-actions bot added the with-tests Issues related to testing. PRs with tests have some priority label Sep 18, 2024
@Mic92 Mic92 changed the title Fix macOS test with meson Fix macOS tests with meson Sep 18, 2024
nrabulinski and others added 2 commits September 18, 2024 14:29
Because of an objc quirk[1], calling curl_global_init for the first time
after fork() will always result in a crash.
Up until now the solution has been to set
OBJC_DISABLE_INITIALIZE_FORK_SAFETY for every nix process to ignore
that error.
This is less than ideal because we were setting it in package.nix,
which meant that running nix tests locally would fail because
that variable was not set.
Instead of working around that error we address it at the core -
by calling curl_global_init inside initLibStore, which should mean
curl will already have been initialized by the time we try to do so in
a forked process.

[1] https://github.com/apple-oss-distributions/objc4/blob/01edf1705fbc3ff78a423cd21e03dfc21eb4d780/runtime/objc-initialize.mm#L614-L636

(cherry-picked and adapted from https://git.lix.systems/lix-project/lix/commit/c7d97802e4f59b8621e67cf62275d6a7fde8fe62)
Before we would get the unwrapped version of clang-tools from clang
itself, which doesn't quite work.
@edolstra edolstra merged commit 0ed2ab0 into NixOS:master Sep 18, 2024
11 checks passed
@Mic92 Mic92 deleted the macos-test-fix branch September 18, 2024 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
with-tests Issues related to testing. PRs with tests have some priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants