Skip to content

Stage Windows runtime DLLs flat next to bugscope.exe (fixes #5) - #8

Merged
adsharma merged 1 commit into
mainfrom
fix/windows-dll-search-path-5
Oct 3, 2026
Merged

adsharma merged 1 commit into
mainfrom
fix/windows-dll-search-path-5

Conversation

@adsharma

@adsharma adsharma commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Fixes #5.

Problem: bugscope.exe refused to start — first arrow.dll / lbug_shared.dll / networkit_state.dll not found, then (after hand-copying those) bz2.dll / brotlidec.dll / brotlienc.dll / lz4.dll not found.

Root cause: the Windows zip staged DLLs only in icebug/lib + liblbug subdirs, but the Windows loader resolves load-time DLLs before main runs and searches only the exe dir, System32, and PATH (no RPATH/@rpath equivalent). Round two was Arrow's transitive compression deps, which packaging never shipped because it globbed only arrow*.dll.

Changes:

  • scripts/stage_windows_bundle.sh (new): copies every runtime DLL flat next to the exe (icebug recursive incl. networkit/, liblbug, all vcpkg bin DLLs, OpenSSL bin), keeps the subdir layout, and fails the build if lbug_shared / networkit_state / arrow is missing flat.
  • CI Windows Package step calls the script instead of the subdir-only copies, and logs the staged DLLs.
  • src/windows_dll (new, called first in main on Windows): prepends the exe dir + bundled subdirs to PATH for runtime LOAD EXTENSION loads. Defense-in-depth only — documented as unable to help load-time DLLs.
  • README troubleshooting entry for the Windows DLL failure.

Verification: cargo fmt --check clean, cargo clippy --all-targets clean, full cargo test green (incl. 6 new windows_dll unit tests); staging script dry-run against a fake tree stages 11 DLLs flat and exits 1 on missing-dep cases.

The Windows loader resolves load-time DLLs before main runs and
searches only the exe dir, System32, and PATH — never our
icebug/lib + liblbug subdirs — so the exe refused to start with
arrow/lbug_shared/networkit_state not found. Hand-copying those
surfaced round two (bz2/brotli/lz4): Arrow's transitive deps, which
packaging never shipped because it globbed only arrow*.dll.

- scripts/stage_windows_bundle.sh: copy every runtime DLL flat next
  to the exe (icebug recursive, liblbug, all vcpkg bin DLLs, OpenSSL),
  keep the subdir layout, fail fast when a known dep is missing flat.
- CI Windows Package step calls it instead of the subdir-only copies.
- src/windows_dll: prepend bundled subdirs to PATH at startup for
  runtime LOAD EXTENSION loads (defense-in-depth; cannot help
  load-time DLLs) + unit tests.
- README troubleshooting entry for the Windows DLL failure.
@adsharma
adsharma merged commit 2eed80b into main Oct 3, 2026
5 checks passed
@adsharma
adsharma deleted the fix/windows-dll-search-path-5 branch October 3, 2026 18:33
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.

bug: The Windows version of the app can't find the required DLLs

1 participant