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

chromium: enable parallel building #78219

Closed
wants to merge 1 commit into from
Closed

chromium: enable parallel building #78219

wants to merge 1 commit into from

Conversation

LouisDK1
Copy link
Contributor

@LouisDK1 LouisDK1 commented Jan 21, 2020

I'd prefer if chromium was built with "parallel building" enabled as this would shorten build time greatly on multi core CPUs.

Sadly I don't currently have a machine with NixOS to test this on without it taking days to compile.
If anyone have any input eg. reasons why this wouldn't build or be a bad idea please let me know.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@thefloweringash
Copy link
Member

Chromium currently builds in parallel by explicitly setting the -j option in the buildPhase, which will ignore the value of enableParallelBuilding:

ninja -C "${buildPath}" \
-j$(( ($NIX_BUILD_CORES+1) / 2 )) -l$(( $NIX_BUILD_CORES+1 )) \
"${target}"

Not directly applicable, but for ninja based builds parallel building is on by default:

# Parallel building is enabled by default.
if [ "${enableParallelBuilding-1}" ]; then
buildCores="$NIX_BUILD_CORES"
fi

If chromium doesn't build in parallel for you, can you share more details about how you're building and your environment?

@LouisDK1
Copy link
Contributor Author

Chromium currently builds in parallel by explicitly setting the -j option in the buildPhase, which will ignore the value of enableParallelBuilding:

ninja -C "${buildPath}" \
-j$(( ($NIX_BUILD_CORES+1) / 2 )) -l$(( $NIX_BUILD_CORES+1 )) \
"${target}"

I missed that. Was trying to build in a virtual machine with 2 cores enabled and saw that only 1 was used. This explains why:
@rycee Will you check if this will build? Thanks a lot

@LouisDK1 LouisDK1 closed this Jan 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants