Skip to content

Conversation

@mithro
Copy link
Owner

@mithro mithro commented Nov 16, 2025

Summary

  • Add comprehensive Windows C++ compilation testing workflow with GitHub Actions
  • Test MSVC 2019 across x86/x64 architectures and Od/O2 optimization levels
  • Verify reproducibility of msvcpp-normalize-pe with real MSVC-compiled binaries
  • Include test programs (simple.cpp, complex.cpp) and reference binary structure
  • ✅ All tests passing - reproducibility verified!

Test Plan

  • All local tests pass (19 passed, 3 skipped - integration tests await reference binaries)
  • Workflow file syntax validated
  • C++ test programs created and documented
  • Reference binary structure set up with Git submodule
  • Documentation updated with workflow badge and fixture information
  • First workflow run completed successfully
  • Reference binaries generated and committed to submodule
  • Submodule repository created and configured
  • All 8 workflow jobs passing with reproducibility verification

Implementation

This implements the design from docs/plans/2025-11-17-windows-cpp-testing-design.md.

Matrix: 8 jobs (1 MSVC version × 2 arch × 2 opt × 2 programs)

  • MSVC 2019 only (toolset 14.2 - available on windows-latest runners)
  • Architectures: x86, x64
  • Optimizations: /Od (debug), /O2 (optimized)
  • Programs: simple (minimal), complex (with STL)

Workflow Steps:

  1. Compile C++ with MSVC + /Brepro
  2. Patch with msvcpp-normalize-pe
  3. Verify reproducibility against reference binaries
  4. Test patched binary execution
  5. Upload artifacts (both original and patched)

Repositories

  • Main: mithro/msvcpp-normalize-pe
  • Reference binaries: mithro/msvcpp-normalize-pe-test-binaries (Git submodule at tests/fixtures/references/)

Results

All 8 workflow jobs passing

  • Compilation: ✅ All binaries build successfully
  • Patching: ✅ All binaries patched successfully
  • Reproducibility: ✅ All hash comparisons match (byte-for-byte identical)
  • Runtime: ✅ All patched binaries execute correctly

Latest workflow run: https://github.com/mithro/msvcpp-normalize-pe/actions/runs/19413573367

Commits

  1. Add C++ test programs (simple.cpp, complex.cpp)
  2. Add references directory structure
  3. Add GitHub Actions workflow
  4. Update documentation (README badge, fixture docs)
  5. Fix workflow issues (uv --system, MSVC 2019 only)
  6. Fix documentation consistency
  7. Add test binaries submodule
  8. Populate submodule with reference binaries

🤖 Generated with Claude Code

mithro and others added 9 commits November 17, 2025 08:47
Add comprehensive design for Windows-based C++ compilation testing system
that will verify reproducibility of msvcpp-normalize-pe across multiple
MSVC versions, architectures, and optimization levels.

Key features:
- Matrix testing: MSVC 2017/2019/2022 × x86/x64 × Od/O2 × 2 programs
- Reference binaries stored in Git submodule
- Always upload artifacts for debugging and reference generation
- Runtime validation of patched binaries

Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
Add simple and complex C++ programs to test PE patching:
- simple.cpp: minimal program for basic PE structure testing
- complex.cpp: realistic program with STL for complex PE testing

Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
Set up structure for reference binaries (to be added as submodule).
Includes documentation for future submodule setup and reference generation.

Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
Add comprehensive GitHub Actions workflow that:
- Tests MSVC 2017, 2019, 2022 across x86/x64 and Od/O2
- Compiles C++ test programs with /Brepro
- Patches binaries with msvcpp-normalize-pe
- Verifies reproducibility against reference binaries
- Tests runtime execution of patched binaries
- Uploads artifacts for debugging and reference generation

Matrix: 24 jobs (3 MSVC × 2 arch × 2 opt × 2 programs)

Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
Add GitHub Actions badge for Windows C++ compilation tests.
Document fixture structure and generation process.

Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
Fix two critical issues discovered during workflow execution:

1. Add --system flag to uv pip install
   - Change: uv pip install . → uv pip install --system .
   - Required for installing packages in GitHub Actions environment

2. Simplify MSVC matrix to use only 2019 toolset
   - Change: msvc: ['2017', '2019', '2022'] → msvc: ['2019']
   - Only MSVC 2019 (toolset 14.2) is available on windows-latest runners
   - MSVC 2017 (14.1) and MSVC 2022 (14.3) are not installed by default
   - Reduces from 24 jobs to 8 jobs while ensuring all tests can run

Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
The workflow only tests MSVC 2019 (8 jobs), not 2017/2019/2022 (24 jobs).

Updated all three README files to accurately reflect:
- Only MSVC 2019 is tested (default on windows-latest)
- 8 reference binaries, not 24
- Binary naming examples use msvc2019 consistently
- Added note explaining windows-latest runner limitation

Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Replace placeholder directory with actual Git submodule pointing to
mithro/msvcpp-normalize-pe-test-binaries repository.

This submodule will store the reference binaries for reproducibility
testing once they are generated from the workflow artifacts.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Update submodule to include the 8 MSVC 2019 reference binaries
generated from the first successful workflow run.

These binaries enable reproducibility testing in future workflow runs.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@mithro
Copy link
Owner Author

mithro commented Nov 16, 2025

Status Update: All Tests Passing! ✅

The Windows C++ compilation testing is now fully operational:

Completed Tasks

  • ✅ Reference binaries submodule created and configured
  • ✅ All 8 reference binaries generated and committed
  • ✅ Latest workflow run: All 8 jobs passing
  • ✅ Reproducibility verification successful (all hashes match)
  • ✅ Runtime tests passing (all patched binaries execute correctly)

Latest Results

Workflow run: https://github.com/mithro/msvcpp-normalize-pe/actions/runs/19413573367

All 8 matrix combinations tested successfully:

  • Programs: simple, complex
  • Architectures: x86, x64
  • Optimizations: /Od, /O2
  • MSVC version: 2019

Verification

The workflow successfully verifies byte-for-byte reproducibility by comparing newly compiled+patched binaries against the reference binaries stored in the mithro/msvcpp-normalize-pe-test-binaries submodule.

Ready to merge! 🚀

GitHub
Normalize Windows PE files for byte-for-byte reproducible MSVC++ builds by patching timestamps, GUIDs, and debug metadata - Add Windows C++ compilation testing · 4e939e8

@mithro mithro merged commit 3a3ceb5 into main Nov 16, 2025
25 checks passed
@mithro mithro deleted the feature/windows-cpp-tests branch November 16, 2025 23:24
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