Multipass bug prevents snapcraft from building on windows when using base keyword
Metadata
Current evaluation
The Windows hang was an upstream Multipass defect; canonical/multipass#1170 fixed it on master for release 1.1.
Resolution: closed resolved
Reason: The author confirmed that canonical/multipass#1170 fixed the underlying Multipass bug on master, and the fix was scheduled for Multipass 1.1.
Evaluated by: mr-cal-bot
No scores available.
Issue body
Note: this is after fixing the "getuid" bug on Windows: https://github.com/snapcore/snapcraft/pull/2894
snapcraft will hang during a build on Windows on snaps using the base keyword due to a bug in Python on Windows, specifically this bug: https://bugs.python.org/issue8631
It is apparently pernicious and has been around for a while.
After launching the multipass VM, snapcraft will refresh the core and snapcraft snaps and then attempts to run "printenv HOME" to get the home directory on the VM. It will then hang while waiting for that call to return.
Starts at: https://github.com/snapcore/snapcraft/blob/master/snapcraft/internal/build_providers/_base_provider.py#L206
Which eventually calls subprocess.check_output(): https://github.com/snapcore/snapcraft/blob/master/snapcraft/internal/build_providers/_multipass/_multipass_command.py#L41
subprocess.check_output eventually calls communicate(), which then hangs here when checking stdout: https://github.com/python/cpython/blob/v3.7.6/Lib/subprocess.py#L951
I believe this is an issue with the child process finishing before stdout is read. Apparently this is fixed in the latest master on python: https://github.com/python/cpython/commit/d3ae95e1e945ed20297e1c38ba43a18b7a868ab6
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | The Windows hang was an upstream Multipass defect; canonical/multipass#1170 fixed it on master for release 1.1. | |
| stealth/space-bunny-alpha | — | closed resolved | Windows base-build hangs were reclassified as an upstream Multipass bug; canonical/multipass#1170 fixed it on master for release 1.1. | |
| stealth/space-bunny-alpha | — | closed stale | Windows Multipass builds could hang while reading HOME from the VM; closed without a recorded fix, superseding change, or maintainer explanation. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed as abandoned. The hang stems from an upstream Python subprocess bug triggered by Multipass VM commands on Windows. No snapcraft-side fix was implemented, relying instead on upstream Python updates. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed. The Windows build hang was resolved by an upstream Python subprocess fix, requiring no snapcraft-side changes. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed as a known upstream Python subprocess bug. No snapcraft-side workaround was implemented, leaving the issue abandoned or superseded by Python updates. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed without resolution. The Windows hang during base builds stems from a Python subprocess bug. Likely superseded by Python updates or closed as stale due to inactivity. |
Update history
| Date | Change |
|---|---|
| created |
Related work
-
Likely Fixed By:
multipass#1170
(confidence 99%)
Upstream Multipass fix included in version 1.1.
-
Related To:
snapcore/snapcraft#2894
(confidence 90%)
Earlier Windows getuid fix identified as a prerequisite for reproducing this hang.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #3563 multipass: bump windows installer to 1.7.0 (CRAFT-412) | snapcraft | merged | Merged PR #3563 in c76531490, bumping Snapcraft's Windows Multipass installer to 1.7.0 and accounting for its new default of disabled privileged mounts. | |
| #1806083 snapcraft fails to locate multipass (inside a multipass session) | snapcraft (launchpad) | open | Snapcraft 3.0.1 falsely reported Multipass missing inside a Multipass guest; Darwin-only detection in e9ae8d29f addressed the old path, but the Launchpad record remains open. | |
| #1791821 multipass should use snapcraft defined environments | snapcraft (launchpad) | closed | Multipass now launches Snapcraft-defined build images; fixed by canonical/snapcraft#2258 (commit 5ffefbf96), including a Darwin launch workaround. | |
| #2293 build providers: use the new snapcraft: remote for multipass | snapcraft | merged | Merged PR #2293 as commit 66060e839, switching Multipass builds to the snapcraft: remote and delegating unsupported-base errors to Multipass. | |
| #2447 build providers: remove SIGUSR1 signal ignore workaround for multipass | snapcraft | merged | Merged PR #2447 (commit a2ef08109) removed Snapcraft's SIGUSR1-ignore workaround after Multipass fixed the underlying bug upstream in canonical/multipass#221. | |
| #5145 snapcraft fails to launch multipass instance when multipass isn't pre-installed | snapcraft | open | Snapcraft emits cryptic 'Remote "snapcraft" is unknown or unreachable / exit code 2' when Multipass can't launch the build instance; maintainer traced it to image-server unavailability or non-amd64 hosts, fix tracked in craft-providers#211 | |
| #2869 build providers: use multipass from stable | snapcraft | merged | Merged in canonical/snapcraft#2869 (commit eb9bd8fbf), switching build providers to install Multipass 1.0 from the stable channel. | |
| #2694 multipass: fix setup exception when multipass is not found in PATH | snapcraft | merged | Merged into master as c3e544dc9, handling missing Multipass in PATH with a clear SnapcraftEnvironmentError. | |
| #2258 build providers: snapcraft images for multipass | snapcraft | merged | Merged PR #2258 as commit 5ffefbf96, adding Snapcraft build images for Multipass and a Darwin launch workaround for LP #1791821. | |
| #1859427 'multipass' does not exist or is not available on the desired channel 'latest/beta' | snapcraft (launchpad) | closed | Fixed by merged PR snapcore/snapcraft#2869 (commit eb9bd8fbf), changing automatic Multipass installation from latest/beta to stable. |