Skip to content

build(pillar): fix make test on macOS M-series with HV=k#5846

Draft
andrewd-zededa wants to merge 1 commit intolf-edge:masterfrom
andrewd-zededa:eve-k-macos-pillar-make-test
Draft

build(pillar): fix make test on macOS M-series with HV=k#5846
andrewd-zededa wants to merge 1 commit intolf-edge:masterfrom
andrewd-zededa:eve-k-macos-pillar-make-test

Conversation

@andrewd-zededa
Copy link
Copy Markdown
Contributor

@andrewd-zededa andrewd-zededa commented Apr 22, 2026

Description

Add explicit pillar-cache-export-docker-load rule to the top-level
Makefile to fix GNU Make 3.81 (macOS) selecting the pillar-% pattern
rule over %-cache-export-docker-load via first-match. GNU Make 4.x
(Linux) uses shortest-stem and picks correctly; an explicit rule wins
in all versions.

Also fix pkg/pillar make test for HV=k on macOS ARM64: pass --build-yml
to select the kube build yml, clear cross-compilation env vars so go test
runs natively in the ARM64 container instead of producing AMD64 ELFs that
Rosetta cannot execute.

PR dependencies

None

How to test and validate this PR

  • cd pkg/pillar
  • make ZARCH=amd64 HV=k test

Changelog notes

Fix pillar make test for m series Mac, hv=k ZARCH=amd64

PR Backports

  • 16.0-stable: Unsure
  • 14.5-stable: No, as the feature is not available there.
  • 13.4-stable: No, as the feature is not available there.

Checklist

  • I've provided a proper description
  • I've added the proper documentation
  • I've tested my PR on amd64 device
  • I've tested my PR on arm64 device
  • I've written the test verification instructions
  • I've set the proper labels to this PR

And the last but not least:

  • I've checked the boxes above, or I've provided a good reason why I didn't
    check them.

Please, check the boxes above after submitting the PR in interactive mode.

@andrewd-zededa
Copy link
Copy Markdown
Contributor Author

The Darwin bypass in build-docker-test-dependencies is not the best, working to remove it.

@andrewd-zededa andrewd-zededa force-pushed the eve-k-macos-pillar-make-test branch 3 times, most recently from eac8749 to f2f95cc Compare April 22, 2026 23:49
@andrewd-zededa
Copy link
Copy Markdown
Contributor Author

Ok, Darwin bypass removed, top level makefile target comment updated to show macOS make motivated issue

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 29.09%. Comparing base (2281599) to head (3bef59f).
⚠️ Report is 574 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5846      +/-   ##
==========================================
+ Coverage   19.52%   29.09%   +9.56%     
==========================================
  Files          19       25       +6     
  Lines        3021     4523    +1502     
==========================================
+ Hits          590     1316     +726     
- Misses       2310     2947     +637     
- Partials      121      260     +139     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@andrewd-zededa andrewd-zededa force-pushed the eve-k-macos-pillar-make-test branch from f2f95cc to 5ec76aa Compare April 23, 2026 01:12
@andrewd-zededa
Copy link
Copy Markdown
Contributor Author

Rebased on master

Comment thread pkg/pillar/Makefile Outdated
@andrewd-zededa andrewd-zededa marked this pull request as draft April 23, 2026 15:51
@andrewd-zededa andrewd-zededa force-pushed the eve-k-macos-pillar-make-test branch from 5ec76aa to 3bef59f Compare April 23, 2026 16:10
GNU Make 3.81 (macOS) selects pattern rules by first-match, so pillar-%
wins over %-cache-export-docker-load for the target pillar-cache-export-
docker-load. Add an explicit rule to the top-level Makefile that beats
all pattern rules in every Make version.

Pass --build-yml to linuxkit in pkg/pillar/Makefile so HV=k selects
build-k.yml instead of the default build.yml, and fix the test tag
from kubevirt to k.

Pass --build-arg BUILDARCH=$(ZARCH) when building the test image so
the Dockerfile stage selector (target-${TARGETARCH}-build-${BUILDARCH})
resolves to the native build path instead of the cross-compilation path.
The cross-compiled stages produce a container whose arch differs from
ZARCH, so they can never execute ZARCH test binaries regardless of host.

Master behavior (no BUILDARCH override):

  Host        ZARCH  Stage                    Image  Result
  ----------  -----  -----------------------  -----  ------
  Linux AMD64 amd64  target-amd64-build-amd64 AMD64  pass
  macOS ARM64 arm64  target-arm64-build-arm64 ARM64  pass
  macOS ARM64 amd64  target-amd64-build-arm64 ARM64  FAIL (AMD64 ELFs in ARM64 container)
  Linux AMD64 arm64  target-arm64-build-amd64 AMD64  FAIL (ARM64 ELFs in AMD64 container)

With --build-arg BUILDARCH=$(ZARCH):

  Host        ZARCH  Stage                    Image        Result
  ----------  -----  -----------------------  -----------  ------
  Linux AMD64 amd64  target-amd64-build-amd64 AMD64        pass (same)
  macOS ARM64 arm64  target-arm64-build-arm64 ARM64        pass (same)
  macOS ARM64 amd64  target-amd64-build-amd64 AMD64/Rosetta pass (fixed)
  Linux AMD64 arm64  target-arm64-build-arm64 ARM64/QEMU   pass (fixed)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Andrew Durbin <andrewd@zededa.com>
@andrewd-zededa andrewd-zededa force-pushed the eve-k-macos-pillar-make-test branch from 3bef59f to 5c34c87 Compare May 5, 2026 18:10
@andrewd-zededa
Copy link
Copy Markdown
Contributor Author

rebased on recent master

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.

2 participants