Skip to content

Revert "Add workaround for building executables with older CMake versions." #641

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
wants to merge 1 commit into from

Conversation

compnerd
Copy link
Member

@compnerd compnerd commented May 7, 2021

Reverts #619

This breaks the Windows build. I'd like to revert this and re-enable it with a fix for Windows.

@compnerd compnerd requested a review from artemcm May 7, 2021 21:37
@compnerd
Copy link
Member Author

compnerd commented May 7, 2021

@swift-ci please test

@compnerd
Copy link
Member Author

compnerd commented May 7, 2021

RPATH is a bad thing to use - please never use it directly, use CMake to control rpaths

@artemcm
Copy link
Contributor

artemcm commented May 7, 2021

Ah. This means that swiftlang/swift#37122 needs to be reverted as well because it depends on it.

@compnerd, #619 is working around the fact that rpath is automatically propagated in CMake >= 3.17, but not 3.16. What would an alternative workaround look like?

@compnerd
Copy link
Member Author

compnerd commented May 7, 2021

Is this for testing purposes or for distribution purposes?

@artemcm
Copy link
Contributor

artemcm commented May 7, 2021

This is for the driver that gets built in the build directory of swift, and gets configured to be the default compiler driver in swiftlang/swift#37122.

For the driver that gets built to be distributed, we have rpaths configured in https://github.com/apple/swift-driver/blob/main/Utilities/build-script-helper.py.

@artemcm
Copy link
Contributor

artemcm commented May 7, 2021

To clarify, when just building swift, and using the build directory compiler, this is used.

When we run --install-swift-driver, rpaths are configured separately in the build-script-helper.py.

@compnerd
Copy link
Member Author

compnerd commented May 7, 2021

The question still stands: is it for testing or do you intend these paths to be used on a random host (this is a problem because rpaths are an attack vector)

@artemcm
Copy link
Contributor

artemcm commented May 7, 2021

This is for use by compiler developers only, in the compiler build directory. It is not meant to be distributed or to be used on a random host.

@compnerd
Copy link
Member Author

compnerd commented May 7, 2021

Ah, okay, then you should be using the BUILD_RPATH property on the targets.

@compnerd
Copy link
Member Author

compnerd commented May 7, 2021

See #642 for a possible fix

@compnerd compnerd closed this May 7, 2021
@compnerd compnerd deleted the revert-619-WorkaroundOlderCMake branch May 7, 2021 22:00
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.

2 participants