fix(build): stop dropping the MSVC CRT from Windows packages (#650)#693
Open
neuregex wants to merge 1 commit into
Open
fix(build): stop dropping the MSVC CRT from Windows packages (#650)#693neuregex wants to merge 1 commit into
neuregex wants to merge 1 commit into
Conversation
) package-windows pulls VCRUNTIME140/VCRUNTIME140_1/MSVCP140 out of the mozbuild Visual Studio tree through a shell glob that pins one redist version (14.38.33135) and one toolset (VC143). Windows builds cross-compile on Linux and get their toolchain from mozbootstrap, so a different version there leaves the glob unexpanded -- and add_includes_to_package() skipped anything that did not exist, with no warning. The package then ships without the CRT. camoufox.exe imports those DLLs, so on any machine without the Visual C++ Redistributable installed the process dies immediately and Playwright surfaces only "spawn UNKNOWN". - glob the redist and toolset versions instead of pinning them - treat a missing --includes entry as fatal, so an unexpanded glob fails the build instead of silently shipping a broken package
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.
Related Issue
Closes #650
Description
#650 diagnosed the launch failure as a bad SxS manifest declaring
mozglueas awin32assembly dependency. That part is already gone. On a current build (v152.0.4-beta.25, win.x86_64) there is no embedded manifest at all — zero matches forassemblyIdentity,dependentAssembly,urn:schemas-microsoft-com:asm,trustInfoorrequestedExecutionLevel— andmozglue.dllappears only in the import table, which is correct for a private DLL sitting next to the binary.But the same user-visible symptom (
spawn UNKNOWN, process exits instantly, nothing on stdout) is still reachable through a second, unrelated path: the package can ship without the MSVC CRT.package-windowspulls the CRT out of the mozbuild VS tree with:That pins one redist version (
14.38.33135) and one toolset (VC143). Windows builds cross-compile onubuntu-24.04and get their toolchain frommake mozbootstrap, so if the version on the runner differs the shell never expands the glob and make passes the literal pattern through.add_includes_to_package()then hits:…and skips it silently. The package builds, uploads and releases with no CRT, while
camoufox.exeimportsVCRUNTIME140.dll,VCRUNTIME140_1.dllandMSVCP140.dll— so it cannot start on a machine that doesn't already have the Visual C++ Redistributable installed.That also explains why this reads as a "clean systems" bug: developer machines almost always have the redistributable pulled in by other tooling, so it launches fine there and dies on a fresh install.
Scope note: I observed the missing DLLs on a v152.0.4-beta.25
win.x86_64package produced by this repo's build workflow, not on the official release asset (469 MB, and range requests against the signed asset URL didn't cooperate). Whether a given official build is affected depends on the toolchain version present on the runner at build time — worth checking a current release artifact forVCRUNTIME140.dll. The failure mode itself is in the packaging code either way.Changes
MSVC/*/…/Microsoft.VC*.CRT/*.dll) instead of pinning them, so a toolchain bump can't silently drop the CRT.--includesentry is now fatal. An unexpanded glob fails the build loudly instead of quietly producing a package that can't start.Type of Change
Testing
VCRUNTIME140*.dll/MSVCP140.dllanywhere, whilecamoufox.exeimports all three (they resolve fromSystem32on machines that have the redistributable).python -m py_compile scripts/package.pypasses.--includesentry (settings/chrome.css,settings/camoucfg.jvv,settings/properties.json, and the CRT glob when it expands) exists, so nothing changes except that a broken glob now fails instead of shipping.I don't have a Windows cross-compile environment to run a full
make package-windowsend to end — if you can trigger a build off this branch, the CRT DLLs should now appear in the archive (and the build should fail loudly if they can't be found).Fingerprint Report
This PR only touches the packaging step (Makefile +
scripts/package.py); no patches, browser source orpythonlib/behaviour changes, so there's no fingerprint surface for it to affect. Happy to run the suites anyway if you'd like them attached.