-
Notifications
You must be signed in to change notification settings - Fork 1.4k
SR-7154: swiftpm tests fail if --debug-foundation option is used. #1544
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
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we put a symlink in the fake toolchain instead of using LD_LIBRARY_PATH or that doesn't work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can do it that way and it was the original way I had it working, however it also requires adding a symlink in Foundation's build directory as well. The other downside is that if in the future more libraries get built by the main swift repo in addition to
libswiftCore.so
andlibswiftSwiftOnone.so
then symlinks will also be required there.However thinking about it, this
LD_LIBRARY_PATH
could possibly be exported in theswift/utils/build-script-impl
script the same way it is setup when runningTestFoundation
(see https://github.com/spevans/swift/blob/ce45ea3eeaca9a30e257be7fbe5746a67d5b2788/utils/build-script-impl#L2950) and then this change wouldnt be required.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have several tests in SwiftPM that build Swift packages in debug mode. I don't understand why we don't hit the same problem there. @jrose-apple said these libraries can be considered part of stdlib.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it matters whether the packages that SwiftPM builds are in debug or release mode but whether the
libFoundation.so
they link to is in release or debug mode. In debug mode it links tolibswiftSwiftOnone.so
which it can't find in the build directories without this path.The
--debug-foundation
flag controls whether thelibFoundation.so
is built in debug mode.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jrose-apple said these libraries are required if something is being built with
-Onone
and we have several test packages that are built with-Onone
. Presence of libFoundation.so shouldn't matter.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we have an investigation on this behavior and why and how it affects SwiftPM tests? It is blocking Foundation adoption of
@testable import
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When you build with -Onone, you gain a dependency on libswiftSwiftOnoneSupport.so/.a (yes, it's silly that there are two "swift"s in there). It shouldn't have anything to do with
@testable import
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll take a closer look tomm...