-
Notifications
You must be signed in to change notification settings - Fork 444
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
Try to speed up the CI build process #4470
Conversation
@@ -252,8 +252,8 @@ cmake ${CMAKE_FLAGS} .. | |||
|
|||
# If CMAKE_ONLY is active, only run CMake. Do not build. | |||
if [ "$CMAKE_ONLY" == "OFF" ]; then | |||
make | |||
sudo make install | |||
make -j$((`nproc`+1)) |
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.
Why don't use ninja (via -G Ninja
)? And you can just do cmake --build <dir>
so it could invoke whatever tool was used to generate build files. Ninja scales much better and multi-threaded by default.
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.
Mostly because we never made Ninja the default build system. Iirc there were also some issues with cmake throwing errors if you used -G Ninja
. We could experiment in a separate PR since it requires installing ninja and configuring some options for proper support.
It's just a testing matrix problem.
I can switch to the script and README to cmake --build
since it is more convenient.
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.
I think I could say that I never used make
with p4c. Over the last ~5 years or so :) But YMMV. Certainly Ninja is not usually available out of the box on many distros.
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.
You can do same for cmake --install
as well, btw.
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.
I believe when you run ninja
on a fresh build it can run into bad $-escape
errors depending on which backends are enabled.
I can give the build simplifications a shot once I am back on my dev Laptop. In the meantime this change should accelerate things.
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.
Yes, absolutely! Yeah, I might not have all backends enabled, so this might be an issue.
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.
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
Runners have 4 cores now: Add
-j$((`nproc`+1))
where possible.Fixes #4469.