- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
No compile errors with -fno-emit-bin if c files in the build #22682
Comments
-fno-emit-bin
does not report compile errors when c files included in build
This issue is caused by Line 1719 in 08d661f
performAllTheWorkInner returns early Lines 3852 to 3855 in 08d661f
But I'm struggling to follow through the logic to actually get to the bottom of this. |
leecannon
added a commit
to CascadeOS/CascadeOS
that referenced
this issue
Feb 6, 2025
Workaround for ziglang/zig#22682
sphaerophoria
added a commit
to sphaerophoria/sphimp
that referenced
this issue
Mar 15, 2025
See comment. The overly hacky part can be removed if ziglang/zig#22682 is resolved
mlugg
added a commit
to mlugg/zig
that referenced
this issue
Mar 15, 2025
The old logic only decremented `remaining_prelink_tasks` if `bin_file` was not `null`. This meant that on `-fno-emit-bin` builds with registered prelink tasks (e.g. C source files), we exited from `Compilation.performAllTheWorkInner` early, assuming a prelink error. Instead, when `bin_file` is `null`, we still decrement `remaining_prelink_tasks`; we just don't do any actual work. Resolves: ziglang#22682
andrewrk
pushed a commit
that referenced
this issue
Mar 23, 2025
The old logic only decremented `remaining_prelink_tasks` if `bin_file` was not `null`. This meant that on `-fno-emit-bin` builds with registered prelink tasks (e.g. C source files), we exited from `Compilation.performAllTheWorkInner` early, assuming a prelink error. Instead, when `bin_file` is `null`, we still decrement `remaining_prelink_tasks`; we just don't do any actual work. Resolves: #22682
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Zig Version
0.14.0-dev.2989+bf6ee7cb3
Steps to Reproduce and Observed Behavior
With an empty c file called
empty.c
andmain.zig
containing:The correct behavior occurs without the c file:
Expected Behavior
The same error as without
-fno-emit-bin
:The text was updated successfully, but these errors were encountered: