Skip to content

Conversation

jakepetroules
Copy link
Collaborator

@jakepetroules jakepetroules commented Aug 27, 2025

This also required a bit of a rethink of the plugin manager now that actor isolation checking is enabled for types defined in SWBUtil. We introduce a new plugin manager type and cover protocol representing an immutable view of the plugin loading state. This is constructed from the mutable plugin manager just prior to core initialization, ensuring Core and everything underneath it have a completely immutable view of the plugin loading state, without having to worry about async/actors, making all of the extension points accessible from synchronous nonisolated code.

@jakepetroules
Copy link
Collaborator Author

@swift-ci test

This also required a bit of a rethink of the plugin manager now that actor isolation checking is enabled for types defined in SWBUtil. We introduce a new plugin manager type and cover protocol representing an immutable view of the plugin loading state. This is constructed from the mutable plugin manager just prior to core initialization, ensuring Core and everything underneath it have a completely immutable view of the plugin loading state, without having to worry about async/actors, making all of the extension points accessible from synchronous nonisolated code.
@jakepetroules jakepetroules force-pushed the eng/PR-swbutil-swift6 branch from 54edb9b to e80c447 Compare August 28, 2025 07:43
@jakepetroules
Copy link
Collaborator Author

@swift-ci test

@jakepetroules jakepetroules merged commit cb41070 into swiftlang:main Aug 28, 2025
36 checks passed
@jakepetroules jakepetroules deleted the eng/PR-swbutil-swift6 branch August 28, 2025 08:23
@Steelskin
Copy link
Contributor

Heads-up, this broke our CI:

[10/52] Linking Swift shared library bin\SWBUtil.dll
FAILED: [code=1120] bin/SWBUtil.dll lib/SWBUtil.lib 
C:\Windows\system32\cmd.exe /C "cd . && D:\r\_work\swift-build\swift-build\BinaryCache\Library\Developer\Toolchains\0.0.0+Asserts\usr\bin\swiftc.exe -target x86_64-unknown-windows-msvc -j 16 -num-threads 16 -emit-library -sdk D:\r\_work\swift-build\swift-build\BinaryCache\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk  -g -debug-info-format=codeview -Xlinker -debug -Xlinker -incremental:no -Xlinker -opt:ref -Xlinker -opt:icf -O -swift-version 5 -libc MD   -Xlinker -implib:lib\SWBUtil.lib   -o bin\SWBUtil.dll @CMakeFiles\SWBUtil.rsp && cd ."
<unknown>:0: warning: using (deprecated) legacy driver, Swift installation does not contain swift-driver at: 'D:\r\_work\swift-build\swift-build\BinaryCache\Library\Developer\Toolchains\0.0.0+Asserts\usr\bin\swift-driver-new.exe'
   Creating library lib\SWBUtil.lib and object lib\SWBUtil.exp
Misc.swift.obj : error LNK2019: unresolved external symbol swb_stdout referenced in function $s7SWBUtil20FILETextOutputStreamV6stdoutACvgZ
Misc.swift.obj : error LNK2019: unresolved external symbol swb_stderr referenced in function $s7SWBUtil20FILETextOutputStreamV6stderrACvgZ
bin\SWBUtil.dll : fatal error LNK1120: 2 unresolved externals
clang: error: linker command failed with exit code 1120 (use -v to see invocation)

I believe Swift CI will soon break too on this build: https://ci-external.swift.org/job/swift-main-windows-toolchain/1554/

extern FILE * const swb_stdout();
extern FILE * const swb_stderr();

FILE * const swb_stdout() {
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe this and swb_stderr() below need to be marked with __declspec(dllexport) on Windows.

Copy link
Contributor

Choose a reason for hiding this comment

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

#751 might fix it, I'll run it on our CI to 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.

3 participants