Skip to content

Package Swift stdlibs with macOS CLI#11159

Open
alokedesai wants to merge 1 commit into
masterfrom
oz/swift-dylib-packaging-local
Open

Package Swift stdlibs with macOS CLI#11159
alokedesai wants to merge 1 commit into
masterfrom
oz/swift-dylib-packaging-local

Conversation

@alokedesai
Copy link
Copy Markdown
Member

Description

Adds Swift runtime sidecar packaging for the standalone macOS CLI/remote-server artifact:

  • Adds CLI rpaths for /usr/lib/swift and @executable_path/lib, preferring system Swift libraries on modern macOS while preserving a sidecar fallback layout.
  • Uses xcrun swift-stdlib-tool during script/macos/bundle --artifact cli to collect required libswift*.dylib files into bundle/osx/lib.
  • Includes lib in the macOS CLI release tarball alongside the binary and resources.
  • Updates install_remote_server.sh to safely install an extracted lib/ sidecar to $install_dir/lib without changing the installed binary path.
  • Adds a focused installer regression test for the lib/ sidecar path.

Note: the originally requested remote base branch aloke/remote_code_errors_new was not present on origin, so this PR targets master.

Linked Issue

  • The linked issue is labeled ready-to-spec or ready-to-implement.
  • Where appropriate, screenshots or a short video of the implementation are included below (especially for user-visible or UI changes).

Testing

  • bash -n script/macos/bundle

  • cargo fmt

  • cargo test -p remote_server install_script

    • 3 passed: tilde expansion regressions plus install_script_installs_lib_sidecar_without_changing_binary_path
  • cargo clippy --workspace --all-targets --all-features --tests -- -D warnings

  • Built native arm64 CLI:

    • script/macos/bundle --nosign --channel dev --arch aarch64 --artifact cli
    • xcrun swift-stdlib-tool copied 0 sidecar dylibs for arm64 on this toolchain.
    • otool -L target/release-cli-debug_assertions/bundle/osx/dev | grep libswiftCore shows /usr/lib/swift/libswiftCore.dylib.
    • otool -l target/release-cli-debug_assertions/bundle/osx/dev shows LC_RPATH entries for /usr/lib/swift and @executable_path/lib.
    • Packaged/extracted dev resources lib; /tmp/warp-cli-swift-validation-arm/dev --version returned Oz <unknown>.
  • Built/validated x86_64 CLI under Rosetta:

    • script/macos/bundle --nosign --skip-build --channel dev --arch x86_64 --artifact cli
    • Archive includes lib/libswiftCore.dylib plus 14 other libswift*.dylib sidecars.
    • otool -L target/release-cli-debug_assertions/bundle/osx/dev | grep libswiftCore shows @rpath/libswiftCore.dylib.
    • LC_RPATH order is /usr/lib/swift first, then @executable_path/lib, so modern macOS uses the system Swift runtime while older systems can fall back to the sidecar.
    • Packaged/extracted dev resources lib; arch -x86_64 /tmp/warp-cli-swift-validation-x86/dev --version returned Oz <unknown>.
  • I have manually tested my changes locally with ./script/run

Screenshots / Videos

Not applicable; packaging/install-script change only.

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI Agent Mode

CHANGELOG-NONE

Conversation: https://staging.warp.dev/conversation/4b3780e8-e12c-49d9-9f22-ad954f52070f

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

Co-Authored-By: Oz <oz-agent@warp.dev>
@cla-bot cla-bot Bot added the cla-signed label May 17, 2026
@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 17, 2026

@alokedesai

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview

This PR updates the macOS CLI packaging flow to add Swift runtime rpaths, collect Swift stdlib sidecars into the bundle, include the sidecar lib/ directory in release archives, and install that directory alongside the remote-server binary. It also adds a focused installer regression test for the new sidecar layout.

Concerns

  • No blocking correctness, error-handling, or security concerns found in the changed lines.

Verdict

Found: 0 critical, 0 important, 0 suggestions

Approve

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

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