-
Notifications
You must be signed in to change notification settings - Fork 10.5k
test: add and use prefix substitutions for libraries #21152
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
@swift-ci please test |
@@ -1,15 +1,15 @@ | |||
// RUN: %empty-directory(%t) | |||
|
|||
// RUN: %target-build-swift-dylib(%t/libresilient_struct.%target-dylib-extension) -Xfrontend -enable-resilience -Xfrontend -enable-class-resilience %S/../../Inputs/resilient_struct.swift -emit-module -emit-module-path %t/resilient_struct.swiftmodule -module-name resilient_struct | |||
// RUN: %target-codesign %t/libresilient_struct.%target-dylib-extension | |||
// RUN: %target-build-swift-dylib(%t/%{target-shared-library-prefix}resilient_struct%{target-shared-library-suffix}) -Xfrontend -enable-resilience -Xfrontend -enable-class-resilience %S/../../Inputs/resilient_struct.swift -emit-module -emit-module-path %t/resilient_struct.swiftmodule -module-name resilient_struct |
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.
This pattern is very verbose. Maybe we should make it another regex-based substitution? %target-shared-library(resilient_struct)
.
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 tried to do that, but failed at that, but I thought it would be possible to do that substitution. But, since you also seem to think that it should be possible to have that substitution, I want to give that a second shot.
@swift-ci please test |
Build failed |
Build failed |
521373d
to
cf07dac
Compare
@swift-ci please test |
Build failed |
Build failed |
The naming convention is different on Windows than on Unix-like environments. In order to follow the convention we need to substitute the prefix and the suffix. Take the opportunity to rename the `target-dylib-extension` to the CMake-like variable `target-shared-library-suffix` and introduce `target-shared-library-prefix`. This helps linking the test suite binaries on Windows.
cf07dac
to
8968fca
Compare
@jrose-apple - so, I ran into the same problem as last time, the substitution within the capture doesn't work right and I can't seem to identify how to get that to work (even with a braced version, it doesn't seem to do the substitution correctly). However, wherever possible, I am now using the |
@swift-ci please test |
Build failed |
lit substitutions are ordered, so just to check: did you try putting your new substitution either before or after the existing substitution, whichever one you hadn't done yet? |
That does the trick! Thanks! |
Thanks to @jrose for the hint about the substitution ordering, the new substitution now works even inside the capture group. Replace the remaining uses to the new macro.
@swift-ci please test and merge |
The naming convention is different on Windows than on Unix-like
environments. In order to follow the convention we need to substitute
the prefix and the suffix. Take the opportunity to rename the
target-dylib-extension
to the CMake-like variabletarget-shared-library-suffix
and introducetarget-shared-library-prefix
. This helps linking the test suitebinaries on Windows.
Replace this paragraph with a description of your changes and rationale. Provide links to external references/discussions if appropriate.
Resolves SR-NNNN.