Repository navigation
with get writes the import libraries a Windows package needs (ruling A); the raylib spiral links on Windows with no Visual Studio (#1915) - #1932
Merged
Conversation
added 3 commits
September 30, 2026 04:57
`with build` of the raylib spiral on win10, in a shell whose PATH holds only the Windows directories, warned "could not probe .../spiral-pre.exe.o for undefined symbols with 'llvm-nm.exe' (exit -2); linking every embedded bundle": with no linker record beside the compiler, the probe looked for llvm-nm.exe on PATH, a host tool. It now takes llvm-nm from beside the lld the link runs, as link_stage_llvm_ld_path resolves it (the record, or the SDK WITH_LLVM_LD / LLVM_LD / LLVM_PREFIX names). The same build no longer warns.
…1915) The record half of :no-host-toolchain (build/host_toolchain.w ht_record_problems) found a path by its first '/': on Windows every drive-lettered path ("C:/src/...", "/libpath:C:/...") had a prefix it did not call path-like and was never checked, while every lld-link option ("/alternatename:with_llvm_outs=with_alloc", "/include:_Z10clang_main...") was reported as a path outside the repository. On win10 the check reported 60 such options across the six records and would have passed a record naming D:/elsewhere or E:\vs\kernel32.lib. On Windows a path is now the drive-lettered one a token names, alone or after an option (/libpath:, -L, -Wl,), compared with '\' as '/' and case folded; a token that is only an option names no path. Checked on the cases above: the two foreign paths are found, the options are not, and the win10 records pass.
…kage links (#1915) Eric, 2026-09-30 (ruling A): `with get` generates the import libraries a package needs for in-box DLLs (gdi32, opengl32, winmm, ...) from mingw-w64's .def files, as it writes Apple framework stubs on macOS; the SDK carries only what With itself links. compiler.WindowsImportLibs: for each library a package names that neither its own lib directories nor the SDK's C runtime provide, the .def is found as mingw-w64-crt's Makefile.am finds it (the architecture's directory, then lib-common; a .def.in through the SDK's clang preprocessor, a lib-common one losing its i386 @n decorations, as build/sdk.w sdk_mingw_def does), and the SDK's llvm-dlltool writes <package>/windows-libs/lib<name>.a, which metadata.json adds to the package's lib_paths. The definitions come from the mingw-w64 release the SDK's C runtime was built from: its libc/windows/PROVENANCE names the archive and its sha256, and only mingw-w64-crt's definition directories are unpacked (TarExtract gains a keep-list), once, into the user's cache (LOCALAPPDATA when a Windows shell sets no HOME). A name with no definition is left to the link, which names it. `with __windows-import-libs <dir> <dll>...` runs the step alone. Evidence on win10, with no Visual Studio or Windows Kits and PATH holding only C:\Windows\System32 and C:\Windows: - before: `with get c.raylib` then `with build` of the raylib spiral UAT fixture (uat/fixtures/raylib_spiral_main.w) failed with lld-link: "could not open 'winmm.lib'", "'gdi32.lib'", "'opengl32.lib'". - after: the same steps build out/bin/spiral-post.exe (not run); raylib, glfw and opengl/system each carry windows-libs/, and the binary imports only in-box DLLs (GDI32, USER32, WINMM, KERNEL32, SHELL32, ADVAPI32, WS2_32, dbghelp and the api-ms-win-crt sets). - `with __windows-import-libs C:/src/il gdi32 opengl32 winmm user32` writes the four libraries (user32 from a .def.in); an unknown name fails with "mingw-w64 has no import definitions for no_such_dll_1915.dll". The test does not depend on raylib: :no-host-toolchain gains its Windows half. hi.w, cimport_stdio.w and a new test/host_toolchain/ windows_dll_project (a dependency whose metadata links gdi32, opengl32 and winmm from import libraries `with __windows-import-libs` writes; the program calls GetStockObject, timeGetTime and wglGetCurrentContext) are built and run with PATH holding only the Windows directories and every Visual Studio / Windows SDK variable emptied. On win10 all three build and run.
Contributor
Author
|
Battery GREEN on bdf58fe (#1931 + #1932 on main 55d094b).
Wall 20.5 min: the gate ran alongside two agents' builds on the same Mac (the previous battery's gate took 548 s). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Eric's ruling (2026-09-30, "A"):
with getgenerates the import libraries of the in-box DLLs a package links (gdi32, winmm, opengl32, …) from mingw-w64's .def files with the SDK's llvm-dlltool; the SDK carries only what With itself links. Also: the Windows link probes symbols with the SDK's llvm-nm; :no-host-toolchain reads Windows link records and gains a Windows half (hi.w, a stdio c_import, a gdi32/winmm/opengl32 program build and run with PATH holding only the Windows directories).Verified on win10 with no VS/Kits:
with get c.raylib+ the spiral fixture builds (not run), importing only in-box DLLs. Draft until the stack battery is green.