Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions .github/workflows/fatman.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# The fat man: clones every external module into modules/ and builds ONE daslang host
# with all of them statically linked (the superbuild half of the externals' both-worlds
# CMakeLists — the half no other CI exercises; each module's own CI covers the
# standalone .shared_module half). Runs examples/fatman/main.das, which requires every
# external module: registration + boost-path resolution + the static link, no window,
# no GPU. Also the compile-time ABI canary for daslang-vs-externals drift.
name: fatman

on:
pull_request:
paths:
- 'CMakeLists.txt'
- 'web/CMakeLists.txt'
- 'examples/fatman/**'
- '.github/workflows/fatman.yml'
- 'include/**'
- 'src/**'
workflow_dispatch:

concurrency:
group: fatman-${{ github.ref }}
cancel-in-progress: true

jobs:
fatman:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: "Install CMake and Ninja"
uses: lukka/get-cmake@latest

- name: "Install: Required Dev Packages"
run: |
set -eux
sudo apt-get update -y
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
Comment on lines +40 to +48

- name: "Clone external modules into modules/ (master; no .daspkg_standalone marker => the modules glob includes their both-worlds CMakeLists)"
run: |
set -eux
git clone --depth 1 --recurse-submodules https://github.com/borisbat/dasImgui.git modules/dasImgui
git clone --depth 1 --recurse-submodules https://github.com/borisbat/dasImguiImplot.git modules/dasImguiImplot
git clone --depth 1 --recurse-submodules https://github.com/borisbat/dasImguiNodeEditor.git modules/dasImguiNodeEditor
git clone --depth 1 --recurse-submodules https://github.com/borisbat/dasVulkan.git modules/dasVulkan

- name: "Configure (externals absorbed by the modules glob)"
run: |
set -eux
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release \
-DDAS_GLFW_DISABLED=OFF

- name: "Build the fat host (daslang_static — the flavor that links the static module halves; the DLL-flavor daslang gets externals via .shared_module at runtime instead)"
run: |
set -eux
cmake --build build --target daslang_static -j $(nproc)

- name: "Run the fat man"
run: |
set -eux
./bin/daslang_static examples/fatman/main.das
9 changes: 6 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -612,9 +612,12 @@ IF(EMSCRIPTEN AND DAS_WEB_IMGUI_DIR)
ADD_MODULE_DAS(imgui imgui ${_n})
ENDIF()
ENDFOREACH()
# imgui_boost_v2: module name differs from its file (widgets/imgui_boost.das). The
# web embed mounts that file as imgui_boost_v2.das so this resolves.
ADD_MODULE_DAS(imgui imgui imgui_boost_v2)
# Pre-rename dasImgui kept module imgui_boost_v2 in widgets/imgui_boost.das (the web
# embed mounts it under the module name); post-rename (dasImgui #218) the glob above
# already registered it. Tolerate both layouts.
IF(NOT EXISTS "${DAS_WEB_IMGUI_DIR}/widgets/imgui_boost_v2.das")
ADD_MODULE_DAS(imgui imgui imgui_boost_v2)
ENDIF()
UNSET(_module)
# C++ binding modules: register_Module_dasIMGUI / _imgui_app / _imgui_app_headless,
# pulled from the prebuilt wasm32 archives linked in web/CMakeLists.txt.
Expand Down
31 changes: 31 additions & 0 deletions examples/fatman/main.das
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
options gen2
options indenting = 4

// The fat man: statically links every external module into one host and requires them
// all. Exists purely to CI-gate the superbuild (static-embed) half of the external
// modules' both-worlds CMakeLists — the standalone .shared_module half each module's
// own CI covers. Build recipe: clone the externals into modules/ of a daslang checkout
// (no .daspkg_standalone marker), configure + build the daslang target, run this file.
// A `require` proves registration + boost-path resolution + the static link; nothing
// here opens a window or touches a GPU, so it runs on any CI runner.

// C++ binding modules (require-to-link is the whole test, hence the nolints)
require imgui // nolint:STYLE030
require imgui_app // nolint:STYLE030
require imgui_app_headless // nolint:STYLE030
require implot // nolint:STYLE030
require imgui_node_editor // nolint:STYLE030
require vulkan // nolint:STYLE030

// one boost path per external — proves the ADD_MODULE_DAS registrations resolve
require imgui/imgui_boost_v2
require imgui/imgui_theme_daslang // nolint:STYLE030
require imgui/imgui_implot_boost_v2
require imgui/imgui_node_editor_boost_v2
require vulkan/vulkan_boost // nolint:STYLE030
require vulkan/spirv_vulkan_shader

[export]
def main {
print("the fat man stands: imgui + imgui_app(+headless) + implot + node_editor + vulkan all statically linked\n")
}
8 changes: 4 additions & 4 deletions include/daScript/simulate/aot.h
Original file line number Diff line number Diff line change
Expand Up @@ -3079,7 +3079,7 @@ namespace das {

template <typename TT, typename QQ = typename TT::value_type>
__forceinline void das_vector_push ( TT & vec, const QQ & value, int32_t at, Context * context ) {
if ( uint32_t(at)>vec.size() ) {
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 +3082 to 3084
(void)value;
Expand All @@ -3089,7 +3089,7 @@ namespace das {

template <typename TT, typename QQ = typename TT::value_type>
__forceinline void das_vector_push_value ( TT & vec, QQ value, int32_t at, Context * context ) {
if ( uint32_t(at)>vec.size() ) {
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
(void)value;
Expand All @@ -3099,7 +3099,7 @@ namespace das {

template <typename TT, typename QQ = typename TT::value_type>
__forceinline void das_vector_push_empty ( TT & vec, int32_t at, Context * context ) {
if ( uint32_t(at)>vec.size() ) {
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 constexpr (das::is_stub_type<QQ>::value) { DAS_ASSERTF(false, "STUB!"); }
Expand Down Expand Up @@ -3159,7 +3159,7 @@ namespace das {

template <typename TT, typename QQ = typename TT::value_type>
__forceinline void das_vector_erase ( TT & vec, int32_t index, Context * context ) {
if ( uint32_t(index)>vec.size() ) {
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!"); }
Expand Down
9 changes: 6 additions & 3 deletions web/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,12 @@ add_link_options("SHELL:--embed-file ${CMAKE_CURRENT_SOURCE_DIR}/../modules/dasA
IF(DAS_WEB_IMGUI_DIR)
MESSAGE(STATUS "web: embedding dasImgui (${DAS_WEB_IMGUI_DIR}) into daslang_static")
add_link_options("SHELL:--embed-file ${DAS_WEB_IMGUI_DIR}/widgets@modules/dasImgui/imgui")
# module imgui_boost_v2 lives in the file widgets/imgui_boost.das; the NATIVE_MODULE
# resolver maps require imgui/imgui_boost_v2 -> imgui_boost_v2.das, so mount it there too.
add_link_options("SHELL:--embed-file ${DAS_WEB_IMGUI_DIR}/widgets/imgui_boost.das@modules/dasImgui/imgui/imgui_boost_v2.das")
# Pre-rename dasImgui kept module imgui_boost_v2 in the file widgets/imgui_boost.das;
# post-rename (dasImgui #218) the file carries the module's own name and the widgets/
# embed above already covers it. Tolerate both layouts.
IF(NOT EXISTS "${DAS_WEB_IMGUI_DIR}/widgets/imgui_boost_v2.das")
add_link_options("SHELL:--embed-file ${DAS_WEB_IMGUI_DIR}/widgets/imgui_boost.das@modules/dasImgui/imgui/imgui_boost_v2.das")
ENDIF()
add_link_options("SHELL:--embed-file ${DAS_WEB_IMGUI_DIR}/font/JetBrainsMono-Regular.ttf@modules/dasImgui/font/JetBrainsMono-Regular.ttf")
add_link_options("SHELL:--embed-file ${CMAKE_CURRENT_SOURCE_DIR}/../modules/dasLiveHost/live@modules/dasLiveHost/live")
ENDIF()
Expand Down
Loading