allyourcodebase / allyourcodebase/SDL

Windows build fails on Zig 0.17.0-dev.667+0569f1f6a due to unused config header values

Aperta
#22 5 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Zig
Stelle
56
Fork
19
Merge medio
17h
PR unite (30g)
2

Descrizione

### Summary

On Windows, building this package with newer Zig master fails during `SDL_build_config.h` generation because the Windows config helper provides several values that are not present in upstream SDL 3.4.4's `SDL_build_config.h.cmake`.

This appears to be exposed by newer Zig versions being stricter about unused `addConfigHeader` values.

### Platform

Windows x86_64

### Zig versions tested

Works:

```text
0.16.0
0.17.0-dev.101+4e2147d14
```

Fails:

```text
0.17.0-dev.667+0569f1f6a
0.17.0-dev.263+0add2dfc4
```

### Error

```text
└─ compile lib SDL3 Debug native
└─ configure cmake header dependency to SDL_build_config.h failure
error: C:\Repositories\sdl-build-failure-test\zig-pkg\N-V-__8AAL9L9AJxY67Fhxp52_VHlLps195MF3irmi4z8Qge\include/build_config/SDL_build_config.h.cmake: config header value unused: HAVE_D3D11_H
error: C:\Repositories\sdl-build-failure-test\zig-pkg\N-V-__8AAL9L9AJxY67Fhxp52_VHlLps195MF3irmi4z8Qge\include/build_config/SDL_build_config.h.cmake: config header value unused: HAVE_AUDIOCLIENT_H
error: C:\Repositories\sdl-build-failure-test\zig-pkg\N-V-__8AAL9L9AJxY67Fhxp52_VHlLps195MF3irmi4z8Qge\include/build_config/SDL_build_config.h.cmake: config header value unused: HAVE_SENSORSAPI_H
```

The Windows config code in this package appears to provide them to `b.addConfigHeader`, and removing the three entries locally allows the build to get past config-header generation:

```zig
.HAVE_D3D11_H = true,
.HAVE_AUDIOCLIENT_H = true,
.HAVE_SENSORSAPI_H = true,
```

### Expected behaviour

The package should build without unused config-header values when used with newer Zig versions.

### Question

Are these three `HAVE_*` values stale for SDL 3.4.4 and safe to remove, or should they be replaced with newer SDL config names?

### Additional context

After removing those entries, build still fails later in `translate-c`, involving missing builtins (44 missing in total) such as:

```text
__builtin_elementwise_fshr
__builtin_elementwise_fshl
```

I'm almost certain these are due to the upgrade to LLVM 22 or translate-c/arocc related (a couple of issues regarding missing builtins exist and/or have been fixed in translate-c)

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.