Skip to content

feat(settings): support host variant for all build settings#630

Merged
aherrmann merged 3 commits intoaherrmann:mainfrom
cerisier:shared-library-runfiles-propagations
Apr 23, 2026
Merged

feat(settings): support host variant for all build settings#630
aherrmann merged 3 commits intoaherrmann:mainfrom
cerisier:shared-library-runfiles-propagations

Conversation

@cerisier
Copy link
Copy Markdown
Contributor

@cerisier cerisier commented Apr 22, 2026

This PR brings a "host_" counterpart to all //zig/settings build flags.

Motivation

Allow having different settings for exec vs target configuration like compiling tools in debug and target binaries in release_fast (host_mode=debug, mode=release_fast)

How

Duplicate all settings with a host_ variant and populate the ZigSettingsInfo provider with either of the normal or host_ variant build setting value depending on whether we are building for tool (-exec in gendir hack).

Test

Testing for exec is easy because the existing tests were build for tool and execed by run.
I haven't found a good solution to systematically test for target because running target binaries is not ideal (exec and target can be different).

@cerisier cerisier changed the title Support host variant for all build settings feat(settings): support host variant for all build settings Apr 22, 2026
Copy link
Copy Markdown
Owner

@aherrmann aherrmann left a comment

Choose a reason for hiding this comment

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

That looks great, thank you!

I haven't found a good solution to systematically test for target because running target binaries is not ideal (exec and target can be different).

Indeed. But, target settings are covered in detail by the analysis tests, so, I think we have good enough coverage.

@aherrmann aherrmann merged commit 4be19bb into aherrmann:main Apr 23, 2026
35 of 37 checks passed
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