Repository navigation
Conversation
- Add `macos-arm64-test` job on `macos-15` alongside `macos-test` on `macos-15-intel` in `.github/workflows/openstudio-server-tests.yml`, uploading the `openstudio-server-gems-darwin-arm64` artifact. - Update `ci/github-actions/setup.sh`, `ci/github-actions/test.sh`, and `ci/github-actions/export_build_osx.sh` to detect `uname -m` (`arm64` vs `x86_64`) and select matching portable Ruby, MongoDB, and OpenStudio tarballs. - Fix up portable `/usr/local/ruby` on `arm64` in `setup.sh` so native gem extensions compile cleanly and link statically against `gmp`, `libyaml`, and `openssl@3` without embedding `/opt/homebrew` dylibs, replace `extinit.o`/`encinit.o` in `libruby.3.2-static.a` with dummy `Init_ext`/`Init_enc` symbols, sanitize Conan runner paths in `rbconfig.rb`, and restore `autoload` declarations in `rubygems.rb`. - Update `bin/openstudio_meta` to emit `-darwin-arm64.tar.gz` on ARM64 macOS, set `COPYFILE_DISABLE=1` to prevent AppleDouble `._*` files, and exclude `build` and `*.tar.gz`/`*.tgz` from the staged archive. - Add post-export tarball verification in `export_build_osx.sh` checking required files/directories, absence of `._*` and nested archives, native `.bundle` Mach-O architecture, and portable dylib linkage. Fixes #884 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Native Ruby archive modifications and portability require macOS validation with PAT’s bundled runtime, beyond resolving the retained issues.
2 open findings
What changed in this PR
Adds native macOS ARM64 server packaging alongside Intel builds for PAT’s Apple Silicon support.
Changes:
- Adds an ARM64 CI job and architecture-specific dependency selection.
- Repairs portable ARM64 Ruby for native gem compilation.
- Updates archive naming, cleanup, and portability verification.
| File | Description |
|---|---|
ci/github-actions/test.sh |
Selects architecture-specific OpenStudio paths. |
ci/github-actions/setup.sh |
Installs matching dependencies and repairs ARM64 Ruby. |
ci/github-actions/export_build_osx.sh |
Exports and verifies architecture-specific archives. |
bin/openstudio_meta |
Names ARM64 archives and excludes build artifacts and metadata. |
.github/workflows/openstudio-server-tests.yml |
Adds ARM64 testing and artifact upload. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| fi | ||
| sudo cp mongodb-macos-x86_64-8.0.12/bin/* /usr/local/bin/ | ||
| sudo mkdir -p /usr/local/bin | ||
| sudo cp "${MONGO_ARCHIVE}"/bin/* /usr/local/bin/ |
…libyaml linking
- Use MONGO_EXTRACT_DIR=mongodb-macos-aarch64-8.0.12 when extracting
mongodb-macos-arm64-8.0.12.tgz on macOS ARM64.
- Stage static gmp, libyaml, and openssl@3 archives/headers into
/usr/local/ruby and sanitize /usr/local/opt/{openssl@3,libyaml,gmp}
in rbconfig.rb on both x86_64 and arm64 so Intel puma_http11.bundle
links statically instead of referencing /usr/local/opt/openssl@3.
- Reject any /usr/local/ dylib path in export_build_osx.sh portability
check.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
On x86_64 portable Ruby (ruby-3.2.2-darwin.tar.gz), rubygems.rb already uses autoload :DependencyList, File.expand_path(...), whereas the arm64 Conan Ruby replaced them with eager require 'rubygems/...' lines. Guard the replacement with rg_content.include?(old_line) so both tarballs succeed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.


Summary
Addresses #884 and unblocks
NatLabRockies/OpenStudio-PAT#311by building, verifying, and exporting a native macOS ARM64 (darwin-arm64)OpenStudio-server-<sha>-darwin-arm64.tar.gztarball in CI alongside the Intel (darwin) tarball.Changes
.github/workflows/openstudio-server-tests.yml:macos-arm64-testonmacos-15(uploading artifactopenstudio-server-gems-darwin-arm64) alongsidemacos-testonmacos-15-intel(openstudio-server-gems-darwin).ci/github-actions/setup.sh:uname -m(arm64vsx86_64) onmacos15to install matching portable Ruby (ruby-3.2.2-darwin-arm64.tar.gzvsruby-3.2.2-darwin.tar.gz), MongoDB (mongodb-macos-arm64-8.0.12.tgzextracting tomongodb-macos-aarch64-8.0.12), and OpenStudio (Darwin-arm64vsDarwin-x86_64) packages, and ensures/usr/local/binexists./usr/local/rubyon botharm64andx86_64so all native gem extensions (psych,puma,bigdecimal,bson,nio4r,sassc,msgpack,racc,websocket-driver, etc.) compile cleanly and link statically without/opt/homebrewor/usr/local/optdylib references:*.a) and headers forgmp,libyaml, andopenssl@3into/usr/local/ruby/{lib,include}.extinit.oandencinit.oinlibruby.3.2-static.a(present onarm64) with dummyInit_ext/Init_encsymbols somkmftry_link0checks against-lruby.3.2-staticsucceed./usr/local/opt/{openssl@3,libyaml,gmp}) build-runner paths inrbconfig.rband adds--without-pkg-configsomkmfdoes not crash on nilENV["PKG_CONFIG_PATH"]or pull in Homebrew dylib search paths.autoloaddeclarations inrubygems.rbwhen eagerrequire 'rubygems/...'lines are present so thesecurerandomdefault gem is not pre-activated beforeGem::Specification.load_defaultsandBundler.setup.ci/github-actions/test.sh&ci/github-actions/export_build_osx.sh:uname -mto selectDarwin-arm64vsDarwin-x86_64and-darwin-arm64.tar.gzvs-darwin.tar.gz.export_build_osx.shmatchingNatLabRockies/OpenStudio-PAT#311(verify_server_deps.yaml), rejecting any/opt/homebrew,/usr/local/,/Users/, or/private/dylib dependency.bin/openstudio_meta:OpenStudio-server-<sha>-darwin-arm64.tar.gzwhenRUBY_PLATFORMmatchesdarwin+arm64/aarch64.COPYFILE_DISABLE=1on macOS before runningtarso AppleDouble._*metadata files are never included.buildand*.tar.gz/*.tgzentries when stagingOpenStudio-server/.Fixes #884