Stop UPX-packing Windows release executables - #374
Open
4Luke4 wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
opam var bininstead of a repository-specific absolute path.Problem
Issue #373 reports that Microsoft Defender detects:
in
WeiDU-Windows-251.zipand in some subsequent nightly Windows archives.The Windows distribution target currently performs two separate forms of compression:
Executable packing changes the PE representation and can trigger heuristic antivirus detections. ZIP already provides distribution compression, so applying an executable packer first is unnecessary and makes the Windows artifacts more susceptible to signature- and heuristic-based false positives.
This change removes the generic trigger rather than adding a Defender-specific exception, detection-name allow-list, hardcoded file hash, or end-user workaround.
Controlled reproduction
A disposable GitHub Actions workflow tested the exact release assets referenced in issue #373:
v251.00/WeiDU-Windows-251.zipv252.01-nightly-686875d/WeiDU-Windows-25201.zipFor each release, the workflow:
downloaded the published Windows ZIP without rebuilding or modifying it;
verified that all three executables were valid UPX-packed payloads;
copied the extracted distribution;
losslessly decompressed only the three executables with
upx -d;recreated the archive using the same Info-ZIP command used by the production target:
updated Microsoft Defender security intelligence;
verified that Defender was enabled and running in
Normalmode;scanned the original and unpacked/repacked archives with remediation disabled.
This isolates executable packing as the material variable while preserving the published files and the production ZIP implementation.
Validation results
Microsoft Defender environment:
Normal4.18.26060.30081.455.378.02026-07-27T11:07:40ZProduction-equivalent Info-ZIP comparison:
WeiDU-Windows-251.zipzip -9rzip -9rThe original v251 archive reproduced the issue exactly:
The corresponding archive containing the same distribution after UPX decompression was clean.
The referenced nightly remained clean in both packed and unpacked forms, confirming that the heuristic is sensitive to the particular packed binary/archive representation rather than being emitted for every WeiDU or UPX build.
A broader comparison also scanned the original and unpacked forms both as ZIP archives and as extracted directories. Every unpacked fixture was clean.
Validation runs:
The disposable workflows and generated reports were removed from the production branch after the evidence was collected.
Implementation
MakefileThe
windows_ziptarget still:WeiDU-Windows;It no longer invokes
upx --beston:weidu.exe;weinstall.exe;tolower.exe.The Linux and macOS distribution targets retain their existing UPX behavior.
.github/workflows/main.yamlThe Windows job now installs ZIP without installing UPX:
The Elkhound destination is also obtained from the active opam switch:
This avoids depending on a hardcoded GitHub Actions checkout path.
README.mdThe Windows requirements no longer list UPX, since Windows distribution packaging no longer uses it.
Scope
This change does not:
Already-published archives are not modified retroactively. New Windows nightlies and releases built after this change will contain stripped but non-UPX-packed executables.
Fixes #373