Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default to build mode following --compilation_mode #38

Closed
Tracked by #1
aherrmann opened this issue Feb 26, 2023 · 2 comments
Closed
Tracked by #1

Default to build mode following --compilation_mode #38

aherrmann opened this issue Feb 26, 2023 · 2 comments

Comments

@aherrmann
Copy link
Owner

aherrmann commented Feb 26, 2023

The Zig build mode should default to a setting in line with --compilation_mode such that
--compilation_mode=fastbuild implies Debug,
--compilation_mode=dbg implies Debug,
--compilation_mode=opt implies ReleaseFast.

Unfortunately build_setting_default is not configurable, meaning we cannot select on the compilation mode to defined the default value for the mode flag. An alternative is to add an auto option, make that the default, and add logic to the settings rule to select the correct value.

An issue with this approach is that it breaks the config setting defined here. A workaroud would be to use config_setting_group to define a config setting that resolves to mode==debug or (mode==auto and compilation_mode==dbg) etc.

@aherrmann aherrmann mentioned this issue Feb 26, 2023
63 tasks
@aherrmann
Copy link
Owner Author

Alternatively, if #37 becomes available with builtin Bazel support, and that allows for separate defaults for target and exec configurations, then the main use-case, i.e. separate defaults for targets vs. tools, would be solved.

@aherrmann
Copy link
Owner Author

Closing until a concrete need arises.

@aherrmann aherrmann closed this as not planned Won't fix, can't repro, duplicate, stale Feb 26, 2023
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

No branches or pull requests

1 participant