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

Build with bazel on darwin-arm64 #4

Closed
Tracked by #1
mcevoypeter opened this issue Oct 26, 2022 · 2 comments · Fixed by #13
Closed
Tracked by #1

Build with bazel on darwin-arm64 #4

mcevoypeter opened this issue Oct 26, 2022 · 2 comments · Fixed by #13
Labels
build Related to the build system feature New feature or feature request

Comments

@mcevoypeter
Copy link

mcevoypeter commented Oct 26, 2022

Build the urbit binary on darwin-arm64 (i.e. Apple Silicon machines running macOS). This will build off the work done in #2. The steps required:

  • Tweak third-party dependency bazel build rules in bazel/third_party/ to build on darwin-arm64 platforms.
  • Move the platform-specific third-party dependency patches in pkg/urbit/compat/m1brew/ to the appropriate dependency directory in bazel/third_party/; verify the patches are still correct in the context of the dependency versions we're using; and apply the patches to the dependency buidls in WORKSPACE.bazel using select().
  • Incorporate the compilation flags in pkg/urbit/compat/m1brew/compat.mk into the appropriate build rule(s) in pkg/.
  • Tweak the bazel build rules for all packages in pkg/ to build on darwin-arm64 platforms.
@mcevoypeter mcevoypeter added feature New feature or feature request build Related to the build system labels Oct 26, 2022
@mcevoypeter mcevoypeter mentioned this issue Oct 26, 2022
6 tasks
@matthew-levan
Copy link
Contributor

matthew-levan commented Nov 4, 2022

Notes from my conversation with @mcevoypeter today:

  1. ARM chips don't support Intel SSE, which at least h2o depends on.
    a. ARM chips support NEON instead.
    b. We can replace SSE headers with sse2neon.h in our ARM-specific patches.
  2. Our platform-specific patching strategies will include:
    a. For build-system patches: incorporate Makefile patches to cc_library rules in third-party <dependency>.BUILD files.
    b. For source code patches: use environment variables (i.e., URBIT_RUNTIME_PLATFORM_DARWIN, etc.) and #if defined(VAR) to gate platform-specific code blocks in source files, and set the appropriate environment variables using select() calls in our third-party <dependency>.BUILD files to "select" the correct code blocks.

TODOs:

  • Implement updated patching strategies with:
    • murmur3
    • softfloat
    • lmdb
    • h2o
  • Document patching strategies more thoroughly in the top-level comment of WORKSPACE.bazel

@mcevoypeter mcevoypeter linked a pull request Nov 15, 2022 that will close this issue
@mcevoypeter
Copy link
Author

Closing now that #13 is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Related to the build system feature New feature or feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants