Skip to content

Package Swift runtime dylibs with macOS CLI#11149

Draft
alokedesai wants to merge 1 commit into
masterfrom
oz/macos-swift-runtime-dylibs
Draft

Package Swift runtime dylibs with macOS CLI#11149
alokedesai wants to merge 1 commit into
masterfrom
oz/macos-swift-runtime-dylibs

Conversation

@alokedesai
Copy link
Copy Markdown
Member

Summary

  • Package required Swift runtime dylibs beside the standalone macOS CLI in target/.../bundle/osx/lib using xcrun swift-stdlib-tool.
  • Add LC_RPATH @executable_path/lib to the standalone CLI before signing so @rpath/libswift*.dylib resolves from the adjacent lib/ directory.
  • Sign copied dylibs before signing the CLI executable and notarize a complete CLI distribution staging folder containing the binary, lib/, and resources/.
  • Include lib/ in macOS CLI release tarballs when present and validate the tarball launch layout in the macOS release workflow.
  • Install extracted lib/ directories to $install_dir/lib via lib.tmp without changing the remote-server binary path.
  • Add a focused installer test that runs the real install script against a tarball containing lib/libswiftCore.dylib.

Diff summary

.github/workflows/create_release.yml              |  25 ++++-
crates/remote_server/src/install_remote_server.sh |   6 +
crates/remote_server/src/setup_tests.rs           |  74 +++++++++++++
script/macos/bundle                               | 129 +++++++++++++++++++++-
4 files changed, 230 insertions(+), 4 deletions(-)

Base branch note

The requested cloud base origin/aloke/remote_code_errors_new was not available (fatal: couldn't find remote ref aloke/remote_code_errors_new / GitHub branch lookup returned 404), so this PR targets master per fallback instructions.

Validation

  • cargo fmt --manifest-path /workspace/warp/Cargo.toml --all
  • cargo test --manifest-path /workspace/warp/Cargo.toml -p remote_server install_script_
    • install_script_avoids_pattern_substitution_for_tilde_expansion
    • install_script_tilde_expansion_resolves_correctly
    • install_script_installs_packaged_lib_directory
  • cargo clippy --manifest-path /workspace/warp/Cargo.toml -p remote_server --tests
    • Passed with pre-existing warnings in warpui_core / warpui; no error after changing the new test to use command::blocking::Command.
  • bash -n script/macos/bundle
  • bash -n crates/remote_server/src/install_remote_server.sh
  • git --no-pager diff --check

Artifact / computer-use proof

This cloud worker is Linux, so macOS-only commands (otool, install_name_tool, xcrun swift-stdlib-tool, codesign, notarytool) and macOS x86_64 dyld launch cannot execute here. I attached the closest reproducible proof artifacts to the Oz run:

  • validation.txt (019e3751-8e89-7944-be3c-80c927b2e02c): validation transcript, Linux limitation note, and synthetic top-level tar layout listing.
  • oz-dev-macos-x86_64.synthetic.tar.gz (019e3751-a3f9-7e99-9c10-c54f34b2fb5c): synthetic tarball showing the intended top-level oz-dev, resources/, and lib/libswiftCore.dylib layout.

The release workflow now performs the host-specific verification on macOS by listing the tarball, checking otool -L for Swift deps, checking LC_RPATH, asserting lib/libswift*.dylib is in the tarball when Swift deps are present, extracting the tarball, and running oz-<channel> --version from the extracted layout.

macOS follow-up commands

Run on a macOS x86_64-capable host or the release_macos_cli workflow:

script/bundle --read-passwords-from-env --channel dev --arch x86_64 --artifact cli
otool -L target/release-cli-debug_assertions/bundle/osx/dev | grep 'libswift\|@rpath'
otool -l target/release-cli-debug_assertions/bundle/osx/dev | grep -A2 LC_RPATH
find target/release-cli-debug_assertions/bundle/osx/lib -name 'libswift*.dylib' -maxdepth 1
# After packaging in CI:
tar tzf oz-dev-macos-x86_64.tar.gz | grep -E '^(oz-dev|resources/|lib/libswift.*\.dylib)'
verify_dir=$(mktemp -d)
tar xzf oz-dev-macos-x86_64.tar.gz -C "$verify_dir"
"$verify_dir/oz-dev" --version

Co-Authored-By: Oz oz-agent@warp.dev

Conversation: https://staging.warp.dev/conversation/e30bebc5-db94-43cf-ae36-cf57f23fdc7a
Run: https://oz.staging.warp.dev/runs/019e3748-d963-7283-b3b4-144d9a132143
This PR was generated with Oz.

Co-Authored-By: Oz <oz-agent@warp.dev>
@cla-bot cla-bot Bot added the cla-signed label May 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant