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

Implement 'dynout' feature to inform ninja about dynamic outputs #3

Closed
wants to merge 87 commits into from

Conversation

johanneslerch
Copy link
Collaborator

Cameron Desrochers and others added 30 commits November 12, 2019 15:47
Edges are nominally ordered by order in the build manifest, but in
fact are ordered by memory address.  In most cases the memory address
will be monontonically increasing.  Since serialized build output will
need unique IDs, add a monotonically increasing ID to edges, and use
that for sorting instead of memory address.
* D9025: overriding '/GR' with '/GR-'
* C4100: 'argc': unreferenced formal parameter
* C4244: '=': conversion from 'int' to 'char', possible loss of data (on tolower)
* C4267: 'initializing': conversion from 'size_t' to 'unsigned int', possible loss of data
* C4702: unreachable code (after Fatal)
* C4706: assignment within conditional expression
* C4996: 'strcpy': This function or variable may be unsafe
Add FreeBSD support to GetProcessorCount
Found with readability-inconsistent-declaration-parameter-name

Signed-off-by: Rosen Penev <[email protected]>
[clang-tidy] fix inconsistent declarations
Replace Travis CI with GitHub Actions
Found with readability-simplify-boolean-expr

Signed-off-by: Rosen Penev <[email protected]>
Found with google-explicit-constructor

Signed-off-by: Rosen Penev <[email protected]>
[clang-tidy] simplify boolean expression
[clang-tidy] add explicit to single argument constructors
Using this modern signature makes CMake/CTest use the effective
binary path and works also with multi-config generators which put
binaries in extra `Release` folders.
…ture

cmake: Use modern add_test signature
Added fuzzer with build script and seed
The times that end up in the build log currently originate in the
status printer, and are propagated back out to the Builder.  Move
the edge times into the Builder instead, and move the overall start
time into NinjaMain so it doesn't get reset during manifest
rebuilds.
Store the number of running edges instead of trying to compute it
from the started and finshed edge counts, which may be different
for starting and ending status messages.  Allows removing the status
parameter to PrintStatus and the EdgeStatus enum.
Make BuildStatus an abstract interface, and move the current
implementation to StatusPrinter, to make way for a serialized
Status output.
bradking and others added 27 commits March 1, 2021 13:05
The ANSI code page identifier is more information than generator
programs actually need.  The encoding of `build.ninja` is always
either UTF-8 or the system-wide ANSI code page.  Reduce the output
to provide no more information than the generator programs need.

The Console code page can be obtained in other ways, so drop it.
wincodepage: minimize to indicate UTF-8 or not
Clarify purpose for implicit dependencies
If an edge's output files' mtimes are compared to the most recent
input's mtime, edges might be calculated as clean even if they are
actually dirty. While an edge's command is running its rule to produce
its outputs and an input to the edge is updated before the outputs are
written to disk, then subsequent runs will think that the outputs are
newer than the inputs, even though the inputs have actually been updated
and may be different than what were used to produce those outputs.

Ninja will now restat all inputs just prior to running an edge's command
and remember the most recent input mtime. When the command completes,
it will stat any discovered dependencies from dep files (if necessary),
recalculate the most recent input mtime, and log it to the build log
file. On subsequent runs, ninja will use this value to compare to the
edge's most recent input's mtime to determine whether the outputs are
dirty.

This extends the methodology used by restat rules to work in all cases.
Restat rules are still unique in that they will clean the edge's output
nodes recursively if the edge's command did not change the output, but
in all cases, the mtime recorded in the log file is now the most recent
input mtime. See the new tests for more clarification.
Change build log to always log the most recent input mtime
This reverts commit 67fbbee.

There were a few missing test cases exposed by CMake's test suite that
need slight adjustments. Better to revert the original attempt, add the
test cases, and then re-land the change with the fixes.

Fixes ninja-build#1932
These expose some behavior related to implicit deps unknown to ninja and
timestamps with generating them as part of a rule.

See discussions in ninja-build#1932 and ninja-build#1933.
Revert ninja-build#1753 and add additional tests to expose previously untested behavior
Previously this was covered only as part of more complex tests.
When a path loaded from a depfile does not have a node, we create a new
node with a phony edge producing it.  If we later load a dyndep file
that specifies the same node as an output of a known edge, we previously
failed with a "multiple rules generate ..." error.  Instead, since the
conflicting edge was internally generated, replace the node's input edge
with the now-known real edge that produces it.
dyndep: reconcile dyndep-specified outputs with depfile-specified inputs
Removes the selection of a fixed Xcode version added in 242b7dd which assured Xcode version 12.2 was used when the default was still 12.1. The GitHub default is now 12.4 and newer versions will be made the default a few weeks after the stable release. This commit ensures an up to date Xcode version is used in the CI.
CI: macOS: Unfix Xcode version to use the latest stable one
This tool list all the output generated by the graph, including dynamic
output if they have been built.
@johanneslerch johanneslerch force-pushed the dynamic_outputs branch 2 times, most recently from d8da251 to 090e623 Compare November 26, 2021 13:02
@cuinixam cuinixam closed this Nov 29, 2021
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.