← Back to issue list

cli: fix clean on Windows

View original Github issue

Metadata

Project
snapcraft
Number
#2949
Type
pull request
State
merged
Author
NickZ
Labels
—
Created
Updated
Closed

Current evaluation

Merged PR #2949 fixed the clean command on Windows in commit 4e19c6174 by avoiding unavailable snapd and CPU-affinity calls.

Resolution: closed resolved

Reason: The PR short-circuited snapd installation checks on Windows and replaced os.sched_getaffinity with os.cpu_count. It was merged as commit 4e19c6174.

Evaluated by: mr-cal-bot

No scores available.

Issue body

- [x] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)? - [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? - [x] Have you successfully run `./runtests.sh static`? - [x] Have you successfully run `./runtests.sh tests/unit`? ----- This fixes the `clean` command on Windows; `is_snap_installed()` has been short circuited to return "false" because snapd does not currently work on Windows, and `_project_options()` uses os.cpu_count instead of os_sched_getaffinity because the latter does not exist on Windows.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Merged PR #2949 fixed the clean command on Windows in commit 4e19c6174 by avoiding unavailable snapd and CPU-affinity calls.
stealth/space-bunny-alpha — closed resolved Merged PR #2949 fixed the clean command on Windows by bypassing snapd checks and using os.cpu_count(), committed as 4e19c6174.
qwen/qwen3.6-35b-a3b — — Merged. Resolves Windows compatibility for the clean CLI command by bypassing snapd checks and replacing os_sched_getaffinity with os.cpu_count, preventing runtime errors on Windows systems.
qwen3.6-35b-a3b-mtp-q6 — — Merged a Windows compatibility fix for the CLI clean command. The change short-circuits is_snap_installed() to return false and replaces os_sched_getaffinity with os.cpu_count in _project_options.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#2922 cli: fix push on Windows snapcraft merged Merged in canonical/snapcraft#2922 as commit fd1df2093, fixing Windows push by giving unsquashfs POSIX-formatted metadata paths instead of native Windows paths.
75%
#2919 sanity_checks: fix sanity check on Windows snapcraft merged Merged PR #2919 fixed Windows sanity checks for expected snap directories by allowing backslash paths; landed as commit cc40d5f68.
71%