Fix CI failures in Windows#1402
Merged
Merged
Conversation
f18eedb to
0ad35e3
Compare
reyammer
approved these changes
May 20, 2026
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.
This is vibe-coded. Below is what the agent had to say.
This PR fixes a
FileNotFoundErrorthat occurs on Windows CI runners during package testing.The Problem
When building mixed Rust/Python packages with
maturinusingbindings = "bin",maturinpackages the Rust CLI binary inside the wheel and installs a small Python launcher script (which handles DLL loading foronnxruntimeon Windows) into the wheel'sscriptsdirectory.On Windows,
pipinstalls this launcher script into the environment'sScriptsfolder asmagikawithout a.exeextension. Because it lacks an extension, Windows'CreateProcessAPI (invoked by Python'ssubprocess.run(..., shell=False)) fails to execute it directly, resulting in:The Solution
Instead of trying to alter how
maturinorpippackages the wheel on Windows, this PR implements a robust, portable workaround in the test/check scripts (run_quick_test_magika_cli.pyandpre_release_check.py):shutil.which(due to the missing extension), the scripts now manually locate it in the active environment's standardScriptsdirectory usingsysconfig.get_path("scripts").#!), it is identified as the launcher script.sys.executable):python.exe C:\...\Scripts\magika --versionThis bypasses the Windows execution limitation and successfully boots the Rust client via the launcher.
Why this approach?
bashdependency: Avoids assumingbashis present, ensuring the test suite remains runnable locally for Windows developers using standard PowerShell/CMD.bash.sysconfigto find the installation directory reliably across all Python versions (3.8+).