[PR #429] [MERGED] fix(make): keep command-line overrides out of inherited MAKEFLAGS #431

Closed
opened 2026-10-29 14:23:20 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/kvcache-ai/AgentENV/pull/429
Author: @yingdi-shan
Created: 10/23/2026
Status: ✅ Merged
Merged: 10/23/2026
Merged by: @yingdi-shan

Base: main ← Head: fix/makeflags-command-line-overrides


📝 Commits (1)

  • 4583d3c fix(make): keep command-line overrides out of inherited MAKEFLAGS

📊 Changes

1 file changed (+5 additions, -0 deletions)

View changed files

📝 Makefile (+5 -0)

📄 Description

What

Set MAKEOVERRIDES := in the top-level Makefile so that command-line variable overrides (e.g. PROFILE=debug) are no longer encoded into the MAKEFLAGS that recipes inherit.

Why

unit-tests in AENV CI has failed on main and every PR since the v0.2.4 bump (e.g. runs 39892803013, 39910415804, 39910493540):

MAKEFLAGS=" -- PROFILE=debug -j --jobserver-fds=3,6 --jobserver-auth=3,6" "make"
make[1]: *** No rule to make target '-j'.  Stop.
panicked at tikv-jemalloc-sys-0.6.1/build.rs:411:9
  • make test-unit PROFILE=debug makes GNU make export MAKEFLAGS=" -- PROFILE=debug".
  • tikv-jemalloc-sys's build script appends cargo's jobserver flags after the inherited value, so -j lands after --.
  • GNU Make 4.3 (ubuntu-24.04) tolerates this; GNU Make 4.4.1 (ubuntu-26.04, which ubuntu-latest switched to on 2026-10-20) treats -j as a target and fails.
  • The failure only shows when jemalloc is compiled from scratch. Between 10-20 and 10-23 every run restored a Rust cache. The v0.2.4 bump changed Cargo.lock, so the next run found no cache, and failed runs never save one, so every run since has failed. Deleting the cache does not help.

The Makefile's own recursive calls ($(MAKE) install-ublk PROFILE=debug, $(MAKE) build-ublk PROFILE=debug) hit the same issue on a cold build, so changing only the workflow invocations would not be enough.

N/A — CI regression; no issue filed.

Scope and non-goals

Makefile only. No workflow, Rust, or services/ changes. The runner image is not pinned.

Design and behavior changes

Command-line overrides still reach recipes and sub-makes as environment variables. Explicit sub-make overrides keep priority: make bench PROFILE=debug still builds install-ublk with --release. make services-test GO=mygo still passes GO through to services/.

Compatibility and operations

  • Public API or generated protocol: N/A
  • Configuration or defaults: N/A
  • Snapshot manifest, artifact layout, or storage format: N/A
  • Upgrade and rollback: revert the one Makefile hunk
  • Host requirements, permissions, ports, or dependencies: fixes builds on hosts with GNU Make ≥ 4.4

Validation

  • make fmt
  • make clippy
  • make test-unit
  • Relevant Rust integration tests
  • make -C services test (required when services/ changes)
  • Generated clients/server regenerated with the documented make target
  • Documentation updated
  • Benchmarks or performance comparison completed

Commands and results:

# GNU Make 4.4.1 built from source and placed first on PATH, fresh CARGO_TARGET_DIR,
# `cargo clean -p tikv-jemalloc-sys` before each run
before: make build-server PROFILE=debug -> make[1]: *** No rule to make target '-j'.  Stop. (exit 2)
after:  make build-server PROFILE=debug -> Compiling tikv-jemalloc-sys ... Finished (exit 0)

make -n build-ublk PROFILE=release   -> cargo build --release -p uvm-ublk -p uvm-ublk-daemon
make -n bench PROFILE=debug          -> sub-make still builds install-ublk with --release
make -n services-test GO=mygo        -> cd services && mygo test ./gateway/...

Skipped checks and reasons: make test-unit was not run locally (it needs capability/ublk host setup). This PR's CI unit-tests job is the end-to-end check, since it will start without a Rust cache.

Risks and reviewer notes

A sub-make that relied on parent overrides beating its own Makefile's plain :=/= assignments would now see the Makefile value instead, because environment variables don't override those. No current sub-make target relies on this: services/* use ?=.

Checklist

  • The PR contains one coherent change and no unrelated formatting or refactoring.
  • New behavior is covered by tests, or I explained why testing is impractical.
  • Logs and examples contain no credentials, tokens, or private registry information.
  • I did not manually edit generated code without updating its source and regenerating it.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/kvcache-ai/AgentENV/pull/429 **Author:** [@yingdi-shan](https://github.com/yingdi-shan) **Created:** 10/23/2026 **Status:** ✅ Merged **Merged:** 10/23/2026 **Merged by:** [@yingdi-shan](https://github.com/yingdi-shan) **Base:** `main` ← **Head:** `fix/makeflags-command-line-overrides` --- ### 📝 Commits (1) - [`4583d3c`](https://github.com/kvcache-ai/AgentENV/commit/4583d3c608153cebb4feb94955d8569528e482ee) fix(make): keep command-line overrides out of inherited MAKEFLAGS ### 📊 Changes **1 file changed** (+5 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `Makefile` (+5 -0) </details> ### 📄 Description ## What Set `MAKEOVERRIDES :=` in the top-level `Makefile` so that command-line variable overrides (e.g. `PROFILE=debug`) are no longer encoded into the `MAKEFLAGS` that recipes inherit. ## Why `unit-tests` in AENV CI has failed on `main` and every PR since the v0.2.4 bump (e.g. runs 39892803013, 39910415804, 39910493540): ``` MAKEFLAGS=" -- PROFILE=debug -j --jobserver-fds=3,6 --jobserver-auth=3,6" "make" make[1]: *** No rule to make target '-j'. Stop. panicked at tikv-jemalloc-sys-0.6.1/build.rs:411:9 ``` - `make test-unit PROFILE=debug` makes GNU make export `MAKEFLAGS=" -- PROFILE=debug"`. - `tikv-jemalloc-sys`'s build script appends cargo's jobserver flags *after* the inherited value, so `-j` lands after `--`. - GNU Make 4.3 (ubuntu-24.04) tolerates this; GNU Make 4.4.1 (ubuntu-26.04, which `ubuntu-latest` switched to on 2026-10-20) treats `-j` as a target and fails. - The failure only shows when jemalloc is compiled from scratch. Between 10-20 and 10-23 every run restored a Rust cache. The v0.2.4 bump changed `Cargo.lock`, so the next run found no cache, and failed runs never save one, so every run since has failed. Deleting the cache does not help. The Makefile's own recursive calls (`$(MAKE) install-ublk PROFILE=debug`, `$(MAKE) build-ublk PROFILE=debug`) hit the same issue on a cold build, so changing only the workflow invocations would not be enough. ## Related issue N/A — CI regression; no issue filed. ## Scope and non-goals Makefile only. No workflow, Rust, or `services/` changes. The runner image is not pinned. ## Design and behavior changes Command-line overrides still reach recipes and sub-makes as environment variables. Explicit sub-make overrides keep priority: `make bench PROFILE=debug` still builds `install-ublk` with `--release`. `make services-test GO=mygo` still passes `GO` through to `services/`. ## Compatibility and operations - Public API or generated protocol: N/A - Configuration or defaults: N/A - Snapshot manifest, artifact layout, or storage format: N/A - Upgrade and rollback: revert the one Makefile hunk - Host requirements, permissions, ports, or dependencies: fixes builds on hosts with GNU Make ≥ 4.4 ## Validation - [ ] `make fmt` - [ ] `make clippy` - [ ] `make test-unit` - [ ] Relevant Rust integration tests - [ ] `make -C services test` (required when `services/` changes) - [ ] Generated clients/server regenerated with the documented `make` target - [ ] Documentation updated - [ ] Benchmarks or performance comparison completed Commands and results: ```text # GNU Make 4.4.1 built from source and placed first on PATH, fresh CARGO_TARGET_DIR, # `cargo clean -p tikv-jemalloc-sys` before each run before: make build-server PROFILE=debug -> make[1]: *** No rule to make target '-j'. Stop. (exit 2) after: make build-server PROFILE=debug -> Compiling tikv-jemalloc-sys ... Finished (exit 0) make -n build-ublk PROFILE=release -> cargo build --release -p uvm-ublk -p uvm-ublk-daemon make -n bench PROFILE=debug -> sub-make still builds install-ublk with --release make -n services-test GO=mygo -> cd services && mygo test ./gateway/... ``` Skipped checks and reasons: `make test-unit` was not run locally (it needs capability/ublk host setup). This PR's CI `unit-tests` job is the end-to-end check, since it will start without a Rust cache. ## Risks and reviewer notes A sub-make that relied on parent overrides beating its own Makefile's plain `:=`/`=` assignments would now see the Makefile value instead, because environment variables don't override those. No current sub-make target relies on this: `services/*` use `?=`. ## Checklist - [x] The PR contains one coherent change and no unrelated formatting or refactoring. - [ ] New behavior is covered by tests, or I explained why testing is impractical. - [x] Logs and examples contain no credentials, tokens, or private registry information. - [x] I did not manually edit generated code without updating its source and regenerating it. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-29 14:23:20 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kvcache-ai/AgentENV#431
No description provided.