Skip to content

Commit 838e783

Browse files
committed
Reconstruct missing symbolic links if needed
1 parent c23325b commit 838e783

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

packages/host/src/node/cli/apple.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,15 @@ export async function linkVersionedFramework({
201201
"darwin",
202202
"Linking Apple addons are only supported on macOS",
203203
);
204+
// Reconstruct missing symbolic links if needed
205+
const versionAPath = path.join(frameworkPath, "Versions", "A");
206+
const versionCurrentPath = path.join(frameworkPath, "Versions", "Current");
207+
if (fs.existsSync(versionAPath) && !fs.existsSync(versionCurrentPath)) {
208+
await fs.promises.symlink(
209+
path.relative(path.dirname(versionCurrentPath), versionAPath),
210+
versionCurrentPath,
211+
);
212+
}
204213
const frameworkInfoPath = path.join(
205214
frameworkPath,
206215
"Versions",
@@ -209,6 +218,23 @@ export async function linkVersionedFramework({
209218
"Info.plist",
210219
);
211220
const frameworkInfo = await readFrameworkInfo(frameworkInfoPath);
221+
const libraryRealPath = path.join(
222+
frameworkPath,
223+
"Versions",
224+
"Current",
225+
frameworkInfo.CFBundleExecutable,
226+
);
227+
const libraryLinkPath = path.join(
228+
frameworkPath,
229+
frameworkInfo.CFBundleExecutable,
230+
);
231+
// Reconstruct missing symbolic links if needed
232+
if (fs.existsSync(libraryRealPath) && !fs.existsSync(libraryLinkPath)) {
233+
await fs.promises.symlink(
234+
path.relative(path.dirname(libraryLinkPath), libraryRealPath),
235+
libraryLinkPath,
236+
);
237+
}
212238
// Update install name
213239
await spawn(
214240
"install_name_tool",

0 commit comments

Comments
 (0)