-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[CMake] Speed up copying of headers #17607
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
Conversation
|
The error on Windows is related to this PR: |
Test Results 18 files 18 suites 4d 16h 59m 42s ⏱️ Results for commit 11d1161. ♻️ This comment has been updated with latest results. |
b4d2aad to
594345f
Compare
@bellenot I might have found the problem: The command line seems to be too long. After splitting the copy command in packs of 100 (there is more than 1000 headers otherwise), the build seemed to succeed. Let's wait for the latest run. |
pcanal
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the copy of the artefact (seemingly) only at configure time, we have the following 'failures':
$ echo >> src/tutorials/hsimple.C
$ ls -l src/tutorials/hsimple.C tutorials/hsimple.C
-rw-r--r--. 1 pcanal us_cms 3572 Feb 5 17:41 src/tutorials/hsimple.C
-rw-r--r--. 1 pcanal us_cms 3571 Feb 5 16:23 tutorials/hsimple.C
$ ninja
[2/2] Updating etc/gitinfo.txt.
-- Found Git: /usr/bin/git (found version "2.43.5")
$ ls -l src/tutorials/hsimple.C tutorials/hsimple.C
-rw-r--r--. 1 pcanal us_cms 3572 Feb 5 17:41 src/tutorials/hsimple.C
-rw-r--r--. 1 pcanal us_cms 3571 Feb 5 16:23 tutorials/hsimple.C
I.e. the copied hsimple.C is not updated after a local modification in the source.
That was my intention. I wanted to reduce the number of CMake targets, since I consider the macros and tutorials mostly stable. |
feb75a7 to
cf683aa
Compare
|
@pcanal I decided to factor out the copy of artifacts into a second PR, so at least the improvement due to the faster copying of headers can be merged already. Could you have a look again? |
Great. I was about to propose that :) |
52f9418 to
1ff52c4
Compare
To copy headers to the build tree, ROOT was creating one target per header. Headers are copied in packs of 100 (Windows doesn't support very long command lines). This significantly reduces the number of CMake targets and speeds up the build. A simple test that only moves headers: make -j6 move_headers New Old 1st invocation 10.7 s 34.5 s 2nd invocation 2.7 s 3.8 s Fix root-project#14953. Co-authored-by: Philippe Canal <pcanal@fnal.gov>
The intention of __allBuiltins was to build builtins as part of
moving headers.
The existing code was seemingly creating a target dependency using
add_custom_target(move_headers DEPENDS ${__allBuiltins})
However, this argument only accepts file dependencies. The dependency
was therefore ignored. Since it doesn't seem to have caused any
problems, it is removed here explicitly.
d9f4b4e to
11d1161
Compare
pcanal
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks.
Move the copy of artifacts (e.g. tutorials) from build time to configure time, and use a faster copy function.Here are some results:
make -j6 move_headersFor the copy of artifacts, there is no agreement yet since it's more complicated. I will factor this part out into a second PR.
Fix #14953