Skip to content

ship .idl files rather than .h files for windows SDK #18477

@andrewrk

Description

@andrewrk

This is a toolchain installation size optimization.

Many of the C header files Zig ships that come from mingw-w64 have this header:

/*** Autogenerated by WIDL 8.5 from include/xpsrassvc.idl - Do not edit ***/

If we compare total file sizes, it comes out to roughly 40 MiB reduced to 10 MiB:

[nix-shell:~/Downloads/mingw-w64/mingw-w64-headers]$ cat $(find -name "*.idl") | wc -c
10436832

[nix-shell:~/Downloads/mingw-w64/mingw-w64-headers]$ cat $(grep -RIl "Autogenerated by WIDL") | wc -c
41764448

In terms of tarball size it's roughly 2.4 MiB to 724 KB:

[nix-shell:~/Downloads/mingw-w64/mingw-w64-headers]$ cat $(find -name "*.idl") | xz | wc -c
740960

[nix-shell:~/Downloads/mingw-w64/mingw-w64-headers]$ cat $(grep -RIl "Autogenerated by WIDL") | xz | wc -c
2490188

A prerequisite for this issue would be a WIDL implementation in Zig. That could be a fun project for a contributor.

Metadata

Metadata

Assignees

No one assigned

    Labels

    contributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.enhancementSolving this issue will likely involve adding new logic or components to the codebase.libcIssues related to libzigc and Zig's vendored libc code.optimizationos-windowsMicrosoft Windows

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions