Support building on arm Mac, Linux environments#1790
Merged
Ekrekr merged 1 commit intodataform-co:mainfrom Jul 30, 2024
Merged
Conversation
Contributor
Author
|
I'd like to nominate @Ekrekr as reviewer, as he seems to have done a lot of work around the build system. |
Contributor
|
Thanks for doing this! I had struggled to get this to work before when experimenting with #1462. Have run the tests manually and they pass, so I will merge this. |
Ekrekr
approved these changes
Jul 30, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #1593. Modify build config to support building on arm Mac, Linux environments.
Introduced support by upgrading the
rules_nodejspackage and its dependencies, and by extending platform-specific build scripts to download the appropriate executables.Tested by locally executing the
scripts/run,scripts/run_testsscripts (needed to use own GCP project and own encrypted key). I also applied this change on top of the3.0.0tag and checked that the builtcli,corepackages contain identical files to those published on NPM. Tested that build works on an Intel and an ARM Linux box (WSL), as well as an Apple Silicon Mac.Overview of changes:
rules_nodejsfrom1.6.1to3.8.0. Arm targets inrepository_rulescan only be specified after the update (darwin support introduced in3.5.0, linux support in2.x. Upgraded to3.8.0as point release upgrade worked without modifications),install_bazel_dependenciessteps (https://github.com/bazelbuild/rules_nodejs/wiki#removal-of-install_bazel_dependencies-1877) from/WORKSPACE,install_source_map_supportflags from/BUILDfile (https://github.com/bazelbuild/rules_nodejs/wiki#removal-of-install_source_map_support),bazel_patch_module_resolverflag to emulate legacy behavior (https://github.com/bazelbuild/rules_nodejs/wiki#--bazel_patch_module_resolver-now-defaults-to-false-2324),testing/index.ts,tools/gcloud/repository_rules.bzl(the second one wasn't necessary as even x64 packages worked fine and used locally installed arm python, but this felt more correct).rules_nodejs2.0(https://github.com/bazelbuild/rules_nodejs/wiki#loading-custom-rules-from-npm-packages),@bazel/tsetselint rule introduced inrules_nodejs3.0,grpcdependency, whichnode_gypfailed to build on Apple Silicon. It does not seem like it's used anywhere (and I don't understand why eithercoreorcliwould need interprocess communication besides the fork used during compile). Make explicit thesource_map_supportdependency.There are likely parts of the build system that I couldn't test. For example, I don't have access to the CI pipeline.