Skip to content

kubevirt-cdi Makefile defines test: twice, so make warns on every invocation and one rule is dead #4157

Closed

Description

packages/system/kubevirt-cdi/Makefile defines test: twice, at lines 9 and 18. GNU make takes the last definition, discards the first, and warns on every invocation in that directory:

warning: overriding commands for target 'test'
warning: ignoring old commands for target 'test'

Both recipes are helm unittest ., so nothing behaves differently today. What is wrong is the shape: one of the two rules is dead, and the warning is printed by every developer and every CI run that enters this package.

How it got there is worth recording, because it is not a mistake either author could have caught alone. The target arrived from 0418577f5, which added it together with a comment explaining that hack/package.mk defines no test target and the sweep skips a package whose make -n test does not resolve. Then #4102 appended a second one, having been written against a tree where the first did not exist yet. Neither diff conflicts with the other, because they touch different lines of the same file, so git merged them silently and make is the first thing that notices.

The fix is deleting one of the two blocks. Keep the one carrying the rationale comment, since that comment is the reason a reader will not delete the target again later.

Swept, and it is the only one

Every packages/**/Makefile on main was checked for a target defined more than once. This is the only real instance.

Two other files matched the first pass and are not defects: packages/system/kamaji/charts/kamaji/Makefile and packages/system/kamaji/charts/kamaji-crds/Makefile open with

docs: HELMDOCS_VERSION := v1.8.1
docs: docker

The first line is a target-specific variable assignment, which shares the docs: prefix with the rule below it without being a second rule. Both files are vendored upstream charts under charts/ in any case. Worth naming here so the next person running this sweep does not re-derive it, and so the pattern is not "written to match" a hit that was never a defect.

The general shape still deserves attention even though the sweep is clean: two changes that each add a missing target to the same package will always merge without conflict and always produce this, because they touch different lines. Nothing in CI notices, since make's warning does not change the exit status. If that is worth guarding, the guard belongs with the existing invariant that checks a package ships a runnable test target, not as a separate check.

Activity

  1. added
    kind/bugCategorizes issue or PR as related to a bug
    area/virtualizationIssues or PRs related to virtualization (kubevirt, cdi, vmi, vm-import)
    on Sep 7, 2026
  2. added a commit that references this issue on Sep 23, 2026
    99de79f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/virtualizationIssues or PRs related to virtualization (kubevirt, cdi, vmi, vm-import)kind/bugCategorizes issue or PR as related to a bugtriage/needs-triageIndicates an issue needs triage by a maintainer

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions