Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing lib/ directory in Ubuntu Noble SDK, remove unused toolchain components #193

Merged

Conversation

xtremekforever
Copy link
Contributor

@xtremekforever xtremekforever commented Mar 2, 2025

Apparently I didn't test very well from PR #188, because when I went to use the Ubuntu Noble Swift SDK, I got this error:

error: link command failed with exit code 1 (use -v to see invocation)
ld.lld: error: ~/.swiftpm/swift-sdks/6.0.3-RELEASE_ubuntu_noble_aarch64.artifactbundle/6.0.3-RELEASE_ubuntu_noble_aarch64/aarch64-unknown-linux-gnu/ubuntu-noble.sdk/usr/lib/aarch64-linux-gnu/libm.so:4: cannot find /lib/aarch64-linux-gnu/libm.so.6 inside ~/.swiftpm/swift-sdks/6.0.3-RELEASE_ubuntu_noble_aarch64/aarch64-unknown-linux-gnu/ubuntu-noble.sdk
>>> GROUP ( /lib/aarch64-linux-gnu/libm.so.6  AS_NEEDED ( /lib/aarch64-linux-gnu/libmvec.so.1 ) )
>>>         ^
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ld.lld: error: ~/.swiftpm/swift-sdks/6.0.3-RELEASE_ubuntu_noble_aarch64.artifactbundle/6.0.3-RELEASE_ubuntu_noble_aarch64/aarch64-unknown-linux-gnu/ubuntu-noble.sdk/usr/lib/aarch64-linux-gnu/libm.so:4: cannot find /lib/aarch64-linux-gnu/libm.so.6 inside /~/.swiftpm/swift-sdks/6.0.3-RELEASE_ubuntu_noble_aarch64.artifactbundle/6.0.3-RELEASE_ubuntu_noble_aarch64/aarch64-unknown-linux-gnu/ubuntu-noble.sdk
>>> GROUP ( /lib/aarch64-linux-gnu/libm.so.6  AS_NEEDED ( /lib/aarch64-linux-gnu/libmvec.so.1 ) )
>>>         ^

Turns out, the packages for Ubuntu Noble do not come with a lib/ symlink included, so all I needed was to add a custom step to create that symlink from ubuntu-noble.sdk/lib -> ubuntu-noble.sdk/usr/lib and all is well.

As a part of these changes, I also added a missing cleanup of the target toolchain to remove unused parts of the LinuxRecipe as is done for the WebAssemblyRecipe. Doing this reduces the size of ubuntu-noble.sdk from 1GB to 721MB, when building the Swift SDK without docker. This can help for the end-to-end tests, and is nice to have for smaller Swift SDK distributions.

Finally, I updated the EndToEndTests to provide linuxDistributionVersion and set the Swift60_Ubuntu tests to use "24.04" as a way to test this lib/ directory fix. This has me thinking we may want to think about end-to-end tests for each version of Ubuntu, like "20.04", "22.04", and "24.04", for each version of Swift. What do you think @euanh ?

@MaxDesiatov MaxDesiatov requested a review from euanh March 3, 2025 09:32
@MaxDesiatov
Copy link
Contributor

@swift-ci test

@MaxDesiatov MaxDesiatov added the bug Something isn't working label Mar 3, 2025
@euanh
Copy link
Contributor

euanh commented Mar 3, 2025

[901/1037] Emitting module NIOCore
/code/.build/checkouts/swift-nio/Sources/NIOCore/AsyncSequences/NIOAsyncWriter.swift:545:24: error: cannot infer contextual base in reference to member 'lock'
 543 |                 // We are manually locking here to hold the lock across the withCheckedContinuation call
 544 |                 let unsafe = self._state.unsafe
 545 |                 unsafe.lock()
     |                        `- error: cannot infer contextual base in reference to member 'lock'
 546 | 
 547 |                 let action = unsafe.withValueAssumingLockIsAcquired {
 ...

@MaxDesiatov
Copy link
Contributor

main snapshot job doesn't block us so we can merge it if needed. This is a (hopefully temporary) regression reported in apple/swift-nio#3124

@MaxDesiatov
Copy link
Contributor

MaxDesiatov commented Mar 3, 2025

Supposedly fixed in swiftlang/swift#79710, which I expect would be included in a forthcoming main snapshot.

@MaxDesiatov
Copy link
Contributor

@swift-ci test

@MaxDesiatov MaxDesiatov enabled auto-merge (squash) March 3, 2025 12:58
@MaxDesiatov MaxDesiatov disabled auto-merge March 3, 2025 12:58
@MaxDesiatov MaxDesiatov enabled auto-merge (squash) March 3, 2025 12:58
@MaxDesiatov MaxDesiatov merged commit df46d2f into swiftlang:main Mar 3, 2025
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants