The Wayback Machine - http://web.archive.org/web/20230707213659/https://github.com/ziglang/zig/issues/16351
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

every EmitOption field in std.Build.Step.Compile (for example: emit_docs) lacks FileSource integration #16351

Open

andrewrk opened this issue Jul 7, 2023 · 0 comments
Labels
breaking Implementing this issue could cause existing code to no longer compile or have different behavior. bug Observed behavior contradicts documented or intended behavior contributor friendly This issue is limited in scope and/or knowledge of Zig internals. enhancement Solving this issue will likely involve adding new logic or components to the codebase. zig build system
Milestone

Comments

@andrewrk
Copy link
Member

andrewrk commented Jul 7, 2023

emit_analysis: EmitOption = .default,
emit_asm: EmitOption = .default,
emit_bin: EmitOption = .default,
emit_docs: EmitOption = .default,
emit_implib: EmitOption = .default,
emit_llvm_bc: EmitOption = .default,
emit_llvm_ir: EmitOption = .default,
// Lots of things depend on emit_h having a consistent path,
// so it is not an EmitOption for now.
emit_h: bool = false,

Instead of passing strings directly to the Zig CLI, the build system API should have a function for adding emission of each of these artifacts which returns a FileSource which can then be used as inputs in other parts of the build system API.

As an example, getOutputSource already does this for the CLI equivalent of -femit-bin.

As a bonus, the build system should pass -fno-emit-bin unless getOutputSource() is called on the Compile Step. This will happen automatically in the case of adding an install step for the build artifact, which passes the result of getOutputSource() to an Install Step.

@andrewrk andrewrk added bug Observed behavior contradicts documented or intended behavior enhancement Solving this issue will likely involve adding new logic or components to the codebase. contributor friendly This issue is limited in scope and/or knowledge of Zig internals. breaking Implementing this issue could cause existing code to no longer compile or have different behavior. zig build system labels Jul 7, 2023
@andrewrk andrewrk added this to the 0.12.0 milestone Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Implementing this issue could cause existing code to no longer compile or have different behavior. bug Observed behavior contradicts documented or intended behavior contributor friendly This issue is limited in scope and/or knowledge of Zig internals. enhancement Solving this issue will likely involve adding new logic or components to the codebase. zig build system
Projects
None yet
Development

No branches or pull requests

1 participant