Skip to content

fix(compat.glfw, compat.mimalloc, compat.vulkan): Windows links as runtime.libraries, not GNU ldflags - #402

Merged
Sunrisepeak merged 1 commit into
mainfrom
fix/windows-link-libraries
Sep 12, 2026
Merged

fix(compat.glfw, compat.mimalloc, compat.vulkan): Windows links as runtime.libraries, not GNU ldflags#402
Sunrisepeak merged 1 commit into
mainfrom
fix/windows-link-libraries

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

All three declared their Windows system libraries as ldflags in the GNU spelling. ldflags reach the linker verbatim, and link.exe does not reject -lgdi32, it drops it with LNK4044: unrecognized option '/lgdi32'; ignored and carries on, so the first sign is a consumer's link ending in unresolved externals. Every MSVC consumer has been re-declaring these packages' libraries to compensate.

runtime.libraries / runtime.link_library_dirs are the dialect-neutral spelling (gdi32.lib + /LIBPATH: for MSVC, -lgdi32 + -L for GNU); compat.libgbm already uses link_library_dirs in this form.

package libraries
compat.glfw gdi32
compat.mimalloc psapi shell32 user32 advapi32 bcrypt
compat.vulkan vulkan-1, link_library_dirs = ["lib"]

Linux and macOS sections unchanged; payloads unchanged, no version moves. Local: syntax, mirror, package-name and parity lints and mcpp xpkg parse pass on all three.

Consumer: Sunrisepeak/xrgui#8, which deletes its copies and the vulkan-1 search code in its build.mcpp.

…untime.libraries`, not GNU ldflags

All three declared their Windows system libraries as `ldflags` in the GNU
spelling. `ldflags` reach the linker verbatim, and link.exe does not reject
`-lgdi32` -- it drops it:

    LNK4044: unrecognized option '/lgdi32'; ignored

and carries on, so the first sign is a consumer's link ending in unresolved
externals (235 of them on xrgui). Every MSVC consumer has been re-declaring
these three packages' libraries in its own manifest to compensate.

`runtime.libraries` and `runtime.link_library_dirs` are the dialect-neutral
half of a link line: rendered as gdi32.lib / /LIBPATH: for MSVC and -lgdi32 /
-L for GNU. compat.libgbm already uses `link_library_dirs` in this form.

  compat.glfw      gdi32
  compat.mimalloc  psapi shell32 user32 advapi32 bcrypt
  compat.vulkan    vulkan-1, search dir lib/

Linux and macOS sections are unchanged. Payloads are unchanged, so no version
moves. Consumer: Sunrisepeak/xrgui#8, which deletes its copies.
@Sunrisepeak
Sunrisepeak merged commit f07e689 into main Sep 12, 2026
14 checks passed
@Sunrisepeak
Sunrisepeak deleted the fix/windows-link-libraries branch September 12, 2026 10:16
Sunrisepeak added a commit to Sunrisepeak/xrgui that referenced this pull request Sep 12, 2026
…do by hand

Five blocks leave build.mcpp and three copies leave mcpp.toml; what stays is
what mcpp has no mechanism for.

  runtime data     the 71-line copy action (one command per OS, every output
                   named) is `[runtime] deploy` -- four files and
                   vk_layer_settings.txt -- and `mcpp pack` stages them too
  shaders          slang_builder.py, -j 30, --oneshot (every build recompiled
                   all 17) and a warning on failure become one call into
                   mcpp.rules.slang: one ninja edge per shader, -depfile for
                   what a shader imports, a failure that fails the build. The
                   flags are config.toml's, through extra_args. bloom.merge.slang
                   is excluded by name: slang 2026.14.1 refuses it, nothing
                   loads it, and the old flow only ever warned
  Windows links    gdi32 / psapi / bcrypt were copies of three index packages'
                   metadata, and vulkan-1's search directory was computed from
                   whatever the machine had. The packages spell them as
                   `runtime.libraries` now (mcpplibs/mcpp-index#402); the copies
                   and the 36-line search go
  fontconfig       the `linux-desktop` feature the Linux command line had to
                   name is `[target.linux.dependencies]`, evaluated against the
                   resolved target
  tools            node is declared beside python; `xim:slang` is declared by
                   the rule. No PATH probing is left, and a generator that is
                   skipped says so through mcpp::warning, the one channel a
                   green build prints

The manifest also gains what packaging needs: `[package]` metadata (the
dist members read it for the MSI version and the desktop entry), a Windows
icon cut from logo.png, `windows_subsystem = "windows"` on the two GUI
programs, the `llvm@22.1.8` the Linux port was done with, and the appimage /
wix members so `mcpp pack --format` has something to dispatch to.

CI: Windows installs mcpp and nothing else (the manifest provisions the
rest), asserts icons only (shaders are edges now), and packs a zip and an
MSI. A Linux leg builds with the pinned clang, runs the tests, and packs a
tarball and an AppImage. Both name the pack target, because two bin targets
are declared and only one is in the default feature set.

build.mcpp: 480 -> 379 lines, and the three mechanisms that go are the ones
that varied by machine: a shell copy per OS, PATH probing, a link search path
that depended on what was installed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant