Windows build artifacts error #6

Closed
opened 2026-05-27 04:13:59 +02:00 by jorijnvdgraaf · 10 comments

The workflow hasn't produced a windows artifact in a while now and keeps having errors, it should be fixed so that the windows artifacts compile

Build Windows x86-64-v2 (mingw)30s
In file included from /root/.cache/crafter.build/external/Crafter.Asset-ee67459bba379f81/lib/gdeflate/libdeflate/lib/utils.c:36:
/usr/x86_64-w64-mingw32/include/stdlib.h:616:54: error: expected identifier or '('
616 | __MINGW_EXTENSION unsigned __int64 __cdecl _rotr64(unsigned __int64 _Val,int _Shift);
| ^
/usr/x86_64-w64-mingw32/include/stdlib.h:616:54: error: expected ')'
/usr/x86_64-w64-mingw32/include/stdlib.h:616:46: note: to match this '('
616 | __MINGW_EXTENSION unsigned __int64 __cdecl _rotr64(unsigned __int64 _Val,int _Shift);
| ^
/root/.cache/crafter.build/external/Crafter.Asset-ee67459bba379f81/lib/gdeflate/libdeflate/lib/../common/compiler_gcc.h:216:23: note: expanded from macro '_rotr64'
216 | #define _rotr64(x,n) ((x>>n) + (x<<(64-n)))
| ^
In file included from /root/.cache/crafter.build/external/Crafter.Asset-ee67459bba379f81/lib/gdeflate/libdeflate/lib/utils.c:36:
/usr/x86_64-w64-mingw32/include/stdlib.h:616:46: error: expected ')'
616 | __MINGW_EXTENSION unsigned __int64 __cdecl _rotr64(unsigned __int64 _Val,int _Shift);
| ^
/root/.cache/crafter.build/external/Crafter.Asset-ee67459bba379f81/lib/gdeflate/libdeflate/lib/../common/compiler_gcc.h:216:30: note: expanded from macro '_rotr64'
216 | #define _rotr64(x,n) ((x>>n) + (x<<(64-n)))
| ^
/usr/x86_64-w64-mingw32/include/stdlib.h:616:46: note: to match this '('
/root/.cache/crafter.build/external/Crafter.Asset-ee67459bba379f81/lib/gdeflate/libdeflate/lib/../common/compiler_gcc.h:216:22: note: expanded from macro '_rotr64'
216 | #define _rotr64(x,n) ((x>>n) + (x<<(64-n)))
| ^
3 errors generated.

The workflow hasn't produced a windows artifact in a while now and keeps having errors, it should be fixed so that the windows artifacts compile Build Windows x86-64-v2 (mingw)30s In file included from /root/.cache/crafter.build/external/Crafter.Asset-ee67459bba379f81/lib/gdeflate/libdeflate/lib/utils.c:36: /usr/x86_64-w64-mingw32/include/stdlib.h:616:54: error: expected identifier or '(' 616 | __MINGW_EXTENSION unsigned __int64 __cdecl _rotr64(unsigned __int64 _Val,int _Shift); | ^ /usr/x86_64-w64-mingw32/include/stdlib.h:616:54: error: expected ')' /usr/x86_64-w64-mingw32/include/stdlib.h:616:46: note: to match this '(' 616 | __MINGW_EXTENSION unsigned __int64 __cdecl _rotr64(unsigned __int64 _Val,int _Shift); | ^ /root/.cache/crafter.build/external/Crafter.Asset-ee67459bba379f81/lib/gdeflate/libdeflate/lib/../common/compiler_gcc.h:216:23: note: expanded from macro '_rotr64' 216 | #define _rotr64(x,n) ((x>>n) + (x<<(64-n))) | ^ In file included from /root/.cache/crafter.build/external/Crafter.Asset-ee67459bba379f81/lib/gdeflate/libdeflate/lib/utils.c:36: /usr/x86_64-w64-mingw32/include/stdlib.h:616:46: error: expected ')' 616 | __MINGW_EXTENSION unsigned __int64 __cdecl _rotr64(unsigned __int64 _Val,int _Shift); | ^ /root/.cache/crafter.build/external/Crafter.Asset-ee67459bba379f81/lib/gdeflate/libdeflate/lib/../common/compiler_gcc.h:216:30: note: expanded from macro '_rotr64' 216 | #define _rotr64(x,n) ((x>>n) + (x<<(64-n))) | ^ /usr/x86_64-w64-mingw32/include/stdlib.h:616:46: note: to match this '(' /root/.cache/crafter.build/external/Crafter.Asset-ee67459bba379f81/lib/gdeflate/libdeflate/lib/../common/compiler_gcc.h:216:22: note: expanded from macro '_rotr64' 216 | #define _rotr64(x,n) ((x>>n) + (x<<(64-n))) | ^ 3 errors generated.
Member

claude:claim:dd9cc601-74bb-4709-8504-94a97490d60e

claude:claim:dd9cc601-74bb-4709-8504-94a97490d60e
Member

[progress]

Let me look at the actual build issue. The error is about libdeflate's `_rotr64` macro colliding with mingw's stdlib.h declaration. Let me investigate how C files get compiled in Crafter.Build.
**[progress]** ``` Let me look at the actual build issue. The error is about libdeflate's `_rotr64` macro colliding with mingw's stdlib.h declaration. Let me investigate how C files get compiled in Crafter.Build. ```
Member

[progress]

Let me check if I can access Crafter.Asset since the issue is in its vendored gdeflate/libdeflate.
Let me check upstream libdeflate to see how they handle this:
**[progress]** ``` Let me check if I can access Crafter.Asset since the issue is in its vendored gdeflate/libdeflate. Let me check upstream libdeflate to see how they handle this: ```
Member

[progress]

Let me verify my hypothesis by attempting the compile locally:
Let me check how those rotation macros are actually used in libdeflate to confirm the fix won't break anything:
**[progress]** ``` Let me verify my hypothesis by attempting the compile locally: Let me check how those rotation macros are actually used in libdeflate to confirm the fix won't break anything: ```
Member

[progress]

I'll fix the issue in two places: the actual bug is in Crafter.Asset's vendored libdeflate (`compiler_gcc.h` defines `_rotr64` as a macro before mingw's `<stdlib.h>` can declare it as a function). The CI fix here in Crafter.Build will pin the Crafter.Asset commit so the build is deterministic.

First, patch Crafter.Asset's compiler_gcc.h:
**[progress]** ``` I'll fix the issue in two places: the actual bug is in Crafter.Asset's vendored libdeflate (`compiler_gcc.h` defines `_rotr64` as a macro before mingw's `<stdlib.h>` can declare it as a function). The CI fix here in Crafter.Build will pin the Crafter.Asset commit so the build is deterministic. First, patch Crafter.Asset's compiler_gcc.h: ```
Member

[progress]

Now let me check the network-egress allowlist permits pushing to Crafter.Asset (it should — the same Forgejo host):
Let me pin the Crafter.Asset commit so this Crafter.Build PR is self-contained and CI can be re-run to verify the fix:
**[progress]** ``` Now let me check the network-egress allowlist permits pushing to Crafter.Asset (it should — the same Forgejo host): Let me pin the Crafter.Asset commit so this Crafter.Build PR is self-contained and CI can be re-run to verify the fix: ```
Member

[progress]

Let me check what the latest CI runs actually look like to be sure there's no other failure beyond the libdeflate one:
The libdeflate error is the blocking failure. Now let me pin the Crafter.Asset fix commit in Crafter.Build's project.cpp:
**[progress]** ``` Let me check what the latest CI runs actually look like to be sure there's no other failure beyond the libdeflate one: The libdeflate error is the blocking failure. Now let me pin the Crafter.Asset fix commit in Crafter.Build's project.cpp: ```
Member

[progress]

Now let me verify by reproducing the mingw build locally. I need mingw — let me check if I can run the bootstrap and then test:
Let me actually run the bootstrap + self-host build locally to verify both the Crafter.Asset pin works and project.cpp compiles. This will exercise the same code path as CI:
Bootstrap built fine. Now run the self-host pass on linux (this clones Crafter.Asset at the pinned SHA + builds full crafter-build):
**[progress]** ``` Now let me verify by reproducing the mingw build locally. I need mingw — let me check if I can run the bootstrap and then test: Let me actually run the bootstrap + self-host build locally to verify both the Crafter.Asset pin works and project.cpp compiles. This will exercise the same code path as CI: Bootstrap built fine. Now run the self-host pass on linux (this clones Crafter.Asset at the pinned SHA + builds full crafter-build): ```
Member

[progress]

Patched file is in the cache as expected. The pin works.

Since the actual mingw cross-build can't run locally (mingw-w64-gcc isn't installed and I don't have root), let me write a tight focused test that exercises the include-order semantics with a fake mingw `_rotr64` declaration — this proves the fix logic:
**[progress]** ``` Patched file is in the cache as expected. The pin works. Since the actual mingw cross-build can't run locally (mingw-w64-gcc isn't installed and I don't have root), let me write a tight focused test that exercises the include-order semantics with a fake mingw `_rotr64` declaration — this proves the fix logic: ```
Member

PR opened: #7

PR opened: https://forgejo.catcrafts.net/Catcrafts/Crafter.Build/pulls/7
Sign in to join this conversation.
No description provided.