Skip to content

Fix Windows CI with MSVC 19.52 - #10569

Merged
radarhere merged 2 commits into
mainfrom
winbuild-dav1d-msvc
Nov 20, 2026
Merged

radarhere merged 2 commits into
mainfrom
winbuild-dav1d-msvc

Conversation

@aclark4life

@aclark4life aclark4life commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Some GitHub Actions Windows runners now use MSVC 14.52 (compiler 19.52). This breaks Windows CI in two ways.

1. dav1d fails to build

libavif's bundled dav1d fails to compile:

..\dav1d-src\include\compat\msvc\stdatomic.h(35): error C7780: function-like macro '__has_include_next' is not defined
..\dav1d-src\include\compat\msvc\stdatomic.h(35): fatal error C1017: invalid integer constant expression

libavif 1.4.2 pins dav1d 1.5.3, and libavif's main branch currently pins 1.5.4. dav1d fixed this in 1.5.5 (a34e068, "compat: Fix building with newer versions of MSVC"). libavif sets AVIF_DAV1D_TAG with a plain set(), so it can't be overridden from the command line. This patches LocalDav1d.cmake to use 1.5.5. The patch asserts that the original line is present, so the build will fail once libavif changes its pin, and we'll know to update or remove the patch.

2. BC7 decoding is wrong on x64

With dav1d fixed, the x64 jobs on 14.52 fail test_dx10_bc7. The jobs on 14.51 (x64), 14.44 (x86) and 14.52 (arm64) pass. Comparing the CI output image with the expected one:

  • BC7 blocks using the two-subset modes (1, 3 and 7) are almost all wrong.
  • Blocks using modes 0, 4, 5 and 6 are all correct.
  • Within each bad block, a run of about 4 consecutive pixels is wrong, which looks like the per-pixel loop being vectorized incorrectly.

I couldn't find undefined behaviour in that code, so this looks like a compiler regression. This disables vectorization of the loop for MSVC 19.52 and later on x64.

🤖 Generated with Claude Code

libavif 1.4.2 builds dav1d 1.5.3, whose MSVC stdatomic.h compat header
fails to compile with MSVC 19.52 (error C7780: function-like macro
'__has_include_next' is not defined). This is fixed in dav1d 1.5.5.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@aclark4life aclark4life added the 🤖-assisted AI-assisted label Nov 20, 2026
@aclark4life aclark4life changed the title Use dav1d 1.5.5 when building libavif on Windows Fix Windows CI with MSVC 19.52 Nov 20, 2026
@radarhere

Copy link
Copy Markdown
Member

The BC7 fix does not appear to have worked - https://github.com/python-pillow/Pillow/actions/runs/44669915088/job/136068142847?pr=10569#step:30:9738

@radarhere

Copy link
Copy Markdown
Member

The BC7 failure was occurring on ARM earlier, and was fixed in #10521. I've pushed a similar fix.

@radarhere
radarhere merged commit 6761cbd into main Nov 20, 2026
146 of 149 checks passed
@radarhere
radarhere deleted the winbuild-dav1d-msvc branch November 20, 2026 05:58
Comment thread winbuild/build_prepare.py
Comment on lines +437 to +442
"patch": {
r"cmake\Modules\LocalDav1d.cmake": {
# dav1d 1.5.5 fixes building with MSVC 19.52 and later
'set(AVIF_DAV1D_TAG "1.5.3")': 'set(AVIF_DAV1D_TAG "1.5.5")',
},
},

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to update our SBOM to mention this patch?


For reference, here's a PR to bump libavif to dav1d 1.5.5:

AOMediaCodec/libavif#3460

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've created #10571. I don't think it's a cherry-pick, because we didn't include everything from the commit in that PR. I've also described in the notes that this patch is only for Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants