Repository navigation
mono, or-tools: cap build parallelism to nproc/4 - #132
Conversation
Both packages were running their build at -j$(nproc), which on the buildbot res-servers is -j32. Each package has a known memory blow-up at full parallelism: - or-tools links its inline-built deps (protobuf, abseil, HiGHS, eigen) together at peak; -j32 OOMs the build. - Mono bootstraps byacc + jay + corlib + the runtime; the corlib compile + .NET assembly phase OOMs at -j32. Caps both at nproc/4 (8 jobs on the current 32-core boxes) with a floor of 1 for low-core CI runs. Matches the existing pattern in packages/foundationdb/build.sh, which solved the same issue there. Other distros (Debian/Fedora/Arch) cap these packages similarly -- this is standard practice, not a workaround. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
📝 WalkthroughWalkthroughBoth build scripts limit parallelism to one quarter of available CPU cores (minimum 1) by calculating Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/mono/build.sh (1)
48-55: Autotools parallelism now diverges from the repository standard.This uses
make -j"$JOBS"instead ofmake -j$(nproc). If this exception is intentional for memory pressure, please codify a package-specific exception (or update the guideline) so policy and build scripts stay aligned.As per coding guidelines: "For Autotools projects, use './configure --prefix=/usr' followed by 'make -j$(nproc)' and 'make DESTDIR=$OUTPUT_DIR install'".
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/mono/build.sh` around lines 48 - 55, The build script diverges from policy by using a custom JOBS calculation and make -j"$JOBS" instead of the standard make -j$(nproc); either revert to the policy-compliant commands or explicitly codify this as a package-specific exception: replace the JOBS block with make -j$(nproc) and keep make DESTDIR=$OUTPUT_DIR install, or if memory pressure requires limiting jobs, add a clear package-specific override (e.g. a MONO_BUILD_JOBS env var or a COMMENT noting the exception) and apply it only when set so the default remains make -j$(nproc); ensure references to JOBS, make -j"$JOBS", nproc and OUTPUT_DIR are updated accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@packages/mono/build.sh`:
- Around line 48-55: The build script diverges from policy by using a custom
JOBS calculation and make -j"$JOBS" instead of the standard make -j$(nproc);
either revert to the policy-compliant commands or explicitly codify this as a
package-specific exception: replace the JOBS block with make -j$(nproc) and keep
make DESTDIR=$OUTPUT_DIR install, or if memory pressure requires limiting jobs,
add a clear package-specific override (e.g. a MONO_BUILD_JOBS env var or a
COMMENT noting the exception) and apply it only when set so the default remains
make -j$(nproc); ensure references to JOBS, make -j"$JOBS", nproc and OUTPUT_DIR
are updated accordingly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 6d43d13b-1a35-44da-b7fe-cbe62433e6b1
📒 Files selected for processing (2)
packages/mono/build.shpackages/or-tools/build.sh
Summary
Caps build parallelism on
or-toolsandmonoatnproc/4, matching the existing pattern inpackages/foundationdb/build.sh.Both packages were running their build at
-j$(nproc)—-j32on the buildbot res-servers. Each has a known memory blow-up at full parallelism:or-toolslinks its inline-built deps (protobuf, abseil, HiGHS, eigen) together at peak;-j32OOMs the host.monobootstraps byacc + jay + corlib + the runtime; the corlib compile + .NET assembly phase OOMs at-j32.Both observed OOMing on buildbot in the last day with
exit code 125: container received signal SIGKILL. Standard practice across Debian/Fedora/Arch is to cap these specific packages similarly — it's not a workaround, it's how memory-greedy C++ builds are handled at scale.Implementation
Identical pattern to
packages/foundationdb/build.sh:41-44:nproc / 4is 8 jobs on the current 32-core res-servers, with a floor of 1 so single-core CI environments don't end up at-j0. Relative rather than absolute — scales if VM size changes later.Test plan
-j8should still be plenty for the actual compile work; the speedup from -j32 to -j8 on a memory-bound C++ build is often <2x because the bottleneck moves from CPU to memory bandwidth anyway🤖 Generated with Claude Code
Summary by CodeRabbit