daspkg: ship native shared deps via release_include_dll#2590
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends daspkg release bundling to ship a package’s declared native shared-library dependencies alongside its .shared_module, and adjusts runtime loader behavior (Windows + POSIX) so those colocated dependencies resolve correctly when launching from a bundle.
Changes:
- Add manifest API
release_include_dll(name)(stored asnative_dlls) and propagate it through release metadata collection and bundle shipping. - Update loader resolution: Windows uses
LoadLibraryExsearch flags; Linux/macOS rely on$ORIGIN/@loader_pathrpath appended byADD_DAS_SHARED_MODULE_LIB. - Add CI end-to-end “sequence” smoke test scripts (PS1 + SH) and wire them into the Release workflow matrix.
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| utils/daspkg/utils.das | Improves run_cmd diagnostics/output capture (notably Windows quoting + fallback pipe capture). |
| utils/daspkg/package_runner.das | Plumbs native_dlls from ReleaseSpec into PackageReleaseInfo. |
| utils/daspkg/commands.das | Ships declared native deps into bundles (ship_native_dlls) and includes them for deps + project releases. |
| daslib/daspkg.das | Introduces ReleaseSpec.native_dlls and release_include_dll(...) manifest API. |
| src/misc/sysos.cpp | Windows loader updated to LoadLibraryExA with search flags and absolute-path resolution. |
| CMakeLists.txt | Appends $ORIGIN / @loader_path rpaths to shared modules for colocated dep resolution. |
| modules/dasGlfw/CMakeLists.txt | Switches to APPEND rpath properties to avoid clobbering macro-added origin/loader_path. |
| modules/dasGlfw/.das_package | Declares GLFW native dep filename per-platform via release_include_dll. |
| examples/games/sequence/ci_smoke_test.sh | POSIX smoke test for install → release → run (validates bundled native deps). |
| examples/games/sequence/ci_smoke_test.ps1 | Windows smoke test for install → release → run. |
| .github/workflows/build.yml | Adds Release-matrix smoke test execution (with skips for unsupported runners). |
| .gitattributes | Forces LF for *.sh to avoid CRLF issues on POSIX. |
| CLAUDE.md | Documents the new skills/sql.md skill entry. |
| skills/sql.md | Adds a comprehensive dasSQLITE skill guide (docs-only). |
| .gitignore | Adds ignores for opencode-related config files. |
Comments suppressed due to low confidence (1)
utils/daspkg/commands.das:1446
- When
include_globsis empty (butnative_dllsis not),glob_filteredstill performs a fulldir_recwalk of the dependency directory even though it can never include anything. Consider guarding this call withif (!empty(dep_spec.include_globs))to avoid unnecessary filesystem traversal during release bundling.
var dep_files : array<string>
glob_filtered(pkg_dir, dep_spec.include_globs, dep_spec.exclude_globs) $(rel_path, is_dir) {
if (!is_dir) {
dep_files |> push_clone(rel_path)
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
cd1ce4e to
462c318
Compare
462c318 to
9b1c612
Compare
9b1c612 to
0b4c013
Compare
0b4c013 to
1b83755
Compare
New manifest API: a module's .das_package can declare its native shared
library deps (e.g. dasGlfw -> glfw3.dll / libglfw.so.3.4 /
libglfw.3.4.dylib). Daspkg searches <das_root>/{bin,lib}/ and ships them
colocated with their owning .shared_module under <bundle>/modules/<X>/.
Loader fixes so colocated deps are actually found at runtime:
- Windows: LoadLibraryEx(LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR |
LOAD_LIBRARY_SEARCH_APPLICATION_DIR | LOAD_LIBRARY_SEARCH_DEFAULT_DIRS)
in src/misc/sysos.cpp. Backwards compatible (deps next to .exe still
resolve), adds the loaded DLL's own dir to the search.
- Linux/macOS: ADD_DAS_SHARED_MODULE_LIB appends \$ORIGIN /
@loader_path to BUILD_RPATH + INSTALL_RPATH for every dynamic module.
- dasGlfw CMakeLists.txt: switched its existing rpath setters to
set_property APPEND so the macro's default isn't clobbered.
dasGlfw declares glfw3.dll / libglfw.* via the new .das_package.
CI smoke test: examples/games/sequence/ci_smoke_test.{ps1,sh} runs the
full daspkg install -> release -> launch cycle on the in-tree sequence
game (uses GLFW + has a daspkg dep on das-cards). Wired into build.yml
as a new step on every Release matrix entry (skips 32-bit Windows + ARM
Linux + sanitizer matrix). The bundled exe is launched with
--max-frames 60 under a 60s outer timeout.
Diagnostics fix in daspkg's run_cmd (utils/daspkg/utils.das): on
Windows, popen invokes cmd.exe /c <cmd> without outer quoting, and
cmd's quote-stripping rule (cmd /?, "old behavior") strips the first
AND last quote when the line has 2+ quotes plus a special char like
'>'. That destroyed the redirect target. Wrap in outer quotes on
Windows. Also capture popen pipe output as fallback and synthesize
"<no output captured>" diagnostic block when both channels are empty
- previous failure mode was "(rc=1):" with a blank line.
Other:
- .gitattributes: *.sh text eol=lf so shell scripts keep LF on
POSIX checkouts under autocrlf=true.
- skills/sql.md: new SQL skill doc (Boris's local addition).
- CLAUDE.md / .gitignore: small unrelated tweaks (Boris's local).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1b83755 to
684031b
Compare
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.
Summary
release_include_dll(name)indaslib/daspkg.das— a module's.das_packagedeclares its native shared library deps. daspkg searches<das_root>/{bin,lib}/and ships them colocated with their owning.shared_moduleunder<bundle>/modules/<X>/.LoadLibraryExflags + Linux/macOS$ORIGIN/@loader_pathrpath append inADD_DAS_SHARED_MODULE_LIB.dasGlfw/.das_packagedeclaresglfw3.dll/libglfw.so.3.4/libglfw.3.4.dylibper platform.run_cmd: Windows_popenquote-stripping was destroying redirect targets, leaving silent(rc=1):errors with no output. Wrap in outer quotes on Windows + capture popen pipe as fallback + synthesize<no output captured>block when both channels are empty.examples/games/sequence/ci_smoke_test.{ps1,sh}runs the fulldaspkg install→release→ launch cycle on the in-tree sequence game (uses GLFW + has a daspkg dep on das-cards). Wired intobuild.ymlon every Release matrix entry except 32-bit Windows / ARM Linux / sanitizer entries. Bundled exe launches with--max-frames 60under a 60s outer timeout.What's bundled along
.gitattributes:*.sh text eol=lfso the shell script keeps LF on POSIX checkouts undercore.autocrlf=true.skills/sql.md,CLAUDE.md,.gitignore: small unrelated additions.Test plan
libDaScriptDyn_runtime.dllwith the LoadLibraryEx fix, dropped into bundle,sequence.exe --max-frames 60runsinit+shutdown, exits 0.pwsh ci_smoke_test.ps1 D:\daslang) reportssmoke: PASS (rc=0).🤖 Generated with Claude Code