Skip to content

jextract: Evaluate IfConfigDecl and add --static-build-config option 2#678

Merged
ktoso merged 17 commits intoswiftlang:mainfrom
sidepelican:evaluate_ifConfigDecl
Apr 7, 2026
Merged

jextract: Evaluate IfConfigDecl and add --static-build-config option 2#678
ktoso merged 17 commits intoswiftlang:mainfrom
sidepelican:evaluate_ifConfigDecl

Conversation

@sidepelican
Copy link
Copy Markdown
Contributor

@sidepelican sidepelican commented Apr 7, 2026

In the previous PR, the code generated by buildToolsPlugin wasn't being correctly referenced when the host and target OS differed (However, in some cases it was working 🤪).
It seems that SwiftPM starts the build process before the plugin completes its execution, even when a target explicitly depends on it 🤔.

To work around this, I’ve moved away from generating source code and instead load a JSON file as a resource.

@sidepelican sidepelican requested a review from ktoso as a code owner April 7, 2026 02:28
@sidepelican
Copy link
Copy Markdown
Contributor Author

Swift nightly seems to be failing consistently.
Test (Swift) (jammy swift:6.3 jdk:corretto) fails mysteriously.

@sidepelican
Copy link
Copy Markdown
Contributor Author

Unless I missed something, everything seems to be working fine except nightly.
Can I say this has been fixed?

],
resources: [
.process("Resources")
],
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hmmm resources cause pulling in Foundation but hopefully just for the specific target, so this won't show up in any of the runtime modules...

Please keep an eye out on it @madsodgaard but it seems our linking test is happy so we should be good 👍

Copy link
Copy Markdown
Collaborator

@ktoso ktoso left a comment

Choose a reason for hiding this comment

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

Yeah I think I'm happy with the generation approach, it's kinda cleaner to be honest even.

@ktoso
Copy link
Copy Markdown
Collaborator

ktoso commented Apr 7, 2026

I think we're good here AFAICS... 🤔

@ktoso ktoso merged commit 2e55cc1 into swiftlang:main Apr 7, 2026
67 of 79 checks passed
@sidepelican sidepelican deleted the evaluate_ifConfigDecl branch April 7, 2026 09: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