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

Try to speed up the CI build process #4470

Merged
merged 3 commits into from
Feb 26, 2024
Merged

Try to speed up the CI build process #4470

merged 3 commits into from
Feb 26, 2024

Conversation

fruffy
Copy link
Collaborator

@fruffy fruffy commented Feb 26, 2024

Runners have 4 cores now: Add -j$((`nproc`+1)) where possible.

Fixes #4469.

@@ -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))
Copy link
Contributor

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.

Copy link
Collaborator Author

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.

Copy link
Contributor

@asl asl Feb 26, 2024

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.

Copy link
Contributor

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.

Copy link
Collaborator Author

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.

Copy link
Contributor

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fruffy fruffy marked this pull request as ready for review February 26, 2024 17:08
@fruffy fruffy added this pull request to the merge queue Feb 26, 2024
Copy link
Contributor

@jafingerhut jafingerhut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Merged via the queue into main with commit c533f06 Feb 26, 2024
16 checks passed
@fruffy fruffy deleted the fruffy-patch-1 branch February 26, 2024 19:28
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.

test-p4c / test-ubuntu20 (Unity OFF) is very slow
3 participants