Skip to content

fatman: static-link every external module in one host + CI gate - #3351

Merged
borisbat merged 1 commit into
masterfrom
bbatkin/fatman
Jul 2, 2026
Merged

fatman: static-link every external module in one host + CI gate#3351
borisbat merged 1 commit into
masterfrom
bbatkin/fatman

Conversation

@borisbat

@borisbat borisbat commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

The test half of the both-worlds sweep (borisbat/dasVulkan#64, borisbat/dasImgui#218, borisbat/dasImguiNodeEditor#35, borisbat/dasImguiImplot#25): the externals' superbuild (static-embed) branches had no CI coverage anywhere — each module's own CI only builds the standalone .shared_module flavor.

  • examples/fatman/main.das — requires every external C++ module (imgui, imgui_app, imgui_app_headless, implot, imgui_node_editor, vulkan) plus one boost path per module: registration + boost-path resolution + the static link, no window, no GPU. The daslang host absorbs externals cloned into modules/ automatically (the modules glob includes any CMakeLists without a .daspkg_standalone marker), so the fat man needs no C++ of its own.
  • .github/workflows/fatman.yml — clones the four externals at master into modules/, configures with the glob absorbing their both-worlds branches, builds the daslang target, runs the smoke. Doubles as the compile-time ABI canary for daslang-vs-externals drift (the abi_break_sweep discipline gets a gate).
  • web/CMakeLists.txt + CMakeLists.txt — the dasImgui imgui_boost_v2 embed mount and NATIVE_MODULE registration now tolerate both dasImgui layouts (pre- and post-cmake: msvc: add flag DAS_USE_STATIC_STD_LIBS #218 rename), unblocking that PR. (Follow-up queued: once cmake: msvc: add flag DAS_USE_STATIC_STD_LIBS #218 lands, the whole DAS_WEB_IMGUI_DIR hand-wiring can collapse onto dasImgui's superbuild-emscripten branch — WSL-verified, separate PR.)

Validated locally on Windows (VS gen): all four externals junctioned into modules/, configure absorbs them, the fat daslang host builds, the smoke passes — and its first run caught a real defect (dasImguiImplot registered imgui_-prefixed module names over unprefixed file stems; fixed by rename, landed in #25). Full preflight green (13 passed / 0 failed) on the rebased branch.

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings July 2, 2026 09:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a “fatman” smoke test that builds a single daslang host with multiple external modules statically linked, and introduces a dedicated CI workflow to gate the externals’ “superbuild/static-embed” CMake path that their own standalone .shared_module CI doesn’t cover.

Changes:

  • Add examples/fatman/main.das which requires all targeted external modules/boost paths to validate registration + boost-path resolution + static linkage.
  • Add .github/workflows/fatman.yml to clone externals into modules/, build daslang, and run the fatman smoke script.
  • Update CMakeLists.txt and web/CMakeLists.txt to tolerate both pre- and post-rename dasImgui layouts for imgui_boost_v2 embedding/registration.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
web/CMakeLists.txt Conditional embed of imgui_boost fallback to support both dasImgui layouts.
examples/fatman/main.das New smoke script that requires all external modules and one boost path per module.
CMakeLists.txt Conditional ADD_MODULE_DAS registration to avoid double-registering imgui_boost_v2 post-rename.
.github/workflows/fatman.yml New CI workflow that clones externals, builds a “fat” daslang host, and runs the smoke.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/fatman.yml Outdated
- name: "Run the fat man"
run: |
set -eux
./build/daslang examples/fatman/main.das
The test half of the both-worlds sweep (dasVulkan #64, dasImgui #218,
dasImguiNodeEditor #35, dasImguiImplot #25): the externals' superbuild
(static-embed) branches had no CI coverage anywhere — each module's own CI
only builds the standalone .shared_module flavor.

- examples/fatman/main.das — requires every external C++ module and one
  boost path per module: registration + boost-path resolution + the static
  link, no window, no GPU. The daslang_static host absorbs externals cloned
  into modules/ automatically (the modules glob includes any CMakeLists
  without a .daspkg_standalone marker), so the fat man needs no C++ of its
  own. daslang_static is the flavor that links the static module halves —
  the DLL-flavor daslang resolves externals via .shared_module at runtime,
  which cannot exercise the static-embed path at all.
- .github/workflows/fatman.yml — clones the four externals at master into
  modules/, configures with the modules glob absorbing their both-worlds
  branches, builds daslang_static, runs the smoke. Doubles as the
  compile-time ABI canary for daslang-vs-externals drift.
- include/daScript/simulate/aot.h — das_vector push/erase compared
  uint32_t(index) > vec.size(): fine for std::vector (size_t) but
  -Werror=sign-compare on gcc for ImVector (int size()), which nothing had
  ever instantiated these templates over in a gcc build. Cast both sides
  (the range-erase overload at :3171 already did).
- web/CMakeLists.txt + CMakeLists.txt — the dasImgui imgui_boost_v2 embed
  mount and NATIVE_MODULE registration now tolerate both dasImgui layouts
  (pre- and post-#218 rename), unblocking that PR.

Validated locally on Windows (VS gen): all four externals junctioned into
modules/, configure absorbs them, the fat daslang_static host links all
five modules statically and the smoke passes. The gate caught three real
defects before ever reaching CI green: dasImguiImplot's registered-name /
file-stem mismatch (fixed in #25), the imgui-family ADD_MODULE_LIB shared
twins failing to link (static-only sweep: dasImgui#219, implot#26,
node-editor#37, vulkan#65), and the duplicate typeFactory<GLFWwindow>
strong symbol (guarded in dasImgui#219 — the same collision web/CMakeLists
papers over with --allow-multiple-definition).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 2, 2026 12:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Comments suppressed due to low confidence (1)

include/daScript/simulate/aot.h:3166

  • das_vector_erase currently allows index == vec.size() (it checks > instead of >=), which makes vec.erase(vec.begin() + index) invoke undefined behavior (erasing end() is invalid). The bounds check should reject index >= size (and keep the negative-index guard).
        if ( uint32_t(index)>uint32_t(vec.size()) ) {   // both sides cast: ImVector::size() is int, std::vector's is size_t
            context->throw_error_ex("erasing vector index out of range %i of %i", index, int32_t(vec.size()));
        }
        if constexpr (das::is_stub_type<QQ>::value) { DAS_ASSERTF(false, "STUB!"); }
        else vec.erase(vec.begin() + index);

Comment on lines +3082 to 3084
if ( uint32_t(at)>uint32_t(vec.size()) ) { // both sides cast: ImVector::size() is int, std::vector's is size_t
context->throw_error_ex("insert index out of range, %i of %u", at, uint32_t(vec.size()));
}
Comment on lines +3092 to 3094
if ( uint32_t(at)>uint32_t(vec.size()) ) { // both sides cast: ImVector::size() is int, std::vector's is size_t
context->throw_error_ex("insert index out of range, %i of %u", at, uint32_t(vec.size()));
}
Comment on lines +3102 to 3104
if ( uint32_t(at)>uint32_t(vec.size()) ) { // both sides cast: ImVector::size() is int, std::vector's is size_t
context->throw_error_ex("insert index out of range, %i of %u", at, uint32_t(vec.size()));
}
Comment on lines +40 to +48
sudo apt-get install --no-install-recommends -y \
libatomic-ops-dev \
libglu1-mesa-dev \
mesa-common-dev \
libx11-dev \
libxrandr-dev \
libxcursor-dev \
libxinerama-dev \
libxi-dev
@borisbat
borisbat merged commit 53d2593 into master Jul 2, 2026
36 checks passed
borisbat added a commit that referenced this pull request Jul 2, 2026
…yground + CI lane

The wasm counterpart of the fat man (#3351). The playground interpreter
(daslang_static) now gets the imgui family (dasImgui + dasImguiImplot +
dasImguiNodeEditor) by cloning them into modules/ — the modules glob absorbs
their both-worlds CMakeLists (the superbuild-emscripten arm), which registers
the C++ modules + imgui/<name> boost paths and compiles + statically links the
archives from source. This deletes the entire DAS_WEB_IMGUI_DIR hand-wiring:

- root CMakeLists: the EMSCRIPTEN+DAS_WEB_IMGUI_DIR NATIVE_MODULE/ADD_MODULE_CPP
  block (incl. the imgui_boost_v2 tolerance shim, dead since dasImgui #218)
- web/CMakeLists: the prebuilt liblib*.a link block and its
  -Wl,--allow-multiple-definition (the DAS_IMGUI_APP_EXTERN_GLFW_TYPE_FACTORY
  guard from dasImgui #219 kills the GLFWwindow typeFactory dupe at source);
  embeds now EXISTS-gated on the cloned modules, mounted at the paths the
  superbuild registrations resolve (modules/dasImgui/widgets, implot +
  node-editor daslib), marker-check mirroring the root glob
- pages.yml: step 0 (daspkg install + standalone _wasm_build32mt archive build)
  becomes clone -> threaded playground build -> rm clones before the wasm64
  daspkg release steps (those keep using the externals' STANDALONE emscripten
  branches, untouched); non-fatal fallback rebuilds plain if an external's
  master regressed

New CI lane .github/workflows/wasmboy.yml (fatman.yml's web sibling): clone the
imgui family, emcmake-build the threaded daslang_static, run the require-smoke
examples/fatman/wasmboy.das under node via web/test/wasmboy_node.js —
registration + boost-path resolution (--embed-file mounts) + the static wasm
link, no browser, no GPU. Needs dasImgui's superbuild-emscripten fix (gl3w
excluded from the wasm superbuild) merged first.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
borisbat added a commit that referenced this pull request Jul 2, 2026
…yground + CI lane (#3358)

The wasm counterpart of the fat man (#3351). The playground interpreter
(daslang_static) now gets the imgui family (dasImgui + dasImguiImplot +
dasImguiNodeEditor) by cloning them into modules/ — the modules glob absorbs
their both-worlds CMakeLists (the superbuild-emscripten arm), which registers
the C++ modules + imgui/<name> boost paths and compiles + statically links the
archives from source. This deletes the entire DAS_WEB_IMGUI_DIR hand-wiring:

- root CMakeLists: the EMSCRIPTEN+DAS_WEB_IMGUI_DIR NATIVE_MODULE/ADD_MODULE_CPP
  block (incl. the imgui_boost_v2 tolerance shim, dead since dasImgui #218)
- web/CMakeLists: the prebuilt liblib*.a link block and its
  -Wl,--allow-multiple-definition (the DAS_IMGUI_APP_EXTERN_GLFW_TYPE_FACTORY
  guard from dasImgui #219 kills the GLFWwindow typeFactory dupe at source);
  embeds now EXISTS-gated on the cloned modules, mounted at the paths the
  superbuild registrations resolve (modules/dasImgui/widgets, implot +
  node-editor daslib), marker-check mirroring the root glob
- pages.yml: step 0 (daspkg install + standalone _wasm_build32mt archive build)
  becomes clone -> threaded playground build -> rm clones before the wasm64
  daspkg release steps (those keep using the externals' STANDALONE emscripten
  branches, untouched); non-fatal fallback rebuilds plain if an external's
  master regressed

New CI lane .github/workflows/wasmboy.yml (fatman.yml's web sibling): clone the
imgui family, emcmake-build the threaded daslang_static, run the require-smoke
examples/fatman/wasmboy.das under node via web/test/wasmboy_node.js —
registration + boost-path resolution (--embed-file mounts) + the static wasm
link, no browser, no GPU. Needs dasImgui's superbuild-emscripten fix (gl3w
excluded from the wasm superbuild) merged first.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
@borisbat
borisbat deleted the bbatkin/fatman branch July 4, 2026 11:41
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.

2 participants