Skip to content

Comments

nix: Fix devEnv build on macOS#5013

Merged
mastaab merged 2 commits intodevelopfrom
fix/darwin-devenv-build
Feb 17, 2026
Merged

nix: Fix devEnv build on macOS#5013
mastaab merged 2 commits intodevelopfrom
fix/darwin-devenv-build

Conversation

@mastaab
Copy link
Contributor

@mastaab mastaab commented Feb 5, 2026

Summary

  • Conditionalize glibcLocales to Linux only (not available on Darwin)
  • Use gccStdenv for the nginz build on macOS — the zauth nginx module uses GCC nested functions, which Clang doesn't support. This avoids modifying C source code.
  • Skip system-linux-proc tests on macOS since /proc filesystem doesn't exist

Test plan

  • Verified nix build .#nginz succeeds on macOS
  • Verified nix develop builds successfully on macOS

- Conditionalize glibcLocales (Linux only)
- Fix nested function in zauth_module.c (not supported by Clang)
- Skip system-linux-proc tests on macOS (/proc doesn't exist)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@mastaab mastaab requested a review from a team as a code owner February 5, 2026 18:39
@zebot zebot added the ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist label Feb 5, 2026

static ngx_int_t zauth_token_var (ngx_http_request_t * r, ngx_http_variable_value_t * v, uintptr_t data) {
ZauthContext const * ctx = ngx_http_get_module_ctx(r, zauth_module);
// this function checks if the signature has been validated successfully,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you considered to use Nix's gccStdenv? You may try to override it here: https://github.com/wireapp/wire-server/blob/develop/nix/default.nix#L14-L14

E.g.
nginz = pkgs.callPackage ./nginz.nix { stdenv = pkgs.gccStdenv };

This would save us the headache to 💯 ensure that this introduces no regression. 😸

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the hint @supersven

The zauth nginx module uses GCC nested functions, which are not
supported by Clang (the default compiler on macOS). Instead of
refactoring the C source to remove nested functions, use gccStdenv
to ensure GCC is used for the nginz build on Darwin.
@mastaab mastaab requested a review from supersven February 13, 2026 19:52
template = hlib.markUnbroken hsuper.template;
system-linux-proc = hlib.markUnbroken hsuper.system-linux-proc;
# /proc doesn't exist on macOS, so skip tests there
system-linux-proc = (if stdenv.isDarwin then hlib.dontCheck else (x: x))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The consequence of this is that you won't be able to run the integration tests. However, I guess, you could live with that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes I think currently it's acceptable on MacOS - but would be nice to get this working in a next step 😄

Copy link
Contributor

@supersven supersven left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for blocking this PR so long.

Looks good to me now 👍

Thanks for the good vibes 😉 (and caring about our backend project setup)

@mastaab mastaab merged commit 4734dcd into develop Feb 17, 2026
10 checks passed
@mastaab mastaab deleted the fix/darwin-devenv-build branch February 17, 2026 19:35
blackheaven pushed a commit that referenced this pull request Feb 23, 2026
* nix: Fix devEnv build on macOS
- Conditionalize glibcLocales (Linux only)
- Skip system-linux-proc tests on macOS (/proc doesn't exist)
- use gccStdenv to ensure GCC is used for the nginz build on Darwin.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants