Skip to content

fix: Add windows native ABE make builds - #635

Closed
kkive wants to merge 1 commit into
moonD4rk:mainfrom
kkive:agent/fix-windows-make
Closed

kkive wants to merge 1 commit into
moonD4rk:mainfrom
kkive:agent/fix-windows-make

Conversation

@kkive

@kkive kkive commented Aug 18, 2026

Copy link
Copy Markdown

What changed

  • use cmd.exe-compatible directory creation and payload size reporting on Windows_NT
  • keep the existing POSIX commands for Linux and macOS hosts
  • set GOOS, GOARCH, and CGO_ENABLED with Windows set syntax for build-windows
  • keep the Zig compile recipe on one line so native Windows Make does not pass POSIX line continuations to cmd.exe

Why

Native Windows GNU Make falls back to cmd.exe when no POSIX shell is available. The existing recipes use mkdir -p, backslash shell continuations, and GOOS=windows ... environment prefixes, which fail with command syntax errors. This fixes both make payload and make build-windows in that environment without changing the POSIX path.

Validation

  • verified Windows and POSIX command expansion with dry runs
  • ran make build-windows successfully on Windows with GNU Make 4.4.1 and Zig 0.16.0
  • built abe_extractor_amd64.bin successfully (75,776 bytes)

@kkive
kkive marked this pull request as ready for review August 18, 2026 09:02
@moonD4rk moonD4rk changed the title fix Windows native Make builds fix: Add windows native ABE make builds Aug 19, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.26%. Comparing base (0f6a529) to head (bcbeb3b).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #635   +/-   ##
=======================================
  Coverage   73.26%   73.26%           
=======================================
  Files          69       69           
  Lines        3217     3217           
=======================================
  Hits         2357     2357           
  Misses        637      637           
  Partials      223      223           
Flag Coverage Δ
unittests 73.26% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 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.

@moonD4rk
moonD4rk requested review from moonD4rk and a balanced review from Copilot August 19, 2026 02:56

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds native Windows GNU Make support for ABE payload and executable builds.

Changes:

  • Adds cmd.exe-compatible environment setup.
  • Adds platform-specific directory creation and payload size reporting.
  • Preserves POSIX build commands on Linux and macOS.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
Makefile Adds a native Windows build-windows recipe.
crypto/windows/abe_native/Makefile.frag Adds Windows-compatible payload build commands.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@moonD4rk moonD4rk left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks — nice work, and it does work. I reproduced it on a Windows 10 VM (GNU Make 4.4.1 + Zig 0.16.0, no POSIX shell) and both targets build correctly. The %%I form is right too — native Make runs recipes through a temp batch file.

One problem: ifeq ($(OS),Windows_NT) checks the OS, but what changed is the shell. MSYS2 and Git Bash also set OS=Windows_NT while using sh, so they hit the cmd branch too — make payload fails outright, and make build-windows silently builds for the host (set "GOOS=..." in sh doesn't set the environment).

Checking the shell instead works:

# cmd echoes the quotes back, POSIX sh strips them
ifeq ($(shell echo "x"),"x")
WIN_CMD_SHELL := 1
endif

Two things that would shrink the diff:

  • build-windows needs no branch at all — build-windows: export GOOS := windows (plus GOARCH, CGO_ENABLED) lets Make set the environment directly. Verified on Make 3.81 and 4.4.1.
  • ABE_MKDIR_CMD can go — crypto/windows/payload/ is tracked in git, so it always exists.

Also built ... - 75776 bytes vs POSIX (75776 bytes) — worth matching.

@DUptain1993

Copy link
Copy Markdown
Contributor

Superseded by #642, which applies the review feedback here:

  • shell detection via $(shell echo "x") instead of OS=Windows_NT
  • build-windows: export GOOS/GOARCH/CGO_ENABLED (no branch)
  • drop ABE_MKDIR_CMD; match (N bytes) reporting

@moonD4rk

Copy link
Copy Markdown
Owner

Fixed in #642

@moonD4rk moonD4rk closed this Sep 25, 2026
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.

5 participants