From 6075608bda13c78e56deffdd3a2a561f129b3c9e Mon Sep 17 00:00:00 2001 From: Nick Fisher Date: Tue, 24 Jun 2025 15:26:46 +0800 Subject: [PATCH 1/6] (CI) fix workflow --- .github/workflows/dart.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index 834017e3..f9f8630b 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -16,7 +16,7 @@ jobs: with: channel: master architecture: X64 - - run: cd thermion_dart && dart pub get && dart--enable-experiment=native-assets test + - run: cd thermion_dart && dart pub get && dart --enable-experiment=native-assets test - name: Zip goldens run: zip -r goldens.zip ./thermion_dart/test/output - name: Upload golden images @@ -76,4 +76,4 @@ jobs: # - uses: actions/checkout@v4 # - uses: dart-lang/setup-dart@9a04e6d73cca37bd455e0608d7e5092f881fd603 # - name: Install dependencies - # run: dart pub get \ No newline at end of file + # run: dart pub get From 4a43c6169ae1b0102fa853dbda8e8cb063a91afa Mon Sep 17 00:00:00 2001 From: Nick Fisher Date: Tue, 24 Jun 2025 15:27:27 +0800 Subject: [PATCH 2/6] update build.dart for Linux support --- thermion_dart/hook/build.dart | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/thermion_dart/hook/build.dart b/thermion_dart/hook/build.dart index 1fdaa311..bd46696f 100644 --- a/thermion_dart/hook/build.dart +++ b/thermion_dart/hook/build.dart @@ -76,11 +76,9 @@ void main(List args) async { "filament", "backend", "filameshio", - "viewer", if (targetOS != OS.iOS) "filamat", - "meshoptimizer", - "mikktspace", - "geometry", + if (targetOS == OS.linux) "shaders", + //"geometry", "utils", "filabridge", "gltfio_core", @@ -97,22 +95,18 @@ void main(List args) async { "stb", "uberzlib", "smol-v", + "basis_transcoder", "uberarchive", "zstd", - "basis_transcoder", if (targetOS == OS.macOS) ...["matdbg", "fgviewer"] ]; - if (platform == "windows") { + if (targetOS == OS.windows) { // we just need the libDir and don't need to explicitly link the actual libs // (these are linked via ThermionWin32.h) libDir = Directory(libDir).uri.toFilePath(windows: targetOS == OS.windows); - } else { - libs.add("stdc++"); - } - - final flags = []; //"-fsanitize=address"]; + } final defines = {}; logger.info("User defines : ${input.userDefines}"); @@ -121,7 +115,10 @@ void main(List args) async { defines["ENABLE_TRACING"] = "1"; } + final flags = [ ]; //"-fsanitize=address"]; + var frameworks = []; + if (platform != "windows") { flags.addAll(['-std=c++17']); } else { @@ -170,6 +167,8 @@ void main(List args) async { libs.addAll(["bluegl", "bluevk"]); } else if (platform == "android") { libs.addAll(["GLESv3", "EGL", "bluevk", "dl", "android"]); + } else if (targetOS == OS.linux) { + libs.addAll(["bluevk","bluegl"]); } frameworks = frameworks.expand((f) => ["-framework", f]).toList(); @@ -189,12 +188,17 @@ void main(List args) async { : ['native/include', 'native/include/filament'], defines: platform == "windows" ? {} : defines, flags: [ - if (targetOS == OS.macOS) ...['-mmacosx-version-min=13.0'], + if (targetOS == OS.macOS) '-mmacosx-version-min=13.0', if (targetOS == OS.iOS) '-mios-version-min=13.0', ...flags, ...frameworks, - if (platform != "windows") ...[ - ...libs.map((lib) => "-l$lib"), + if(targetOS == OS.linux) + ...[ "-stdlib=libc++", "-Wl,--whole-archive" ], + if (targetOS != OS.windows)...[ + ...libs.map((lib) => "-l$lib"), + "-Wl,--no-whole-archive", + if(targetOS != OS.linux) + "-lstdc++", "-L$libDir" ], if (platform == "windows") ...[ From 1fe1889fa29332eb4659f83f062573966f378f15 Mon Sep 17 00:00:00 2001 From: Nick Fisher Date: Tue, 24 Jun 2025 15:30:39 +0800 Subject: [PATCH 3/6] remove STB_IMAGE_IMPLEMENTATION (this is already linked) --- thermion_dart/native/src/c_api/TTexture.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/thermion_dart/native/src/c_api/TTexture.cpp b/thermion_dart/native/src/c_api/TTexture.cpp index 24df4b57..9b912c2d 100644 --- a/thermion_dart/native/src/c_api/TTexture.cpp +++ b/thermion_dart/native/src/c_api/TTexture.cpp @@ -25,7 +25,6 @@ #include "Log.hpp" -#define STB_IMAGE_IMPLEMENTATION #include #ifdef __cplusplus From 05c62d5fa0c20c10dea3f5317453b79e3ff6658e Mon Sep 17 00:00:00 2001 From: Nick Fisher Date: Tue, 24 Jun 2025 15:39:41 +0800 Subject: [PATCH 4/6] fix for macOS support --- thermion_dart/hook/build.dart | 3 +++ 1 file changed, 3 insertions(+) diff --git a/thermion_dart/hook/build.dart b/thermion_dart/hook/build.dart index bd46696f..72830fe9 100644 --- a/thermion_dart/hook/build.dart +++ b/thermion_dart/hook/build.dart @@ -98,6 +98,8 @@ void main(List args) async { "basis_transcoder", "uberarchive", "zstd", + if(targetOS != OS.linux) + ...["meshoptimizer","mikktspace", "geometry"], if (targetOS == OS.macOS) ...["matdbg", "fgviewer"] ]; @@ -196,6 +198,7 @@ void main(List args) async { ...[ "-stdlib=libc++", "-Wl,--whole-archive" ], if (targetOS != OS.windows)...[ ...libs.map((lib) => "-l$lib"), + if(targetOS == OS.linux) "-Wl,--no-whole-archive", if(targetOS != OS.linux) "-lstdc++", From e99ccb3100088aaef3249a79a8458276d6139534 Mon Sep 17 00:00:00 2001 From: Nick Fisher Date: Wed, 25 Jun 2025 11:03:48 +0800 Subject: [PATCH 5/6] (CI) update GitHub workflow runner for Linux --- .github/workflows/dart.yml | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dart.yml b/.github/workflows/dart.yml index f9f8630b..5a341967 100644 --- a/.github/workflows/dart.yml +++ b/.github/workflows/dart.yml @@ -8,15 +8,31 @@ on: jobs: update-goldens: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 + - name: Setup LLVM + uses: KyleMayes/install-llvm-action@v1 + with: + version: "16" + - name: Add LLVM to PATH + run: | + echo "${{ github.workspace }}/llvm/bin" >> $GITHUB_PATH + echo "LD_LIBRARY_PATH=${{ github.workspace }}/llvm/lib/x86_64-unknown-linux-gnu/" >> $GITHUB_ENV + - name: Verify installation + run: clang --version + - name: Install Vulkan SDK and dependencies + run: | + wget -qO - https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo apt-key add - + sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-jammy.list https://packages.lunarg.com/vulkan/lunarg-vulkan-jammy.list + sudo apt-get update + sudo apt-get install -y vulkan-sdk - name: Set up Flutter uses: subosito/flutter-action@v2 with: channel: master architecture: X64 - - run: cd thermion_dart && dart pub get && dart --enable-experiment=native-assets test + - run: cd thermion_dart && dart pub get && dart --enable-experiment=native-assets test test/asset_tests.dart - name: Zip goldens run: zip -r goldens.zip ./thermion_dart/test/output - name: Upload golden images @@ -24,6 +40,15 @@ jobs: with: name: golden-images-${{ github.sha }} path: goldens.zip + - name: Upload logs + if: failure() || steps.build.outcome == 'failure' + uses: actions/upload-artifact@v4 + with: + name: build-logs + path: | + ${{ github.workspace }}/thermion_dart/.dart_tool/thermion_dart/log/build.log + retention-days: 5 + flutter_examples: name: flutter_examples runs-on: macos-latest From af9c2a93dcb4571f1535a1e64172a467846b312d Mon Sep 17 00:00:00 2001 From: Nick Fisher Date: Wed, 25 Jun 2025 11:05:07 +0800 Subject: [PATCH 6/6] (Linux) remove OS check for mikktspace & geometry --- thermion_dart/hook/build.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/thermion_dart/hook/build.dart b/thermion_dart/hook/build.dart index 72830fe9..236b4564 100644 --- a/thermion_dart/hook/build.dart +++ b/thermion_dart/hook/build.dart @@ -98,8 +98,8 @@ void main(List args) async { "basis_transcoder", "uberarchive", "zstd", - if(targetOS != OS.linux) - ...["meshoptimizer","mikktspace", "geometry"], + "mikktspace", + "geometry", if (targetOS == OS.macOS) ...["matdbg", "fgviewer"] ];