fix: build precompiled headers after generated inputs - #360
Open
kevin-sellers wants to merge 1 commit into
Open
Conversation
Object files get a target's dependencies, and its actions and rules outputs, as order-only prerequisites. The .gch built from a prefix header got neither, so a prefix header that reaches a generated header races code generation: make starts the .gch as soon as the prefix header itself exists, and a clean build fails on the missing generated header.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Object files get a target's dependencies, and its actions and rules outputs, as
order-only prerequisites. The
.gchbuilt from a prefix header gets neither, soa prefix header that reaches a generated header races code generation: make
starts the
.gchas soon as the prefix header itself exists, and a clean buildfails on the missing generated header.
This gives the
.gchtargets the same order-only prerequisites the object filesget.
Motivation
I was attempting to enable precompiled headers for V8's largest targets in a
Node.js build. The prefix header includes
isolate-inl.h, which reachesbuiltins-definitions.h, which includes the generatedbuiltins-generated/bytecodes-builtins-list.h. A clean build died with:Any target whose
GCC_PREFIX_HEADERtransitively includes generated code hitsthis today, independently of how the prefix header was configured.
Testing
Adds
TestGypMac.test_make_prefix_header_waits_for_generated_inputs, drivingthe existing
GCC_PREFIX_HEADER/GCC_PRECOMPILE_PREFIX_HEADERpath with afixture whose target both names a prefix header and has an action producing a
generated header. It asserts the object depends on the
.gchand that the.gchcarries the order-only edge on the action output.