Skip to content

fix(make): colon-namespaced targets silently no-op on macOS Make 3.81#351

Merged
DorianZheng merged 2 commits intomainfrom
fix/make-colon-escaping-macos-381
Mar 6, 2026
Merged

fix(make): colon-namespaced targets silently no-op on macOS Make 3.81#351
DorianZheng merged 2 commits intomainfrom
fix/make-colon-escaping-macos-381

Conversation

@DorianZheng
Copy link
Copy Markdown
Member

Summary

  • Fix make setup (and all \:-namespaced targets) silently doing nothing on macOS Make 3.81 due to target name bifurcation
  • Add .DEFAULT rule to bridge bifurcated backslash targets back to their real recipe counterparts
  • Remove colon targets from PHONY_TARGETS so .DEFAULT can fire on the empty backslash versions

Problem

macOS ships Make 3.81, which bifurcates \: targets into two database entries:

  • setup\:build — gets .PHONY attribute but no recipe, no prereqs
  • setup:build — gets recipe + prereqs but is not phony

The dependency chain (setup → setup\:dev → setup\:build) follows backslash versions, which are empty shells. The real content lives in unreachable non-backslash versions.

Solution

By removing colon targets from .PHONY, the empty backslash targets have no recipe, no file, and are not phony — so .DEFAULT fires. The .DEFAULT rule strips the \ and re-invokes $(MAKE) with the clean name, hitting the non-backslash target that has the recipe.

No target renaming, no doc changes, no CI changes.

Test plan

  • make -n setup.DEFAULT fires, reaches real recipe
  • make -n setup:build — direct invocation works
  • make typo — proper error message + exit 2, no infinite loop
  • make -n help — unchanged, shows colon-style names
  • make -n dev:python — works directly

macOS ships Make 3.81 which bifurcates `\:` targets into two database
entries: one with backslash (gets .PHONY but no recipe) and one without
(gets recipe but not .PHONY). The dependency chain follows backslash
versions, which are empty shells — so `make setup` does nothing.

Fix: remove colon targets from PHONY_TARGETS and add a .DEFAULT rule
that strips the backslash and re-invokes make with the clean name.
This bridges the bifurcated entries without renaming any targets.

Verified on Make 3.81:
- `make setup` runs setup scripts (not "Nothing to be done")
- `make setup:build` works directly
- `make typo` prints proper error, exit 2
- `make help` unchanged
…colon namespacing

All other Makefile targets use colon-style namespacing (setup:build,
dev:python, test:unit:rust, etc.). The .DEFAULT bifurcation rule from
the previous commit ensures colon targets resolve correctly as
prerequisites on macOS Make 3.81.
@DorianZheng DorianZheng merged commit dabab7d into main Mar 6, 2026
16 of 18 checks passed
@DorianZheng DorianZheng deleted the fix/make-colon-escaping-macos-381 branch March 6, 2026 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant