Skip to content

Conversation

supersonicbyte
Copy link

Add appropriate -tool suffix to linker flags in dynamic libraries when executing swift package command_plugin.

Motivation:

Resolves the following issue: #9062

Modifications:

Add appropriate -tool suffix to linker flags in dynamic libraries when executing swift package command_plugin.

Result:

Executing swift package command_plugin with dynamic dependencies works.

@supersonicbyte
Copy link
Author

@swift-ci test

1 similar comment
@owenv
Copy link
Contributor

owenv commented Sep 5, 2025

@swift-ci test

Copy link
Contributor

@owenv owenv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. Could you please add a test to CommandPluginTests in PackageCommandTests.swift that covers this case?

@supersonicbyte
Copy link
Author

lgtm. Could you please add a test to CommandPluginTests in PackageCommandTests.swift that covers this case?

ofc!

@supersonicbyte
Copy link
Author

@owenv added, can you run the CI please?

@owenv
Copy link
Contributor

owenv commented Sep 5, 2025

@swift-ci test

}
}

@Test(arguments: getBuildData(for: SupportedBuildSystemOnAllPlatforms))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's ok to wrap this in something like this for now to get to a passing CI run:

withKnownIssue {
} when: {
                ProcessInfo.hostOperatingSystem == .windows
                    || (ProcessInfo.hostOperatingSystem == .linux && data.buildSystem == .swiftbuild)
            }

There are some unrelated issues setting up the runtime library paths on linux for plugin executables which I haven't fixed yet.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrapped! thanks.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@owenv can you rerun the CI again, please?

@supersonicbyte
Copy link
Author

@swift-ci test

@hassila
Copy link

hassila commented Sep 8, 2025

Not sure what the proper process is as this affects both Darwin and Linux, but if possible to cherry-pick this for a future 6.2 it would be fantastic as it would unblock the work in progress for ordo-one/package-benchmark#318 - currently there is no way to do that with a plugin without breaking benchmark users CI.

@plemarquand
Copy link
Contributor

@swift-ci test

@plemarquand
Copy link
Contributor

@swift-ci test windows

@supersonicbyte
Copy link
Author

@owenv @plemarquand not sure what's with the windows build?

@owenv
Copy link
Contributor

owenv commented Sep 12, 2025

Sorry, missed this - I think a retry may address it

@swift-ci test Windows

@owenv
Copy link
Contributor

owenv commented Sep 13, 2025

Windows seems to be hitting some repeated infra timeout, which should be unrelated to the change here

@swift-ci please test Windows

@owenv
Copy link
Contributor

owenv commented Sep 14, 2025

latest run

× Test commandPluginDynamicDependencies(buildData:) recorded an issue with 1 argument buildData → BuildData(buildSystem: SPMBuildCore.BuildSystemProvider.Kind.native, config: PackageModel.BuildConfiguration.debug) at PackageCommandTests.swift:7115:38: Known issue was not recorded

looks like the known issue is a little too broad

@supersonicbyte
Copy link
Author

latest run

× Test commandPluginDynamicDependencies(buildData:) recorded an issue with 1 argument buildData → BuildData(buildSystem: SPMBuildCore.BuildSystemProvider.Kind.native, config: PackageModel.BuildConfiguration.debug) at PackageCommandTests.swift:7115:38: Known issue was not recorded

looks like the known issue is a little too broad

removed windows from the known issue, could you run the CI again please?

@owenv
Copy link
Contributor

owenv commented Sep 15, 2025

I suspect this is still going to fail when the host is Windows and buildSystem == .swiftbuild, but let's give it a try in the meantime

@swift-ci test

@supersonicbyte
Copy link
Author

I suspect this is still going to fail when the host is Windows and buildSystem == .swiftbuild, but let's give it a try in the meantime

@swift-ci test

ok, fixed the when condition to:

(ProcessInfo.hostOperatingSystem == .windows && buildData.buildSystem == .swiftbuild) || (ProcessInfo.hostOperatingSystem == .linux && buildData.buildSystem == .swiftbuild)

@owenv
Copy link
Contributor

owenv commented Sep 15, 2025

@swift-ci test

@owenv
Copy link
Contributor

owenv commented Sep 15, 2025

just going to assign this to myself so I don't lose track. Thanks for your patience working through the test issues

@owenv owenv self-assigned this Sep 15, 2025
@owenv
Copy link
Contributor

owenv commented Sep 15, 2025

@swift-ci test Windows

@supersonicbyte
Copy link
Author

just going to assign this to myself so I don't lose track. Thanks for your patience working through the test issues

No problem, thank you for your assistance!

@supersonicbyte
Copy link
Author

The Swift Test Windows Platform seems to be really stubborn.
The latest fail is related to some foundation tests...

Error: Error: swift exited with code 1.
Invocation:
  swift test --scratch-path T:\x86_64-unknown-windows-msvc\FoundationTests --package-path C:\Users\swift-ci\jenkins\workspace\swiftpm-PR-windows\swift-corelibs-foundation -c release -debug-info-format none --multiroot-data-file C:\Users\swift-ci\jenkins\workspace\swiftpm-PR-
....

@owenv
Copy link
Contributor

owenv commented Sep 16, 2025

foundation was broken for a few hours yesterday

@swift-ci test Windows

@owenv owenv enabled auto-merge (squash) September 16, 2025 16:15
@owenv
Copy link
Contributor

owenv commented Sep 17, 2025

@swift-ci test self hosted

1 similar comment
@owenv
Copy link
Contributor

owenv commented Sep 17, 2025

@swift-ci test self hosted

@owenv
Copy link
Contributor

owenv commented Sep 17, 2025

now hitting #9150

@owenv
Copy link
Contributor

owenv commented Sep 18, 2025

@swift-ci test

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.

5 participants