@@ -28,8 +28,7 @@ import Workspace
2828extension PIFBuilderParameters {
2929 static func constructDefaultParametersForTesting(
3030 temporaryDirectory: Basics . AbsolutePath ,
31- addLocalRpaths: Bool ,
32- addLocalRpathsInReleaseConfiguration: Bool = true ,
31+ addLocalRpaths: PackagePIFBuilder . AddLocalRpaths ,
3332 shouldCreateDylibForDynamicProducts: Bool = false ,
3433 pluginScriptRunner: PluginScriptRunner ? = nil
3534 ) throws -> Self {
@@ -50,16 +49,14 @@ extension PIFBuilderParameters {
5049 disableSandbox: false ,
5150 pluginWorkingDirectory: temporaryDirectory. appending ( component: " plugin-working-dir " ) ,
5251 additionalFileRules: [ ] ,
53- addLocalRPaths: addLocalRpaths,
54- addLocalRpathsInReleaseConfiguration: addLocalRpathsInReleaseConfiguration
52+ addLocalRpaths: addLocalRpaths
5553 )
5654 }
5755}
5856
5957fileprivate func withGeneratedPIF(
6058 fromFixture fixtureName: String ,
61- addLocalRpaths: Bool = true ,
62- addLocalRpathsInReleaseConfiguration: Bool = true ,
59+ addLocalRpaths: PackagePIFBuilder . AddLocalRpaths = . always,
6360 shouldCreateDylibForDynamicProducts: Bool = true ,
6461 buildParameters: BuildParameters ? = nil ,
6562 hostBuildParameters: BuildParameters ? = nil ,
@@ -97,7 +94,6 @@ fileprivate func withGeneratedPIF(
9794 parameters: try PIFBuilderParameters . constructDefaultParametersForTesting (
9895 temporaryDirectory: fixturePath,
9996 addLocalRpaths: addLocalRpaths,
100- addLocalRpathsInReleaseConfiguration: addLocalRpathsInReleaseConfiguration,
10197 shouldCreateDylibForDynamicProducts: shouldCreateDylibForDynamicProducts
10298 ) ,
10399 fileSystem: localFileSystem,
@@ -388,7 +384,7 @@ struct PIFBuilderTests {
388384 graph: graph,
389385 parameters: try PIFBuilderParameters . constructDefaultParametersForTesting (
390386 temporaryDirectory: AbsolutePath . root. appending ( " tmp " ) ,
391- addLocalRpaths: true ,
387+ addLocalRpaths: . always ,
392388 ) ,
393389 fileSystem: fs,
394390 observabilityScope: observabilityScope. topScope,
@@ -717,7 +713,7 @@ struct PIFBuilderTests {
717713 }
718714 }
719715
720- try await withGeneratedPIF ( fromFixture: " Miscellaneous/Simple " , addLocalRpaths: false ) { pif, observabilitySystem in
716+ try await withGeneratedPIF ( fromFixture: " Miscellaneous/Simple " , addLocalRpaths: . never ) { pif, observabilitySystem in
721717 #expect( observabilitySystem. diagnostics. filter {
722718 $0. severity == . error
723719 } . isEmpty)
@@ -742,10 +738,10 @@ struct PIFBuilderTests {
742738 }
743739 }
744740
745- @Test func disablingLocalRpathsInReleaseConfiguration ( ) async throws {
741+ @Test func debugOnlyLocalRpaths ( ) async throws {
746742 try await withGeneratedPIF (
747743 fromFixture: " Miscellaneous/Simple " ,
748- addLocalRpathsInReleaseConfiguration : false
744+ addLocalRpaths : . debugOnly
749745 ) { pif, observabilitySystem in
750746 #expect( observabilitySystem. diagnostics. filter {
751747 $0. severity == . error
@@ -769,34 +765,6 @@ struct PIFBuilderTests {
769765 #expect( releaseConfig. impartedBuildProperties. settings [ . LD_RUNPATH_SEARCH_PATHS] == nil )
770766 }
771767 }
772-
773- try await withGeneratedPIF (
774- fromFixture: " Miscellaneous/Simple " ,
775- addLocalRpaths: false ,
776- addLocalRpathsInReleaseConfiguration: false
777- ) { pif, observabilitySystem in
778- #expect( observabilitySystem. diagnostics. filter {
779- $0. severity == . error
780- } . isEmpty)
781-
782- do {
783- let debugConfig = try pif. workspace
784- . project ( named: " Foo " )
785- . target ( named: " Foo " )
786- . buildConfig ( named: . debug)
787-
788- #expect( debugConfig. impartedBuildProperties. settings [ . LD_RUNPATH_SEARCH_PATHS] == nil )
789- }
790-
791- do {
792- let releaseConfig = try pif. workspace
793- . project ( named: " Foo " )
794- . target ( named: " Foo " )
795- . buildConfig ( named: . release)
796-
797- #expect( releaseConfig. impartedBuildProperties. settings [ . LD_RUNPATH_SEARCH_PATHS] == nil )
798- }
799- }
800768 }
801769
802770 @Test func warningSettingsInRemotePackage( ) async throws {
@@ -900,7 +868,7 @@ struct PIFBuilderTests {
900868 graph: graph,
901869 parameters: try PIFBuilderParameters . constructDefaultParametersForTesting (
902870 temporaryDirectory: AbsolutePath . root,
903- addLocalRpaths: true
871+ addLocalRpaths: . always
904872 ) ,
905873 fileSystem: fs,
906874 observabilityScope: observability. topScope
@@ -1038,7 +1006,7 @@ struct PIFBuilderTests {
10381006 graph: graph,
10391007 parameters: try PIFBuilderParameters . constructDefaultParametersForTesting (
10401008 temporaryDirectory: AbsolutePath . root. appending ( " tmp " ) ,
1041- addLocalRpaths: true
1009+ addLocalRpaths: . always
10421010 ) ,
10431011 fileSystem: fs,
10441012 observabilityScope: observability. topScope
@@ -1132,7 +1100,7 @@ struct PIFBuilderTests {
11321100 graph: graph,
11331101 parameters: try PIFBuilderParameters . constructDefaultParametersForTesting (
11341102 temporaryDirectory: AbsolutePath . root. appending ( " tmp " ) ,
1135- addLocalRpaths: true
1103+ addLocalRpaths: . always
11361104 ) ,
11371105 fileSystem: fs,
11381106 observabilityScope: observability. topScope
0 commit comments