windows build has more issues #9

Closed
opened 2026-05-27 04:58:15 +02:00 by jorijnvdgraaf · 8 comments

From the CI:

/workspace/Catcrafts/Crafter.Build/implementations/Crafter.Build-Clang.cpp:44:44: error: expected unqualified-id
44 | for(const std::unique_ptr& interface : this->interfaces) {
| ^
/usr/x86_64-w64-mingw32/include/rpc.h:12:19: note: expanded from macro 'interface'
12 | #define interface struct
| ^
/workspace/Catcrafts/Crafter.Build/implementations/Crafter.Build-Clang.cpp:51:9: error: expected ';' in 'for' statement specifier
51 | std::unordered_set<Configuration*> seen;
| ^
/workspace/Catcrafts/Crafter.Build/implementations/Crafter.Build-Clang.cpp:51:44: error: variable declaration in condition must have an initializer
51 | std::unordered_set<Configuration*> seen;
| ^
/workspace/Catcrafts/Crafter.Build/implementations/Crafter.Build-Clang.cpp:51:44: error: value of type 'std::unordered_set<Configuration >' is not contextually convertible to 'bool'
51 | std::unordered_set<Configuration
> seen;
| ^~~~
/workspace/Catcrafts/Crafter.Build/implementations/Crafter.Build-Clang.cpp:52:45: error: expected '(' for function-style cast or type construction
52 | std::function<bool(Configuration*)> walk = [&](Configuration* depCfg) -> bool {
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
/workspace/Catcrafts/Crafter.Build/implementations/Crafter.Build-Clang.cpp:52:45: error: expected ')'
/workspace/Catcrafts/Crafter.Build/implementations/Crafter.Build-Clang.cpp:44:12: note: to match this '('
44 | for(const std::unique_ptr& interface : this->interfaces) {
| ^
/workspace/Catcrafts/Crafter.Build/implementations/Crafter.Build-Clang.cpp:68:17: error: use of undeclared identifier 'walk'
68 | if (walk(depCfg)) return true;
| ^~~~
/workspace/Catcrafts/Crafter.Build/implementations/Crafter.Build-Clang.cpp:165:48: error: expected unqualified-id
165 | for(const std::unique_ptr& interface : this->interfaces) {
| ^
/usr/x86_64-w64-mingw32/include/rpc.h:12:19: note: expanded from macro 'interface'
12 | #define interface struct
| ^
/workspace/Catcrafts/Crafter.Build/implementations/Crafter.Build-Clang.cpp:197:13: error: expected ';' in 'for' statement specifier
197 | throw std::runtime_error(std::format("Module {} not found not found, referenced in {}", match[1].str(), file.string()));
| ^
/workspace/Catcrafts/Crafter.Build/implementations/Crafter.Build-Clang.cpp:197:13: error: value of type 'void' is not contextually convertible to 'bool'
197 | throw std::runtime_error(std::format("Module {} not found not found, referenced in {}", match[1].str(), file.string()));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/workspace/Catcrafts/Crafter.Build/implementations/Crafter.Build-Clang.cpp:198:13: error: use of undeclared identifier 'next4'
198 | next4:;
| ^~~~~
/workspace/Catcrafts/Crafter.Build/implementations/Crafter.Build-Clang.cpp:198:18: error: expected ')'
198 | next4:;
| ^
/workspace/Catcrafts/Crafter.Build/implementations/Crafter.Build-Clang.cpp:165:16: note: to match this '('
165 | for(const std::unique_ptr& interface : this->interfaces) {
| ^
/workspace/Catcrafts/Crafter.Build/implementations/Crafter.Build-Clang.cpp:818:34: error: expected unqualified-id
818 | for(std::unique_ptr& interface : config.interfaces) {
| ^
/usr/x86_64-w64-mingw32/include/rpc.h:12:19: note: expanded from macro 'interface'
12 | #define interface struct
| ^
/workspace/Catcrafts/Crafter.Build/implementations/Crafter.Build-Clang.cpp:840:5: error: expected ';' in 'for' statement specifier
840 | for(Implementation& implementation : config.implementations) {
| ^
/workspace/Catcrafts/Crafter.Build/implementations/Crafter.Build-Clang.cpp:840:5: error: expected expression
/workspace/Catcrafts/Crafter.Build/implementations/Crafter.Build-Clang.cpp:840:5: error: expected ';' in 'for' statement specifier
/workspace/Catcrafts/Crafter.Build/implementations/Crafter.Build-Clang.cpp:868:5: error: expected expression
868 | for(const std::string& flag : buildResult.libs) {
| ^
/workspace/Catcrafts/Crafter.Build/implementations/Crafter.Build-Clang.cpp:868:5: error: expected ')'
/workspace/Catcrafts/Crafter.Build/implementations/Crafter.Build-Clang.cpp:818:8: note: to match this '('
818 | for(std::unique_ptr& interface : config.interfaces) {
| ^
/workspace/Catcrafts/Crafter.Build/implementations/Crafter.Build-Clang.cpp:1474:63: error: missing '#include <stdint.h>'; 'uint16_t' must be declared before it is used
1474 | addr.sin_port = htons(static_cast<uint16_t>(p));
| ^
/usr/x86_64-w64-mingw32/include/stdint.h:38:25: note: declaration here is not visible
38 | typedef unsigned short uint16_t;
| ^
19 errors generated.

From the CI: /workspace/Catcrafts/Crafter.Build/implementations/Crafter.Build-Clang.cpp:44:44: error: expected unqualified-id 44 | for(const std::unique_ptr<Module>& interface : this->interfaces) { | ^ /usr/x86_64-w64-mingw32/include/rpc.h:12:19: note: expanded from macro 'interface' 12 | #define interface struct | ^ /workspace/Catcrafts/Crafter.Build/implementations/Crafter.Build-Clang.cpp:51:9: error: expected ';' in 'for' statement specifier 51 | std::unordered_set<Configuration*> seen; | ^ /workspace/Catcrafts/Crafter.Build/implementations/Crafter.Build-Clang.cpp:51:44: error: variable declaration in condition must have an initializer 51 | std::unordered_set<Configuration*> seen; | ^ /workspace/Catcrafts/Crafter.Build/implementations/Crafter.Build-Clang.cpp:51:44: error: value of type 'std::unordered_set<Configuration *>' is not contextually convertible to 'bool' 51 | std::unordered_set<Configuration*> seen; | ^~~~ /workspace/Catcrafts/Crafter.Build/implementations/Crafter.Build-Clang.cpp:52:45: error: expected '(' for function-style cast or type construction 52 | std::function<bool(Configuration*)> walk = [&](Configuration* depCfg) -> bool { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ /workspace/Catcrafts/Crafter.Build/implementations/Crafter.Build-Clang.cpp:52:45: error: expected ')' /workspace/Catcrafts/Crafter.Build/implementations/Crafter.Build-Clang.cpp:44:12: note: to match this '(' 44 | for(const std::unique_ptr<Module>& interface : this->interfaces) { | ^ /workspace/Catcrafts/Crafter.Build/implementations/Crafter.Build-Clang.cpp:68:17: error: use of undeclared identifier 'walk' 68 | if (walk(depCfg)) return true; | ^~~~ /workspace/Catcrafts/Crafter.Build/implementations/Crafter.Build-Clang.cpp:165:48: error: expected unqualified-id 165 | for(const std::unique_ptr<Module>& interface : this->interfaces) { | ^ /usr/x86_64-w64-mingw32/include/rpc.h:12:19: note: expanded from macro 'interface' 12 | #define interface struct | ^ /workspace/Catcrafts/Crafter.Build/implementations/Crafter.Build-Clang.cpp:197:13: error: expected ';' in 'for' statement specifier 197 | throw std::runtime_error(std::format("Module {} not found not found, referenced in {}", match[1].str(), file.string())); | ^ /workspace/Catcrafts/Crafter.Build/implementations/Crafter.Build-Clang.cpp:197:13: error: value of type 'void' is not contextually convertible to 'bool' 197 | throw std::runtime_error(std::format("Module {} not found not found, referenced in {}", match[1].str(), file.string())); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /workspace/Catcrafts/Crafter.Build/implementations/Crafter.Build-Clang.cpp:198:13: error: use of undeclared identifier 'next4' 198 | next4:; | ^~~~~ /workspace/Catcrafts/Crafter.Build/implementations/Crafter.Build-Clang.cpp:198:18: error: expected ')' 198 | next4:; | ^ /workspace/Catcrafts/Crafter.Build/implementations/Crafter.Build-Clang.cpp:165:16: note: to match this '(' 165 | for(const std::unique_ptr<Module>& interface : this->interfaces) { | ^ /workspace/Catcrafts/Crafter.Build/implementations/Crafter.Build-Clang.cpp:818:34: error: expected unqualified-id 818 | for(std::unique_ptr<Module>& interface : config.interfaces) { | ^ /usr/x86_64-w64-mingw32/include/rpc.h:12:19: note: expanded from macro 'interface' 12 | #define interface struct | ^ /workspace/Catcrafts/Crafter.Build/implementations/Crafter.Build-Clang.cpp:840:5: error: expected ';' in 'for' statement specifier 840 | for(Implementation& implementation : config.implementations) { | ^ /workspace/Catcrafts/Crafter.Build/implementations/Crafter.Build-Clang.cpp:840:5: error: expected expression /workspace/Catcrafts/Crafter.Build/implementations/Crafter.Build-Clang.cpp:840:5: error: expected ';' in 'for' statement specifier /workspace/Catcrafts/Crafter.Build/implementations/Crafter.Build-Clang.cpp:868:5: error: expected expression 868 | for(const std::string& flag : buildResult.libs) { | ^ /workspace/Catcrafts/Crafter.Build/implementations/Crafter.Build-Clang.cpp:868:5: error: expected ')' /workspace/Catcrafts/Crafter.Build/implementations/Crafter.Build-Clang.cpp:818:8: note: to match this '(' 818 | for(std::unique_ptr<Module>& interface : config.interfaces) { | ^ /workspace/Catcrafts/Crafter.Build/implementations/Crafter.Build-Clang.cpp:1474:63: error: missing '#include <stdint.h>'; 'uint16_t' must be declared before it is used 1474 | addr.sin_port = htons(static_cast<uint16_t>(p)); | ^ /usr/x86_64-w64-mingw32/include/stdint.h:38:25: note: declaration here is not visible 38 | typedef unsigned short uint16_t; | ^ 19 errors generated.
Member

claude:claim:22c42121-166b-4b0a-811a-a1b6d10dcc34

claude:claim:22c42121-166b-4b0a-811a-a1b6d10dcc34
Member

[progress]

Now I see the picture. Two distinct issues — both Windows-specific:

1. `<winsock2.h>` transitively pulls in `rpc.h`, which defines `#define interface struct`. The file uses `interface` as a loop variable name in several places.
2. `uint16_t` (global namespace) isn't visible inside the module purview on mingw. `import std;` provides `std::uint16_t` but the C-namespace alias from `<stdint.h>` evidently isn't anchored through the global module fragment on this toolchain.

Let me fix both at the source — undef the macro in the global module fragment, and qualify the uint16_t use.
**[progress]** ``` Now I see the picture. Two distinct issues — both Windows-specific: 1. `<winsock2.h>` transitively pulls in `rpc.h`, which defines `#define interface struct`. The file uses `interface` as a loop variable name in several places. 2. `uint16_t` (global namespace) isn't visible inside the module purview on mingw. `import std;` provides `std::uint16_t` but the C-namespace alias from `<stdint.h>` evidently isn't anchored through the global module fragment on this toolchain. Let me fix both at the source — undef the macro in the global module fragment, and qualify the uint16_t use. ```
Member

[progress]

Now let me verify there are no other unqualified `uint16_t` (or similar `uintN_t`) uses in the module purview of this file:
All `uint16_t` uses in this file now go through `std::`. Let me also check whether `interface` appears in any other `.cpp`/`.cppm` files that get compiled on the mingw target, since that header chain ships the macro:
All matches in `json.hpp` are inside comments, so they're fine. The fix is contained to the one file.

Now let me try to build it to verify. First, let's see how the project builds:
Good, there's a stage-1 crafter-build available. Let me try the mingw target build to actually reproduce + verify the fix:
**[progress]** ``` Now let me verify there are no other unqualified `uint16_t` (or similar `uintN_t`) uses in the module purview of this file: All `uint16_t` uses in this file now go through `std::`. Let me also check whether `interface` appears in any other `.cpp`/`.cppm` files that get compiled on the mingw target, since that header chain ships the macro: All matches in `json.hpp` are inside comments, so they're fine. The fix is contained to the one file. Now let me try to build it to verify. First, let's see how the project builds: Good, there's a stage-1 crafter-build available. Let me try the mingw target build to actually reproduce + verify the fix: ```
Member

[progress]

Let me verify the fix by directly compiling the file's preprocessing/syntax against the mingw target:
The `interface` identifier survives preprocessing untouched on the mingw target — the `#undef` works. Let me also try a real syntax-only compile to flush out any remaining issues:
The `import std` requires PCMs that the local crafter-build wires up. Let me try the full bootstrap-then-mingw flow, working around the Asset issue if needed:
**[progress]** ``` Let me verify the fix by directly compiling the file's preprocessing/syntax against the mingw target: The `interface` identifier survives preprocessing untouched on the mingw target — the `#undef` works. Let me also try a real syntax-only compile to flush out any remaining issues: The `import std` requires PCMs that the local crafter-build wires up. Let me try the full bootstrap-then-mingw flow, working around the Asset issue if needed: ```
Member

[progress]

Bootstrap finished. Now run the mingw cross-compile to actually test the fix:
**[progress]** ``` Bootstrap finished. Now run the mingw cross-compile to actually test the fix: ```
Member

[progress]

The mingw target builds cleanly — both fixes are working. Now per the exit contract, let me run the tests:
**[progress]** ``` The mingw target builds cleanly — both fixes are working. Now per the exit contract, let me run the tests: ```
Member

[progress]

All 13 tests pass (5 skipped due to missing external tooling — qemu, ssh hosts, CUDA, aarch64 sysroot — which is environment, not a regression).

Let me commit the fix:
**[progress]** ``` All 13 tests pass (5 skipped due to missing external tooling — qemu, ssh hosts, CUDA, aarch64 sysroot — which is environment, not a regression). Let me commit the fix: ```
Member

PR opened: #10

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