Skip to content

Commit e38e5f1

Browse files
voxelbeeclaude
andcommitted
fix(cli): always copy dylibs into iOS Frameworks/ (never symlink)
`installd` rejects any symlinks inside an iOS app's `Frameworks/` directory, so `dx serve --ios` failed to install bundles whenever `write_frameworks` took the dev-mode symlink fast path: invalid symlink at .../Ponderosa.app/Frameworks/libFoo.dylib `dx bundle` worked because the release profile already falls through to the `fs::copy` branch. Gate both symlink sites in `write_frameworks` off when the target OS is iOS so dev builds copy real files, matching what `installd` requires. Other Unix targets keep the existing symlink-for-speed behavior. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent a6a5115 commit e38e5f1

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

packages/cli/src/build/request.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2127,6 +2127,11 @@ impl BuildRequest {
21272127
) -> Result<()> {
21282128
let framework_dir = self.frameworks_folder();
21292129

2130+
// iOS `installd` rejects any symlinks inside `Frameworks/` (both on-device
2131+
// and on the simulator), so we must always copy real files on iOS — even in
2132+
// dev builds, where we'd otherwise symlink for speed.
2133+
let is_ios = matches!(self.triple.operating_system, OperatingSystem::IOS(_));
2134+
21302135
// We use the rustc for the tip crate `main.rs` because that's where the linking happens
21312136
let direct_rustc = artifacts
21322137
.workspace_rustc_args
@@ -2173,7 +2178,7 @@ impl BuildRequest {
21732178
_ = std::fs::remove_file(&to);
21742179
_ = std::fs::create_dir_all(&framework_dir);
21752180
tracing::debug!("Copying framework from {candidate:?} to {to:?}");
2176-
if cfg!(unix) && !self.release {
2181+
if cfg!(unix) && !self.release && !is_ios {
21772182
#[cfg(unix)]
21782183
std::os::unix::fs::symlink(&candidate, &to).with_context(|| {
21792184
"Failed to symlink framework into bundle: {candidate:?} -> {to:?}"
@@ -2202,8 +2207,10 @@ impl BuildRequest {
22022207
_ = std::fs::create_dir_all(&framework_dir);
22032208

22042209
// in dev and on normal oses, we want to symlink the file
2205-
// otherwise, just copy it (since in release you want to distribute the framework)
2206-
if cfg!(any(windows, unix)) && !self.release {
2210+
// otherwise, just copy it (since in release you want to distribute the framework).
2211+
// iOS is an exception: `installd` rejects symlinks in `Frameworks/`, so we
2212+
// always copy real files on iOS regardless of profile.
2213+
if cfg!(any(windows, unix)) && !self.release && !is_ios {
22072214
#[cfg(windows)]
22082215
std::os::windows::fs::symlink_file(from, to).with_context(|| {
22092216
"Failed to symlink framework into bundle: {from:?} -> {to:?}"

0 commit comments

Comments
 (0)