Skip to content

fix(build): set target_arch to fix NSS build on Apple Silicon#6713

Open
groovecoder wants to merge 1 commit into
mozilla:mainfrom
groovecoder:fix-build-target-arch
Open

fix(build): set target_arch to fix NSS build on Apple Silicon#6713
groovecoder wants to merge 1 commit into
mozilla:mainfrom
groovecoder:fix-build-target-arch

Conversation

@groovecoder

Copy link
Copy Markdown
Member

GYP expects the target_arch environment variable to determine the correct architecture when building NSS. On Apple Silicon, if this is unset or misconfigured, NSS can be built for x86_64, leading to linker failures due to architecture mismatch.

This patch sets target_arch based on uname -m when building on macOS, ensuring correct architecture selection and avoiding these build errors.

Pull Request checklist

  • Breaking changes: This PR follows our breaking change policy
    • This PR follows the breaking change policy:
      • This PR has no breaking API changes
  • Quality: This PR builds and tests run cleanly
    • Note:
      • For changes that need extra cross-platform testing, consider adding [ci full] to the PR title.
      • If this pull request includes a breaking change, consider cutting a new release after merging.
    • I'm getting these test failures, but they seem unrelated to this change:
failures:
    selector::tests::test_filter_with_remote_settings
    selector::tests::test_filter_with_remote_settings_overrides
    selector::tests::test_remote_settings_empty_search_config_overrides_filtered_without_error
    selector::tests::test_remote_settings_empty_search_config_records_throws_error
    selector::tests::test_remote_settings_search_config_overrides_records_is_none_throws_error

test result: FAILED. 40 passed; 5 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.04s
  • Tests: This PR includes thorough tests or an explanation of why it does not
    • I'm not sure how to add a test for this?
  • Changelog: This PR includes a changelog entry in CHANGELOG.md or an explanation of why it does not need one
    • Any breaking changes to Swift or Kotlin binding APIs are noted explicitly
  • ~Dependencies: This PR follows our dependency management guidelines
    • Any new dependencies are accompanied by a summary of the due diligence applied in selecting them.~

Branch builds: add [firefox-android: branch-name] to the PR title.

GYP expects the `target_arch` environment variable to determine the correct
architecture when building NSS. On Apple Silicon, if this is unset or misconfigured,
NSS can be built for `x86_64`, leading to linker failures due to architecture mismatch.

This patch sets `target_arch` based on `uname -m` when building on macOS,
ensuring correct architecture selection and avoiding these build errors.
@groovecoder groovecoder force-pushed the fix-build-target-arch branch from c568c0b to 2ebfb5d Compare April 18, 2025 11:17
@groovecoder groovecoder marked this pull request as ready for review April 18, 2025 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant