镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Improve MAKEFLAGS merging - #196

Open
jsf9k wants to merge 2 commits into
tikv:mainfrom
jsf9k:main
Open

jsf9k wants to merge 2 commits into
tikv:mainfrom
jsf9k:main

Conversation

@jsf9k

@jsf9k jsf9k commented Oct 29, 2026 •

Copy link
Copy Markdown

Fixes #167.

Summary by CodeRabbit

  • Bug Fixes
    • Build commands now better honor existing parallelism settings, helping avoid conflicting job counts and improving compatibility with configured build environments. This may make builds more predictable when using standard make settings.

@ti-chi-bot

ti-chi-bot Bot commented Oct 29, 2026

Copy link
Copy Markdown

Welcome @jsf9k! It looks like this is your first PR to tikv/jemallocator 🎉

@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9f062db2-639c-4b12-b3d7-311db5dc4b50
Commits

Reviewing files that changed from the base of the PR and between 26df5d2 and 1ec42c9.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3aaebfdc-3c75-430e-bb32-8d0027e350ce
Commits

Reviewing files that changed from the base of the PR and between 2179271 and 26df5d2.

Files selected for processing: 1
  • jemalloc-sys/build.rs

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

Walkthrough

The build script now parses and merges MAKEFLAGS and CARGO_MAKEFLAGS. It passes the available flags to make and checks for existing job or jobserver options before adding its own parallelism setting.

Changes: Make flags handling

Layer / File(s) Summary
Parse, merge, and pass Make flags
jemalloc-sys/build.rs
The build script separates options from arguments after --, merges values from both environment variables, and passes the selected flags to make. It checks for -j or --jobserver before adding -j NUM_JOBS.

Priority: Pending latest changes

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested labels: contribution

Suggested reviewers: kobzol

Merge Risk: Minimal · previous review 26df5

No material merge-blocking issue was established; the change is ready to merge after normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: improving MAKEFLAGS merging and handling.
Linked Issues check Passed Issue #167 reports that make receives MAKEFLAGS="-j --jobserver-fds=8,9 --jobserver-auth=8,9 s" and fails with "No rule to make target 's'". The cause is in the old make_command, which concatena…
Out of Scope Changes check Passed The whole-PR diff against the merge base changes only jemalloc-sys/build.rs. Every change serves the #167 fix. These changes are parse_makeflags, merge_makeflags, the MAKEFLAGS pass-through lo…
Full details: Linked Issues check

Explanation

Issue #167 reports that make receives MAKEFLAGS="-j --jobserver-fds=8,9 --jobserver-auth=8,9 s" and fails with "No rule to make target 's'". The cause is in the old make_command, which concatenated CARGO_MAKEFLAGS and MAKEFLAGS as raw strings. A dashless first group in MAKEFLAGS (here s) ended up after other flags, where make treats it as a target. The diff fixes this in jemalloc-sys/build.rs. The new parse_makeflags prepends - to a dashless first group, so s becomes -s. The new merge_makeflags rebuilds the merged string from parsed options and post--- arguments. The merged value is then passed to make through cmd.env("MAKEFLAGS", ...). For the reported input, the merge yields -j --jobserver-fds=8,9 --jobserver-auth=8,9 -s, which make accepts. The change also fixes the -j detection. It now checks option tokens before -- only, so text such as -- -junk-target no longer suppresses -j NUM_JOBS. No regression test is added. The issue does not request one, so this does not fail the coding requirement.

Full details: Out of Scope Changes check

Explanation

The whole-PR diff against the merge base changes only jemalloc-sys/build.rs. Every change serves the #167 fix. These changes are parse_makeflags, merge_makeflags, the MAKEFLAGS pass-through logic in make_command, and the option-based -j or --jobserver detection. The only other edit is a whitespace-only line, which is cosmetic and minor. No unrelated functionality or files are modified.

Full details: Docstring Coverage

Explanation

Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 3 functions across 1 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@jsf9k

jsf9k commented Oct 29, 2026 •

Copy link
Copy Markdown
Author
  • I couldn't commit directly to the branch for Improve MAKEFLAGS merging #168, so I created a new PR to address this comment from CodeRabbit.
  • I don't know if I should add the signoff to the commits or if that is to be done by someone else on the project.

orlp and others added 2 commits October 29, 2026 16:12
Signed-off-by: Jeremy Frasier <jeremy.frasier@gwe.cisa.dhs.gov>
The substring check f.contains("-j") searched the entire MAKEFLAGS
string, including post-dash arguments. If a target or file after --
contained the substring -j (e.g., MAKEFLAGS="-- -junk-target"), the
check incorrectly returned true, causing the code to skip adding -j
when parallelism was not actually configured.

Signed-off-by: Jeremy Frasier <jeremy.frasier@gwe.cisa.dhs.gov>
@jsf9k

jsf9k commented Oct 30, 2026

Copy link
Copy Markdown
Author

@BusyJay - What do I need to do to move this PR forward?

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.

Strange Makefile build error on tikv-jemalloc-sys 0.7.1

2 participants