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

stage2: detect redundant C/C++ source files #7394

Merged
merged 1 commit into from Dec 11, 2020
Merged

Conversation

andrewrk
Copy link
Member

@andrewrk andrewrk commented Dec 11, 2020

Cache exposes BinDigest.

Compilation gains a set of a BinDigest for every C/C++ source file. We
detect when the same source/flags have already been added and emit a
compile error. This prevents a deadlock in the caching system.

Closes #7308

Example output:

[nix-shell:~/dev/zig/build]$ ./zig build-lib foo.c foo.c
foo.c:1:1: error: unable to build C object: the same source file was already added to the same compilation with the same flags

The :1:1 thing is a separate issue, which can be addressed separately now that 2ed1ed9 introduced different kinds of error messages.

Cache exposes BinDigest.

Compilation gains a set of a BinDigest for every C/C++ source file. We
detect when the same source/flags have already been added and emit a
compile error. This prevents a deadlock in the caching system.

Closes #7308
@andrewrk andrewrk merged commit 64a590a into master Dec 11, 2020
@andrewrk andrewrk deleted the detect-c-src-deadlock branch December 11, 2020 07:33
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.

adding the same C source file redundantly to the same compilation results in a deadlock
1 participant