Skip to content

Tests: the CI's Windows build and Wine smoke in a local image - #184

Merged
compot-dev merged 1 commit into
masterfrom
windows-check-image
Nov 18, 2026
Merged

compot-dev merged 1 commit into
masterfrom
windows-check-image

Conversation

@compot-dev

Copy link
Copy Markdown
Collaborator

docker/test-windows.sh runs the CI jobs Windows and Wine smoke locally, so a change can be checked before a push without waiting for CI.

  • docker/Dockerfile.mingw: Ubuntu 24.04 (the runners' release) with the packages those jobs install: gcc-mingw-w64-x86-64-win32, gcc-mingw-w64-i686-win32, wine64, wine32. About 0.7 GB. The script builds it once as camex-mingw; --rebuild refreshes it.
  • For x86_64 and i686: build from a copy of the tree (no objects in the work tree), check the PE type, run --version and --help under Wine in a win64 or win32 prefix. OUT=dir keeps the two .exe files.

A run takes about 10 s once the image exists, against minutes of package installs in a throwaway container.

Test-only: no change to the released files, hence no-release.

Checked: docker/test-windows.sh passes for both architectures (camex 4.0.1 under Wine); shellcheck is clean.

docker/test-windows.sh builds the camex-mingw image once (Ubuntu 24.04,
the win32 MinGW compilers for x86_64 and i686, wine64 and wine32, as the
CI jobs Windows and Wine smoke install) and runs those jobs in it: both
builds from a copy of the tree, the PE type, --version and --help under
Wine. About 10 s against minutes of package installs per check.
@compot-dev compot-dev added the no-release Changes the build or the code without changing the binaries: no new version, no release label Nov 18, 2026
@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

PR Summary by Qodo

Add local Windows build and Wine smoke checks

🧪 Tests ✨ Enhancement 🕐 10-20 Minutes

Grey Divider

AI Description

• Add a reusable Ubuntu image matching the CI Windows build and Wine smoke dependencies.
• Build and smoke-test x86_64 and i686 executables locally without changing the work tree.
• Allow image refreshes and optional retention of both executables.
Merge Risk 🟢 Low

Blast radius 🟢 Low 💥 0 capabilities

  • No production behavior changes identified.
Behavioral complexity 🟢 Low 🧩 Assessed behavior

  • No production behavior changes identified.
Potential damage 🟢 Low 🩹 Assessed behavior

  • No production behavior changes identified.
Assessed commit 53811a4 > Snapshot assessment: the current PR revision could not be verified.
Diagram

graph TD
  Script["Local test script"] --> Image["Cached Ubuntu image"] --> Copy["Source copy"] --> Build["MinGW builds"] --> Exe["Windows executables"] --> PE{"PE type valid?"} --> Wine["Wine smoke checks"]
  Exe --> Out["Optional OUT directory"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Run the CI jobs locally with act
  • ➕ Reuses workflow definitions and reduces the risk of test drift.
  • ➖ Requires additional tooling and may retain slow, per-job package installation.
  • ➖ Local workflow execution may not match hosted-runner behavior.

Recommendation: Keep the dedicated image and script for fast pre-push feedback. They deliberately replicate only the build and smoke checks, so maintainers should compare them with the CI jobs when those jobs change.

Files changed (2) +89 / -0

Tests (1) +70 / -0
test-windows.shRun local Windows builds and Wine smoke checks +70/-0

Run local Windows builds and Wine smoke checks

• Builds or reuses the image, copies the source tree inside the container, and compiles x86_64 and i686 executables. It verifies PE types, checks --version and --help under matching Wine prefixes, and supports --rebuild and optional OUT artifacts.

docker/test-windows.sh

Other (1) +19 / -0
Dockerfile.mingwProvide a reusable MinGW and Wine test image +19/-0

Provide a reusable MinGW and Wine test image

• Adds an Ubuntu 24.04 image with both win32 MinGW cross-compilers and 64- and 32-bit Wine dependencies. The image avoids reinstalling those packages on each local check.

docker/Dockerfile.mingw

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Spaces in output paths stop local tests 🐞 Bug ≡ Correctness
Description
OUT_MOUNT stores the volume option and its path in one string, which the docker run command
expands without quotes. When OUT contains a space, shell field splitting separates the host path
into multiple arguments and Docker cannot mount the requested output directory.
Code

docker/test-windows.sh[40]

+    -v "$REPO_DIR:/src:ro" $OUT_MOUNT "$IMAGE" sh -c '
Evidence
The script constructs the mount from an absolute OUT path, then expands the entire option
unquoted. For OUT=/tmp/my output, this passes /tmp/my and output:/out as separate Docker
arguments.

docker/test-windows.sh[32-40]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Output paths containing spaces are split when the stored volume option is expanded in `docker run`.
## Fix Focus Areas
- docker/test-windows.sh[32-40]
## Recommended Fix
Build the optional volume arguments using shell positional parameters and pass them to `docker run` with `"$@"`, preserving the path as a single argument.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Help checks pass despite a failed program 🐞 Bug ≡ Correctness
Description
The --help smoke check pipes Wine's output to grep, so it tests grep's exit status rather than
the executable's. If the executable prints “usage” but exits nonzero, both help pipelines can
succeed and the script reports that architecture as passed.
Code

docker/test-windows.sh[67]

+        wine "$exe" --help 2>/dev/null | grep -qi usage || fail "--help under Wine" 2
Evidence
Both --help invocations are pipelines whose status comes from head or grep; unlike the
preceding --version check, neither captures Wine's status. The current help implementation prints
usage and normally returns success, demonstrating that matching output alone does not establish its
exit status.

docker/test-windows.sh[63-68]
src/main.c[228-231]
src/main.c[770-778]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The `--help` pipelines mask a nonzero exit from Wine or the executable when their final commands succeed.
## Fix Focus Areas
- docker/test-windows.sh[66-67]
## Recommended Fix
Capture `wine "$exe" --help` once, fail on its nonzero exit status, then print and inspect the captured output separately.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Tip of the day
💡 Did you know, you can type 'qodo, fix this' on a finding and the fix lands right on your PR

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@compot-dev
compot-dev merged commit 8b753d1 into master Nov 18, 2026
18 of 19 checks passed
@compot-dev
compot-dev deleted the windows-check-image branch November 18, 2026 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-release Changes the build or the code without changing the binaries: no new version, no release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant