Skip to content

fix(make): export EXAMPLE variable for sub-make invocations#633

Open
Alex-ai-future wants to merge 1 commit into
llm-d:mainfrom
Alex-ai-future:fix/makefile-run-example
Open

fix(make): export EXAMPLE variable for sub-make invocations#633
Alex-ai-future wants to merge 1 commit into
llm-d:mainfrom
Alex-ai-future:fix/makefile-run-example

Conversation

@Alex-ai-future

@Alex-ai-future Alex-ai-future commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Summary

make run-example kv_cache_index silently ran offline instead.

Root Cause

run-example calls sub-makes via $(MAKE), but Make doesn't pass internal variables to sub-makes by default.

The sub-make re-evaluates EXAMPLE from MAKECMDGOALS. Its command is make run-example-only (one word), so $(word 2,$(MAKECMDGOALS)) is empty and it falls back to the default offline.

Fix

Added export EXAMPLE so the value is inherited by sub-makes as an environment variable.

Why CI didn't catch this

CI calls make run-example-only <name> directly in hack/verify-examples.sh, bypassing the run-example wrapper entirely. run-example-only receives the full argument list, so MAKECMDGOALS is correct. Only the run-example wrapper (used by local developers) triggers this bug.

Impact

Command Before After
make run-example kv_cache_index silently ran offline correctly runs kv_cache_index
make run-example online silently ran offline correctly runs online
make run-example (no arg) ran offline no change

Signed-off-by: Alex <alex.tech.lab@outlook.com>
@github-actions github-actions Bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jun 4, 2026
@Alex-ai-future
Alex-ai-future marked this pull request as ready for review June 4, 2026 07:15
@Alex-ai-future

Copy link
Copy Markdown
Contributor Author

After testing, this is an actual bug that appears in Mac and Linux at the same time.

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

This PR is marked as stale after 21d of inactivity. After an additional 14d of inactivity (7d to become rotten, then 7d more), it will be closed. To prevent this PR from being closed, add a comment or remove the lifecycle/stale label.

@yankay

yankay commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Thanks @Alex-ai-future
/lgtm

@github-actions github-actions Bot added lgtm Looks good to me, indicates that a PR is ready to be merged. and removed lifecycle/stale labels Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm Looks good to me, indicates that a PR is ready to be merged. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants