From daa8faf9647fd8ee6a20155f8ac05e84d01c6f7f Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 23 Aug 2024 16:09:21 +0200 Subject: [PATCH 1/4] Fix MCU windows binary packages Use Ninja to generate them, so that the provided compiler is used, to determine SIZEOF_VOID_P, and make sure to also use the arm compiler for feature detection on Windows. --- .github/workflows/cpp_package.yaml | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/.github/workflows/cpp_package.yaml b/.github/workflows/cpp_package.yaml index a5e8a5a5682..d85d8eec5b0 100644 --- a/.github/workflows/cpp_package.yaml +++ b/.github/workflows/cpp_package.yaml @@ -103,18 +103,12 @@ jobs: - name: Prepare licenses run: bash -x ../../scripts/prepare_binary_package.sh ../.. working-directory: api/cpp/ - - uses: ilammy/msvc-dev-cmd@v1 - - name: Select MSVC (windows) - run: | - echo "CC=cl.exe" >> $GITHUB_ENV - echo "CXX=cl.exe" >> $GITHUB_ENV - if: matrix.host == 'windows-2022' - name: C++ Build uses: lukka/run-cmake@v3.4 with: cmakeListsOrSettingsJson: CMakeListsTxtAdvanced cmakeListsTxtPath: CMakeLists.txt - cmakeAppendedArgs: "-DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=OFF -DRust_CARGO_TARGET=${{ matrix.target }} -DCMAKE_C_COMPILER=arm-none-eabi-gcc -DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY ${{ env.SLINT_MCU_FEATURES }}" + cmakeAppendedArgs: "-GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=OFF -DRust_CARGO_TARGET=${{ matrix.target }} -DCMAKE_C_COMPILER=arm-none-eabi-gcc -DCMAKE_CXX_COMPILER=arm-none-eabi-g++ -DCMAKE_AR=arm-none-eabi-ar -DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY ${{ env.SLINT_MCU_FEATURES }}" buildDirectory: ${{ runner.workspace }}/cppbuild buildWithCMakeArgs: "--config Release" - name: cpack @@ -164,12 +158,6 @@ jobs: - name: Prepare licenses run: bash -x ../../scripts/prepare_binary_package.sh ../.. working-directory: api/cpp/ - - uses: ilammy/msvc-dev-cmd@v1 - - name: Select MSVC (windows) - run: | - echo "CC=cl.exe" >> $GITHUB_ENV - echo "CXX=cl.exe" >> $GITHUB_ENV - if: matrix.host == 'windows-2022' - name: C++ Build uses: lukka/run-cmake@v3.4 with: @@ -178,7 +166,7 @@ jobs: # NOTE: xtensa-esp-elf-gcc as compiler for the RISC-V targets is wrong, but the compiler argument here is only # used to ensure that SIZEOF_VOID_P is 4 in the generated cmake config file. Otherwise this build requires no # C compiler. - cmakeAppendedArgs: "-DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DESP_PLATFORM=1 -DIDF_TARGET=${{ matrix.idf_target }} -DRust_CARGO_TARGET=${{ matrix.rust_target }} -DCMAKE_C_COMPILER=xtensa-esp-elf-gcc -DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY -DSLINT_LIBRARY_CARGO_FLAGS='-Zbuild-std=core,alloc' ${{ env.SLINT_MCU_FEATURES }}" + cmakeAppendedArgs: "-GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DESP_PLATFORM=1 -DIDF_TARGET=${{ matrix.idf_target }} -DRust_CARGO_TARGET=${{ matrix.rust_target }} -DCMAKE_C_COMPILER=xtensa-esp-elf-gcc -DCMAKE_CXX_COMPILER=xtensa-esp-elf-g++ -DCMAKE_AR=arm-none-eabi-ar -DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY -DSLINT_LIBRARY_CARGO_FLAGS='-Zbuild-std=core,alloc' ${{ env.SLINT_MCU_FEATURES }}" buildDirectory: ${{ runner.workspace }}/cppbuild buildWithCMakeArgs: "--config Release" - name: cpack From ad314f39cf0a1f5e0c643f18877e4e3d510c85af Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 23 Aug 2024 17:41:29 +0200 Subject: [PATCH 2/4] Fix ar --- .github/workflows/cpp_package.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cpp_package.yaml b/.github/workflows/cpp_package.yaml index d85d8eec5b0..1061673ef2b 100644 --- a/.github/workflows/cpp_package.yaml +++ b/.github/workflows/cpp_package.yaml @@ -166,7 +166,7 @@ jobs: # NOTE: xtensa-esp-elf-gcc as compiler for the RISC-V targets is wrong, but the compiler argument here is only # used to ensure that SIZEOF_VOID_P is 4 in the generated cmake config file. Otherwise this build requires no # C compiler. - cmakeAppendedArgs: "-GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DESP_PLATFORM=1 -DIDF_TARGET=${{ matrix.idf_target }} -DRust_CARGO_TARGET=${{ matrix.rust_target }} -DCMAKE_C_COMPILER=xtensa-esp-elf-gcc -DCMAKE_CXX_COMPILER=xtensa-esp-elf-g++ -DCMAKE_AR=arm-none-eabi-ar -DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY -DSLINT_LIBRARY_CARGO_FLAGS='-Zbuild-std=core,alloc' ${{ env.SLINT_MCU_FEATURES }}" + cmakeAppendedArgs: "-GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DESP_PLATFORM=1 -DIDF_TARGET=${{ matrix.idf_target }} -DRust_CARGO_TARGET=${{ matrix.rust_target }} -DCMAKE_C_COMPILER=xtensa-esp-elf-gcc -DCMAKE_CXX_COMPILER=xtensa-esp-elf-g++ -DCMAKE_AR=xtensa-esp-elf-ar -DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY -DSLINT_LIBRARY_CARGO_FLAGS='-Zbuild-std=core,alloc' ${{ env.SLINT_MCU_FEATURES }}" buildDirectory: ${{ runner.workspace }}/cppbuild buildWithCMakeArgs: "--config Release" - name: cpack From 464100a5b2ede176c4d6ff0c13fca5b571b28874 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 23 Aug 2024 18:08:15 +0200 Subject: [PATCH 3/4] Try esp without g++ injection --- .github/workflows/cpp_package.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cpp_package.yaml b/.github/workflows/cpp_package.yaml index 1061673ef2b..45918b29cf9 100644 --- a/.github/workflows/cpp_package.yaml +++ b/.github/workflows/cpp_package.yaml @@ -166,7 +166,7 @@ jobs: # NOTE: xtensa-esp-elf-gcc as compiler for the RISC-V targets is wrong, but the compiler argument here is only # used to ensure that SIZEOF_VOID_P is 4 in the generated cmake config file. Otherwise this build requires no # C compiler. - cmakeAppendedArgs: "-GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DESP_PLATFORM=1 -DIDF_TARGET=${{ matrix.idf_target }} -DRust_CARGO_TARGET=${{ matrix.rust_target }} -DCMAKE_C_COMPILER=xtensa-esp-elf-gcc -DCMAKE_CXX_COMPILER=xtensa-esp-elf-g++ -DCMAKE_AR=xtensa-esp-elf-ar -DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY -DSLINT_LIBRARY_CARGO_FLAGS='-Zbuild-std=core,alloc' ${{ env.SLINT_MCU_FEATURES }}" + cmakeAppendedArgs: "-GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DESP_PLATFORM=1 -DIDF_TARGET=${{ matrix.idf_target }} -DRust_CARGO_TARGET=${{ matrix.rust_target }} -DCMAKE_C_COMPILER=xtensa-esp-elf-gcc -DCMAKE_AR=xtensa-esp-elf-ar -DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY -DSLINT_LIBRARY_CARGO_FLAGS='-Zbuild-std=core,alloc' ${{ env.SLINT_MCU_FEATURES }}" buildDirectory: ${{ runner.workspace }}/cppbuild buildWithCMakeArgs: "--config Release" - name: cpack From a39a25380a49c344968543ee0708cc2c01aeb649 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 23 Aug 2024 19:48:01 +0200 Subject: [PATCH 4/4] Disable windows esp packages for now They won't work because of the voidp being wrong. --- .github/workflows/cpp_package.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cpp_package.yaml b/.github/workflows/cpp_package.yaml index 45918b29cf9..d98cc1d848f 100644 --- a/.github/workflows/cpp_package.yaml +++ b/.github/workflows/cpp_package.yaml @@ -126,7 +126,7 @@ jobs: strategy: matrix: idf_target: [esp32s2, esp32s3, esp32p4] - host: [ubuntu-22.04, windows-2022, macOS-12] + host: [ubuntu-22.04, macOS-12] include: - idf_target: esp32s2 rust_target: xtensa-esp32s2-none-elf