Skip to content

Do not create dangling symlink in Android SDK artifactbundle#537

Draft
marcprux wants to merge 1 commit intoswiftlang:mainfrom
swift-android-sdk:dangling-symlink
Draft

Do not create dangling symlink in Android SDK artifactbundle#537
marcprux wants to merge 1 commit intoswiftlang:mainfrom
swift-android-sdk:dangling-symlink

Conversation

@marcprux
Copy link
Copy Markdown
Contributor

Fixes #535

@marcprux marcprux marked this pull request as ready for review March 25, 2026 14:44
@marcprux marcprux requested a review from shahmishal as a code owner March 25, 2026 14:44
@finagolfin
Copy link
Copy Markdown
Member

Have you tested building with this locally?

@marcprux
Copy link
Copy Markdown
Contributor Author

Have you tested building with this locally?

No. TBH, I was hoping to get this in and then test the resulting .artifactbundle that gets produced…

@finagolfin
Copy link
Copy Markdown
Member

OK, let me test it locally, then we can get this in. No hurry, as the next patch release likely won't be till next month.

@jakepetroules
Copy link
Copy Markdown

Thanks for the quick fix. However, please note that there are multiple dangling symlinks:

$ find . -type l
./swift-android/swift-resources/usr/lib/swift_static-aarch64/clang
./swift-android/swift-resources/usr/lib/swift-armv7/clang
./swift-android/swift-resources/usr/lib/swift_static-armv7/clang
./swift-android/swift-resources/usr/lib/swift-x86_64/clang
./swift-android/swift-resources/usr/lib/swift/clang
./swift-android/swift-resources/usr/lib/swift_static-x86_64/clang
./swift-android/swift-resources/usr/lib/swift-aarch64/clang

./swift-android/swift-resources/usr/lib/swift/clang is the one that points to the absolute path, while the other 6 are pointing to ../swift/clang, so they themselves will become dangling once this one is removed.

Can you remove the others as well and have the script create them on demand?

Since the script is no longer needed with SwiftPM's Swift Build backend, I'd like to avoid baking in assumptions that the script will be run (and then we can simply remove the script in 6.5 or 6.6 or whenever we end up removing the legacy build backend).

@marcprux
Copy link
Copy Markdown
Contributor Author

Can you remove the others as well and have the script create them on demand?

Ahh, I thought only the absolute symlink was the issue.

I agree that we should move that link creation over to the post-install script, but that will require a bit more careful work, since those dangling symlinks are currently being "filled in" by the post-install script. We will instead need to make the script perform the link creation instead.

(and then we can simply remove the script in 6.5 or 6.6 or whenever we end up removing the legacy build backend)

I look forward to that future 😶

@marcprux marcprux marked this pull request as draft March 26, 2026 00:57
@finagolfin
Copy link
Copy Markdown
Member

Oh, I think I remember now why we put it in: we added the other symlinks to this central one, then archiving the bundle failed or something if they were all pointing at a non-existent symlink, so I put this in as a place-holder.

I will confirm that is the reason and let you know, but either way, we'll likely need to ship with all of them, or add all of them after installation.

@finagolfin
Copy link
Copy Markdown
Member

I'm building locally now without that last symlink, will let you know what I find.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Swift 6.3 SDK for Android has dangling clang symlinks with absolute paths

3 participants