-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Properly compute resource folder when linking statically #33168
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
Conversation
drexin
commented
Jul 28, 2020
- deduplicate the logic to compute the resource folder
- install headers and module files in shared and static resource folders
- forward -static flag when calling swiftc with -print-target-info
@swift-ci test |
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.
Could you please add a test for the driver path computation?
ff6ad6f
to
03c9b00
Compare
Build failed |
bb45c3f
to
fdf9d32
Compare
@swift-ci test |
Build failed |
@swift-ci test |
fdf9d32
to
2845806
Compare
@swift-ci test |
Build failed |
2845806
to
9da99a1
Compare
@swift-ci test |
Build failed |
Build failed |
9da99a1
to
6309e01
Compare
@swift-ci test |
Build failed |
6309e01
to
3eeb03d
Compare
@swift-ci test |
@swift-ci test windows |
Build failed |
3eeb03d
to
f8ccbdd
Compare
@swift-ci test |
Build failed |
f8ccbdd
to
51c96fb
Compare
@swift-ci test |
Build failed |
Build failed |
Build failed |
@swift-ci test linux |
Build failed |
a3c4f72
to
18c4354
Compare
@swift-ci test |
Build failed |
Build failed |
18c4354
to
6c6dd27
Compare
@swift-ci test |
Build failed |
Build failed |
6c6dd27
to
e82c012
Compare
@swift-ci test windows |
Build failed |
@swift-ci test windows |
- deduplicate the logic to compute the resource folder - install headers and module files in shared and static resource folders - forward -static flag when calling swiftc with -print-target-info
e82c012
to
0850436
Compare
@swift-ci smoke test |
@swift-ci smoke test windows |
1 similar comment
@swift-ci smoke test windows |
if (const Arg *A = args.getLastArg(options::OPT_resource_dir)) { | ||
StringRef value = A->getValue(); | ||
resourceDirPath.append(value.begin(), value.end()); | ||
} else if (!getTriple().isOSDarwin() && args.hasArg(options::OPT_sdk)) { | ||
StringRef value = args.getLastArg(options::OPT_sdk)->getValue(); | ||
resourceDirPath.append(value.begin(), value.end()); | ||
llvm::sys::path::append(resourceDirPath, "usr", "lib", | ||
shared ? "swift" : "swift_static"); | ||
llvm::sys::path::append(resourceDirPath, "usr"); |
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.
Why are we adding <resource-dir>/usr
now?
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 are using the SDK root here as opposed to the path relative to the executable. In the executable case we get something like $PATH/bin/swiftc
and remove the bin/swiftc
part from it and append lib/swift[_static]
. The SDK path starts one level above that, so we have to add usr
only in this case.