Skip to content

nix: Fix devEnv build on macOS#5013

Open
mastaab wants to merge 2 commits intodevelopfrom
fix/darwin-devenv-build
Open

nix: Fix devEnv build on macOS#5013
mastaab wants to merge 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
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