From 1d50780f0a5e6a4c9945c3101f98917b5ad94684 Mon Sep 17 00:00:00 2001 From: Andy Alt Date: Wed, 4 Dec 2024 00:41:10 -0600 Subject: [PATCH] Fix MacOS build (#34) * Testing xquartz * Update build.yml * Trying to fix macos build For #33 * utils/paths.hpp: include * Update gen-components.tsx * Update ui-field.types.hpp & ui-field.types.cpp to remove uint * Fixes to build.yml before merging & timeout --------- Co-authored-by: KaruroChori --- .github/workflows/build.yml | 19 +++++++++++++++++-- include/ui-field.types.hpp | 4 ++-- include/utils/paths.hpp | 3 ++- scripts/codegen/gen-components.tsx | 3 ++- src/ui-field.types.cpp | 4 ++-- 5 files changed, 25 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b3a1d3b6..fe185425 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,6 +30,7 @@ jobs: matrix: os: [ubuntu-24.04] runs-on: ${{ matrix.os }} + timeout-minutes: 8 env: CC: clang-19 CXX: clang++-19 @@ -70,9 +71,15 @@ jobs: bun run codegen bun run meson-setup.clang-release meson compile -C build/ vs:executable - + - name: Archive production artifacts + uses: actions/upload-artifact@v4 + with: + name: logs + path: | + build/meson-logs/**/* macos: runs-on: macos-14 + timeout-minutes: 8 env: LDFLAGS: '-L/opt/homebrew/opt/llvm/lib' CPPFLAGS: '-I/opt/homebrew/opt/llvm/include' @@ -89,6 +96,7 @@ jobs: libpng \ meson \ ninja + brew install --cask xquartz cd /opt/homebrew/opt/llvm/bin #ln -s clang++ clang++-19 PATH=/opt/homebrew/opt/llvm/bin:$PATH @@ -100,5 +108,12 @@ jobs: bun install bun run codegen meson setup --reconfigure build/ --buildtype=release --native-file toolchains/flatpak.ini + # Unclear fix to be investigated + rm subprojects/libtcc/VERSION meson compile -C build/ vs:executable - + - name: Archive production artifacts + uses: actions/upload-artifact@v4 + with: + name: logs + path: | + build/meson-logs/**/* diff --git a/include/ui-field.types.hpp b/include/ui-field.types.hpp index 0b8436f1..598156be 100644 --- a/include/ui-field.types.hpp +++ b/include/ui-field.types.hpp @@ -30,7 +30,7 @@ namespace field_types{ // Helpers to compute expressions into values that Fl_Widgets can use. - bool h_px(uint T, size_t *dst, const char *expr, + bool h_px(unsigned int T, size_t *dst, const char *expr, const ui_base *env); bool h_colour(uint32_t *dst, const char *expr, const ui_base *env); @@ -38,4 +38,4 @@ namespace field_types{ bool h_flag(bool *dst, const char *expr, const ui_base *env); } -} \ No newline at end of file +} diff --git a/include/utils/paths.hpp b/include/utils/paths.hpp index d0430331..9274862b 100644 --- a/include/utils/paths.hpp +++ b/include/utils/paths.hpp @@ -8,6 +8,7 @@ * */ +#include #include #include #include @@ -185,4 +186,4 @@ struct resolve_path{ #undef tnk #undef prefix -} \ No newline at end of file +} diff --git a/scripts/codegen/gen-components.tsx b/scripts/codegen/gen-components.tsx index 186f9d3c..0e07c0c8 100644 --- a/scripts/codegen/gen-components.tsx +++ b/scripts/codegen/gen-components.tsx @@ -64,6 +64,7 @@ class ${cppname} : public ${data.codegen.extends}{ `; let class_impl = ` +#include #include namespace vs{ @@ -209,4 +210,4 @@ await Bun.write('./commons/schemas/json-component.schema.json', JSON.stringify(w if (process.argv[2] != 'quick') { await Bun.write('./src/components/autogen/meson.build', `autogen_components = [${cpp_files.map(x => `'${x}'`)}]`) -} \ No newline at end of file +} diff --git a/src/ui-field.types.cpp b/src/ui-field.types.cpp index 208b7778..de80ae04 100644 --- a/src/ui-field.types.cpp +++ b/src/ui-field.types.cpp @@ -149,7 +149,7 @@ namespace field_types{ //TODO: I need to check if number conversions failed or not too. - bool h_px(uint T, size_t* dst, const char* expr, const ui_base* env){ + bool h_px(unsigned int T, size_t* dst, const char* expr, const ui_base* env){ if (T==1){ dst[0]=std::stoi(expr); return true; @@ -182,4 +182,4 @@ namespace field_types{ } -} \ No newline at end of file +}