From 7573770b0cf087fa3ca2b964042f6593d3d00932 Mon Sep 17 00:00:00 2001 From: Jacob Oursland Date: Thu, 30 Nov 2023 18:32:09 -0700 Subject: [PATCH 01/13] CMake: set FREECAD_USE_PYBIND11 on conda builds, not all. --- CMakePresets.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index e8cc5a266e..8df42b74f2 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -10,10 +10,6 @@ "name": "common", "hidden": true, "cacheVariables": { - "FREECAD_USE_PYBIND11": { - "type": "BOOL", - "value": "ON" - } } }, { @@ -91,6 +87,10 @@ "type": "BOOL", "value": "ON" }, + "FREECAD_USE_PYBIND11": { + "type": "BOOL", + "value": "ON" + }, "OCCT_CMAKE_FALLBACK": { "type": "BOOL", "value": "ON" From 4e020c14a310f9a51d6e9348be236cb44923d8cf Mon Sep 17 00:00:00 2001 From: Jacob Oursland Date: Thu, 30 Nov 2023 18:33:12 -0700 Subject: [PATCH 02/13] CMake: Use /Z7 instead of /Zi when ccache is used. --- .../SetGlobalCompilerAndLinkerSettings.cmake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cMake/FreeCAD_Helpers/SetGlobalCompilerAndLinkerSettings.cmake b/cMake/FreeCAD_Helpers/SetGlobalCompilerAndLinkerSettings.cmake index f70ba715b3..29961c3fa7 100644 --- a/cMake/FreeCAD_Helpers/SetGlobalCompilerAndLinkerSettings.cmake +++ b/cMake/FreeCAD_Helpers/SetGlobalCompilerAndLinkerSettings.cmake @@ -42,6 +42,13 @@ macro(SetGlobalCompilerAndLinkerSettings) set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /EHa") endif() endif(FREECAD_RELEASE_SEH) + if(CCACHE_PROGRAM) + # By default Visual Studio generators will use /Zi which is not compatible + # with ccache, so tell Visual Studio to use /Z7 instead. + string(REGEX REPLACE "/Z[iI]" "/Z7" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}") + string(REGEX REPLACE "/Z[iI]" "/Z7" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") + string(REGEX REPLACE "/Z[iI]" "/Z7" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}") + endif(CCACHE_PROGRAM) option(FREECAD_USE_MP_COMPILE_FLAG "Add /MP flag to the compiler definitions. Speeds up the compile on multi processor machines" ON) if(FREECAD_USE_MP_COMPILE_FLAG) From db8b9fc0bac38f20f407f5faca7e84e24b209c68 Mon Sep 17 00:00:00 2001 From: Jacob Oursland Date: Thu, 30 Nov 2023 18:34:06 -0700 Subject: [PATCH 03/13] conda: use double quotes for terminal compatibility. --- conda/setup-environment.cmd | 2 +- conda/setup-environment.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/conda/setup-environment.cmd b/conda/setup-environment.cmd index 115b7ddfa8..24c7610850 100644 --- a/conda/setup-environment.cmd +++ b/conda/setup-environment.cmd @@ -4,7 +4,7 @@ call mamba env create -p .conda/freecad -f conda/conda-env.yaml :: add the environment subdirectory to the conda configuration call conda config --add envs_dirs %CONDA_PREFIX%/envs call conda config --add envs_dirs %CD%/.conda -call conda config --set env_prompt '({name})' +call conda config --set env_prompt "({name})" :: install the FreeCAD dependencies into the environment call mamba run --live-stream -n freecad mamba-devenv -f conda/environment.devenv.yml diff --git a/conda/setup-environment.sh b/conda/setup-environment.sh index b4734cd7a4..c667e2dbf3 100755 --- a/conda/setup-environment.sh +++ b/conda/setup-environment.sh @@ -6,7 +6,7 @@ mamba env create -p .conda/freecad -f conda/conda-env.yaml # add the environment subdirectory to the conda configuration conda config --add envs_dirs $CONDA_PREFIX/envs conda config --add envs_dirs $(pwd)/.conda -conda config --set env_prompt '({name})' +conda config --set env_prompt "({name})" # install the FreeCAD dependencies into the environment mamba run --live-stream -n freecad mamba-devenv -f conda/environment.devenv.yml From 6f59308cb724cc213f1140c532be773228bcc68f Mon Sep 17 00:00:00 2001 From: Jacob Oursland Date: Thu, 30 Nov 2023 18:34:32 -0700 Subject: [PATCH 04/13] conda: Add ccache. --- conda/environment.devenv.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/conda/environment.devenv.yml b/conda/environment.devenv.yml index 7ff5ee6713..4734fa71ef 100644 --- a/conda/environment.devenv.yml +++ b/conda/environment.devenv.yml @@ -57,6 +57,7 @@ dependencies: - sed # [unix] - boost - boost-cpp +- ccache - cmake - coin3d==4.0.0 - compilers From 1e05aa9bcfb837a33fd86631a20a9ba77ed5fbaa Mon Sep 17 00:00:00 2001 From: Jacob Oursland Date: Fri, 1 Dec 2023 12:50:37 -0700 Subject: [PATCH 05/13] CI: Remove unnecessary Ubuntu 22.04 build. --- .github/workflows/CI_master.yml | 8 +- .github/workflows/sub_buildUbuntu2204.yml | 250 ---------------------- 2 files changed, 1 insertion(+), 257 deletions(-) delete mode 100644 .github/workflows/sub_buildUbuntu2204.yml diff --git a/.github/workflows/CI_master.yml b/.github/workflows/CI_master.yml index ce0e54fe59..6cde36562c 100644 --- a/.github/workflows/CI_master.yml +++ b/.github/workflows/CI_master.yml @@ -45,12 +45,6 @@ jobs: with: artifactBasename: Ubuntu_20-04-${{ github.run_id }} - Ubuntu_22-04: - needs: [Prepare] - uses: ./.github/workflows/sub_buildUbuntu2204.yml - with: - artifactBasename: Ubuntu_22-04-${{ github.run_id }} - Windows: needs: [Prepare] uses: ./.github/workflows/sub_buildWindows.yml @@ -67,7 +61,7 @@ jobs: changedPythonFiles: ${{ needs.Prepare.outputs.changedPythonFiles }} WrapUp: - needs: [Prepare, Ubuntu_20-04, Ubuntu_22-04, Windows, Lint] + needs: [Prepare, Ubuntu_20-04, Windows, Lint] if: always() uses: ./.github/workflows/sub_wrapup.yml with: diff --git a/.github/workflows/sub_buildUbuntu2204.yml b/.github/workflows/sub_buildUbuntu2204.yml deleted file mode 100644 index f1bf5fc0a3..0000000000 --- a/.github/workflows/sub_buildUbuntu2204.yml +++ /dev/null @@ -1,250 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1-or-later -# *************************************************************************** -# * * -# * Copyright (c) 2023 0penBrain. * -# * * -# * This file is part of FreeCAD. * -# * * -# * FreeCAD is free software: you can redistribute it and/or modify it * -# * under the terms of the GNU Lesser General Public License as * -# * published by the Free Software Foundation, either version 2.1 of the * -# * License, or (at your option) any later version. * -# * * -# * FreeCAD is distributed in the hope that it will be useful, but * -# * WITHOUT ANY WARRANTY; without even the implied warranty of * -# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * -# * Lesser General Public License for more details. * -# * * -# * You should have received a copy of the GNU Lesser General Public * -# * License along with FreeCAD. If not, see * -# * . * -# * * -# *************************************************************************** - -# This is a build and test workflow for CI of FreeCAD. -# This workflow aims at building and testing FreeCAD on Ubuntu 22.04 using Clang. - -name: Build Ubuntu 22.04 -on: - workflow_call: - inputs: - artifactBasename: - type: string - required: true - testOnBuildDir: - default: false - type: boolean - required: false - allowedToFail: - default: false - type: boolean - required: false - outputs: - reportFile: - value: ${{ jobs.Build.outputs.reportFile }} - -jobs: - Build: - runs-on: ubuntu-22.04 - continue-on-error: ${{ inputs.allowedToFail }} - env: - CCACHE_DIR: ${{ github.workspace }}/ccache - CCACHE_CONFIGPATH: ${{ github.workspace }}/ccache/config - CCACHE_MAXSIZE: 1G - CCACHE_COMPILERCHECK: "%compiler% -dumpfullversion -dumpversion" # default:mtime - CCACHE_COMPRESS: true - CCACHE_COMPRESSLEVEL: 1 - #CC: /usr/bin/gcc - #CXX: /usr/bin/g++ - CC: /usr/bin/clang - CXX: /usr/bin/clang++ - builddir: ${{ github.workspace }}/build/ - logdir: /tmp/logs/ - reportdir: /tmp/report/ - reportfilename: ${{ inputs.artifactBasename }}-report.md - defaults: - run: - shell: bash - outputs: - reportFile: ${{ steps.Init.outputs.reportFile }} - - steps: - - name: Checking out source code - uses: actions/checkout@v3 - with: - submodules: true - - name: Install FreeCAD dependencies - run: | - sudo apt-get update -qq - sudo apt-get install -y --no-install-recommends \ - doxygen \ - graphviz \ - imagemagick \ - libboost-date-time-dev \ - libboost-dev \ - libboost-filesystem-dev \ - libboost-graph-dev \ - libboost-iostreams-dev \ - libboost-program-options-dev \ - libboost-python-dev \ - libboost-regex-dev \ - libboost-serialization-dev \ - libboost-thread-dev \ - libcoin-dev \ - libeigen3-dev \ - libgts-bin \ - libgts-dev \ - libkdtree++-dev \ - libmedc-dev \ - libocct-data-exchange-dev \ - libocct-ocaf-dev \ - libocct-visualization-dev \ - libopencv-dev \ - libproj-dev \ - libpyside2-dev \ - libqt5opengl5-dev \ - libqt5svg5-dev \ - libqt5x11extras5-dev \ - libqt5xmlpatterns5-dev \ - libshiboken2-dev \ - libspnav-dev \ - libvtk7-dev \ - libx11-dev \ - libxerces-c-dev \ - libyaml-cpp-dev \ - libzipios++-dev \ - netgen \ - netgen-headers \ - occt-draw \ - pyqt5-dev-tools \ - pyside2-tools \ - python3-dev \ - python3-git \ - python3-markdown \ - python3-matplotlib \ - python3-packaging \ - python3-pivy \ - python3-ply \ - python3-pyside2.qtcore \ - python3-pyside2.qtgui \ - python3-pyside2.qtnetwork \ - python3-pyside2.qtsvg \ - python3-pyside2.qtwebengine \ - python3-pyside2.qtwebenginecore \ - python3-pyside2.qtwebenginewidgets \ - python3-pyside2.qtwebchannel \ - python3-pyside2.qtwidgets \ - qtbase5-dev \ - qttools5-dev \ - qtwebengine5-dev \ - shiboken2 \ - swig \ - ccache \ - xvfb - - name: Make needed directories, files and initializations - id: Init - run: | - mkdir -p ${{ env.CCACHE_DIR }} - mkdir -p ${{ env.CCACHE_CONFIGPATH }} - mkdir -p ${{ env.builddir }} - mkdir -p ${{ env.logdir }} - mkdir -p ${{ env.reportdir }} - echo "reportFile=${{ env.reportfilename }}" >> $GITHUB_OUTPUT - - name: Generate cache key - id: genCacheKey - uses: ./.github/workflows/actions/linux/generateCacheKey - with: - compiler: ${{ env.CXX }} - - name: Restore Compiler Cache - uses: pat-s/always-upload-cache@v3 - with: - path: ${{ env.CCACHE_DIR }} - key: FC-${{ steps.genCacheKey.outputs.cacheKey }}-${{ github.ref }}-${{ github.run_id }} - restore-keys: | - FC-${{ steps.genCacheKey.outputs.cacheKey }}-${{ github.ref }}- - FC-${{ steps.genCacheKey.outputs.cacheKey }}- - - name: Print CCache statistics before build, reset stats and print config - run: | - ccache -s - ccache -z - ccache -p - - name: CMake Configure - uses: ./.github/workflows/actions/linux/configure - with: - builddir: ${{ env.builddir }} - logFile: ${{ env.logdir }}Cmake.log - errorFile: ${{ env.logdir }}CmakeErrors.log - reportFile: ${{env.reportdir}}${{ env.reportfilename }} - - name: CMake Build - uses: ./.github/workflows/actions/linux/build - with: - builddir: ${{ env.builddir }} - logFile: ${{ env.logdir }}Build.log - errorFile: ${{ env.logdir }}BuildErrors.log - reportFile: ${{env.reportdir}}${{ env.reportfilename }} - - name: Print ccache statistics after Build - run: | - ccache -s - - name: FreeCAD CLI tests on build dir - if: inputs.testOnBuildDir - timeout-minutes: 10 - uses: ./.github/workflows/actions/runPythonTests - with: - testDescription: "CLI tests on build dir" - testCommand: ${{ env.builddir }}bin/FreeCADCmd -t 0 - logFile: ${{ env.logdir }}TestCLIBuild.log - reportFile: ${{env.reportdir}}${{ env.reportfilename }} - - name: FreeCAD GUI tests on build dir - if: inputs.testOnBuildDir - timeout-minutes: 15 - uses: ./.github/workflows/actions/runPythonTests - with: - testDescription: "GUI tests on build dir" - testCommand: xvfb-run ${{ env.builddir }}/bin/FreeCAD -t 0 - logFile: ${{ env.logdir }}TestGUIBuild.log - reportFile: ${{env.reportdir}}${{ env.reportfilename }} - - name: C++ tests - timeout-minutes: 1 - uses: ./.github/workflows/actions/runCPPTests/runAllTests - with: - reportdir: ${{ env.reportdir }} - builddir: ${{ env.builddir }} - reportFile: ${{ env.reportdir }}${{ env.reportfilename }} - - name: CMake Install - uses: ./.github/workflows/actions/linux/install - with: - builddir: ${{ env.builddir }} - logFile: ${{ env.logdir }}Install.log - errorFile: ${{ env.logdir }}InstallErrors.log - reportFile: ${{env.reportdir}}${{ env.reportfilename }} - - name: FreeCAD CLI tests on install - timeout-minutes: 10 - uses: ./.github/workflows/actions/runPythonTests - with: - testDescription: "CLI tests on install" - testCommand: FreeCADCmd -t 0 - logFile: ${{ env.logdir }}TestCLIInstall.log - reportFile: ${{env.reportdir}}${{ env.reportfilename }} - - name: FreeCAD GUI tests on install - timeout-minutes: 15 - uses: ./.github/workflows/actions/runPythonTests - with: - testDescription: "GUI tests on install" - testCommand: xvfb-run FreeCAD -t 0 - logFile: ${{ env.logdir }}TestGUIInstall.log - reportFile: ${{env.reportdir}}${{ env.reportfilename }} - - name: Upload logs - if: always() - uses: actions/upload-artifact@v3 - with: - name: ${{ inputs.artifactBasename }}-Logs - path: | - ${{ env.logdir }} - /var/crash/*FreeCAD* - - name: Upload report - if: always() - uses: actions/upload-artifact@v3 - with: - name: ${{ env.reportfilename }} - path: | - ${{env.reportdir}}${{ env.reportfilename }} From e3bae128192c8dab84db338ea1da5ed7ab33a7a4 Mon Sep 17 00:00:00 2001 From: Jacob Oursland Date: Thu, 30 Nov 2023 18:29:17 -0700 Subject: [PATCH 06/13] CI: Use CMake presets. --- .github/workflows/sub_buildUbuntu2004.yml | 5 +++-- .github/workflows/sub_buildWindows.yml | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/sub_buildUbuntu2004.yml b/.github/workflows/sub_buildUbuntu2004.yml index e479eb1c75..7bc91f38e2 100644 --- a/.github/workflows/sub_buildUbuntu2004.yml +++ b/.github/workflows/sub_buildUbuntu2004.yml @@ -60,7 +60,7 @@ jobs: CXX: /usr/bin/g++ #CC: /usr/bin/clang #CXX: /usr/bin/clang++ - builddir: ${{ github.workspace }}/build/ + builddir: ${{ github.workspace }}/build/release/ logdir: /tmp/logs/ reportdir: /tmp/report/ reportfilename: ${{ inputs.artifactBasename }}-report.md @@ -173,6 +173,7 @@ jobs: - name: CMake Configure uses: ./.github/workflows/actions/linux/configure with: + extraParameters: --preset release builddir: ${{ env.builddir }} logFile: ${{ env.logdir }}Cmake.log errorFile: ${{ env.logdir }}CmakeErrors.log @@ -193,7 +194,7 @@ jobs: uses: ./.github/workflows/actions/runPythonTests with: testDescription: "CLI tests on build dir" - testCommand: ${{ env.builddir }}bin/FreeCADCmd -t 0 + testCommand: ${{ env.builddir }}/bin/FreeCADCmd -t 0 logFile: ${{ env.logdir }}TestCLIBuild.log reportFile: ${{env.reportdir}}${{ env.reportfilename }} - name: FreeCAD GUI tests on build dir diff --git a/.github/workflows/sub_buildWindows.yml b/.github/workflows/sub_buildWindows.yml index b32887b1ef..e899d3c7a1 100644 --- a/.github/workflows/sub_buildWindows.yml +++ b/.github/workflows/sub_buildWindows.yml @@ -52,7 +52,7 @@ jobs: #CCACHE_SLOPPINESS: "pch_defines,time_macros" # Can't get PCH to work on Windows CCACHE_LOGFILE: C:/logs/ccache.log ## Have to use C:\ because not enough space on workspace drive - builddir: C:/FC/build/ + builddir: C:/FC/build/release/ libpackdir: C:/FC/libpack/ ccachebindir: C:/FC/ccache/ logdir: C:/logs/ @@ -104,6 +104,7 @@ jobs: - name: Configuring CMake run: > cmake -B"${{ env.builddir }}" . + --preset release -DCMAKE_VS_NO_COMPILE_BATCHING=ON -DCMAKE_BUILD_TYPE=Release -DFREECAD_USE_PCH=OFF From 6011d3fb0a5206976ad05f9c74317d8412b1e482 Mon Sep 17 00:00:00 2001 From: Jacob Oursland Date: Thu, 30 Nov 2023 18:30:47 -0700 Subject: [PATCH 07/13] CI: fix indentation. --- .github/workflows/sub_wrapup.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sub_wrapup.yml b/.github/workflows/sub_wrapup.yml index f6a7634129..5bf7ee5d7e 100644 --- a/.github/workflows/sub_wrapup.yml +++ b/.github/workflows/sub_wrapup.yml @@ -83,8 +83,8 @@ jobs: echo "### $icon $step step" >> report.md if [ $result == 'skipped' ] then - echo "Step was skipped, no report was generated" | tee -a report.md - continue + echo "Step was skipped, no report was generated" | tee -a report.md + continue elif [ $result == 'cancelled' ] then echo "Step was cancelled when executing, report may be incomplete" | tee -a report.md From d48dec1c0ab8173031edd9128f4a46bf4e00c304 Mon Sep 17 00:00:00 2001 From: Jacob Oursland Date: Thu, 30 Nov 2023 18:37:49 -0700 Subject: [PATCH 08/13] CI: Add conda builds. --- .github/workflows/CI_master.yml | 21 +- .../workflows/actions/linux/build/action.yml | 4 +- .../actions/linux/configure/action.yml | 4 +- .../actions/linux/generateCacheKey/action.yml | 4 +- .../actions/linux/install/action.yml | 4 +- .../runCPPTests/runAllTests/action.yml | 3 +- .../runCPPTests/runSingleTest/action.yml | 4 +- .../actions/runPythonTests/action.yml | 4 +- .../workflows/sub_buildUbuntu2204Conda.yml | 194 ++++++++++++++++++ .github/workflows/sub_buildWindowsConda.yml | 129 ++++++++++++ 10 files changed, 356 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/sub_buildUbuntu2204Conda.yml create mode 100644 .github/workflows/sub_buildWindowsConda.yml diff --git a/.github/workflows/CI_master.yml b/.github/workflows/CI_master.yml index 6cde36562c..1de7510563 100644 --- a/.github/workflows/CI_master.yml +++ b/.github/workflows/CI_master.yml @@ -45,12 +45,24 @@ jobs: with: artifactBasename: Ubuntu_20-04-${{ github.run_id }} + Ubuntu_22-04_Conda: + needs: [Prepare] + uses: ./.github/workflows/sub_buildUbuntu2204Conda.yml + with: + artifactBasename: Ubuntu_22-04_Conda-${{ github.run_id }} + Windows: needs: [Prepare] uses: ./.github/workflows/sub_buildWindows.yml with: artifactBasename: Windows-${{ github.run_id }} + Windows_Conda: + needs: [Prepare] + uses: ./.github/workflows/sub_buildWindowsConda.yml + with: + artifactBasename: Windows_Conda-${{ github.run_id }} + Lint: needs: [Prepare] uses: ./.github/workflows/sub_lint.yml @@ -61,7 +73,14 @@ jobs: changedPythonFiles: ${{ needs.Prepare.outputs.changedPythonFiles }} WrapUp: - needs: [Prepare, Ubuntu_20-04, Windows, Lint] + needs: [ + Prepare, + Ubuntu_20-04, + Ubuntu_22-04_Conda, + Windows, + Windows_Conda, + Lint + ] if: always() uses: ./.github/workflows/sub_wrapup.yml with: diff --git a/.github/workflows/actions/linux/build/action.yml b/.github/workflows/actions/linux/build/action.yml index 3e0162d2fe..98a0d056f5 100644 --- a/.github/workflows/actions/linux/build/action.yml +++ b/.github/workflows/actions/linux/build/action.yml @@ -46,12 +46,12 @@ runs: steps: - name: Build id: build - shell: bash + shell: bash -l {0} run: | (stdbuf -oL -eL cmake --build ${{ inputs.builddir }} -j$(nproc) ${{ inputs.extraParameters }}) \ 2> >(tee -a ${{ inputs.errorFile }}) | tee -a ${{ inputs.logFile }} - name: Write report - shell: bash + shell: bash -l {0} if: always() run: | if [ ${{ steps.build.outcome }} == 'success' ] diff --git a/.github/workflows/actions/linux/configure/action.yml b/.github/workflows/actions/linux/configure/action.yml index 643101f1c2..2b33ef3d0c 100644 --- a/.github/workflows/actions/linux/configure/action.yml +++ b/.github/workflows/actions/linux/configure/action.yml @@ -50,12 +50,12 @@ runs: steps: - name: Configure CMake id: configure - shell: bash + shell: bash -l {0} run: | (stdbuf -oL -eL cmake -S ${{ inputs.sourcedir }} -B ${{ inputs.builddir }} -D CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE ${{inputs.extraParameters }}) \ 2> >(tee -a ${{ inputs.errorFile }}) | tee -a ${{ inputs.logFile }} - name: Write report - shell: bash + shell: bash -l {0} if: always() run: | if [ ${{ steps.configure.outcome }} == 'success' ] diff --git a/.github/workflows/actions/linux/generateCacheKey/action.yml b/.github/workflows/actions/linux/generateCacheKey/action.yml index 59673c9fe9..36053fe6c6 100644 --- a/.github/workflows/actions/linux/generateCacheKey/action.yml +++ b/.github/workflows/actions/linux/generateCacheKey/action.yml @@ -37,8 +37,8 @@ runs: using: "composite" steps: - id: generateCacheKey - shell: bash + shell: bash -l {0} run: | - cacheKey=$(lsb_release -ds | tr -d ' ')-$( basename ${{ inputs.compiler }})$(${{ inputs.compiler }} -dumpfullversion -dumpversion) + cacheKey=$(lsb_release -ds | tr -d ' ')-$(basename ${{ inputs.compiler }})$(${{ inputs.compiler }} -dumpfullversion -dumpversion) echo "Generated cache key : $cacheKey" echo "cacheKey=$cacheKey" >> $GITHUB_OUTPUT diff --git a/.github/workflows/actions/linux/install/action.yml b/.github/workflows/actions/linux/install/action.yml index 87b91ad93d..05bb57252f 100644 --- a/.github/workflows/actions/linux/install/action.yml +++ b/.github/workflows/actions/linux/install/action.yml @@ -46,12 +46,12 @@ runs: steps: - name: Install id: install - shell: bash + shell: bash -l {0} run: | (stdbuf -oL -eL sudo cmake --install ${{ inputs.builddir }} ${{ inputs.extraParameters }}) \ 2> >(tee -a ${{ inputs.errorFile }}) | tee -a ${{ inputs.logFile }} - name: Write report - shell: bash + shell: bash -l {0} if: always() run: | if [ ${{ steps.install.outcome }} == 'success' ] diff --git a/.github/workflows/actions/runCPPTests/runAllTests/action.yml b/.github/workflows/actions/runCPPTests/runAllTests/action.yml index bdb434c220..bc6b3972ba 100644 --- a/.github/workflows/actions/runCPPTests/runAllTests/action.yml +++ b/.github/workflows/actions/runCPPTests/runAllTests/action.yml @@ -84,7 +84,7 @@ runs: testName: Sketcher - name: Compose summary report based on test results if: always() - shell: bash + shell: bash -l {0} run: | # Print global result if [ ${{ job.status }} != "success" ] @@ -104,4 +104,3 @@ runs: echo "" >> ${{ inputs.reportFile }} echo "" >> ${{ inputs.reportFile }} echo "" >> ${{ inputs.reportFile }} - diff --git a/.github/workflows/actions/runCPPTests/runSingleTest/action.yml b/.github/workflows/actions/runCPPTests/runSingleTest/action.yml index 642433f2c4..b99c01466a 100644 --- a/.github/workflows/actions/runCPPTests/runSingleTest/action.yml +++ b/.github/workflows/actions/runCPPTests/runSingleTest/action.yml @@ -44,12 +44,12 @@ runs: using: "composite" steps: - name: Run C++ tests - shell: bash + shell: bash -l {0} run: stdbuf -oL -eL ${{ inputs.testCommand }} |& tee -a ${{ inputs.testLogFile }} - name: Parse test results if: always() id: report - shell: bash + shell: bash -l {0} run: | result=$(sed -ne "/Global test environment tear-down/,/^$/{/^$/d;p}" ${{ inputs.testLogFile }}) if grep -qF "[ FAILED ]" <<< $result diff --git a/.github/workflows/actions/runPythonTests/action.yml b/.github/workflows/actions/runPythonTests/action.yml index b69e461ad3..26b362d2bb 100644 --- a/.github/workflows/actions/runPythonTests/action.yml +++ b/.github/workflows/actions/runPythonTests/action.yml @@ -43,11 +43,11 @@ runs: steps: - name: Run tests id: runTests - shell: bash + shell: bash -l {0} run: | stdbuf -oL -eL ${{ inputs.testCommand }} |& sed -Ee "/[[:blank:]]*\([[:digit:]]{1,3} %\)[[:blank:]]*/d" | tee -a ${{ inputs.logFile }} - name: Write report - shell: bash + shell: bash -l {0} if: always() run: | sed -ne "/^\(FAILED\|ERROR\):/,/^[[:blank:]]*$/bF; /^Traceback/,/^[^[:blank:]]/{/^Traceback/bT; /^[^[:blank:]]/G; bT}; b; :T w ${{ inputs.logFile }}_tracebacks" -e "b; :F w ${{ inputs.logFile }}_failedtests" ${{ inputs.logFile }} diff --git a/.github/workflows/sub_buildUbuntu2204Conda.yml b/.github/workflows/sub_buildUbuntu2204Conda.yml new file mode 100644 index 0000000000..bb3ae8e32d --- /dev/null +++ b/.github/workflows/sub_buildUbuntu2204Conda.yml @@ -0,0 +1,194 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +# *************************************************************************** +# * * +# * Copyright (c) 2023 0penBrain. * +# * * +# * This file is part of FreeCAD. * +# * * +# * FreeCAD is free software: you can redistribute it and/or modify it * +# * under the terms of the GNU Lesser General Public License as * +# * published by the Free Software Foundation, either version 2.1 of the * +# * License, or (at your option) any later version. * +# * * +# * FreeCAD is distributed in the hope that it will be useful, but * +# * WITHOUT ANY WARRANTY; without even the implied warranty of * +# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * +# * Lesser General Public License for more details. * +# * * +# * You should have received a copy of the GNU Lesser General Public * +# * License along with FreeCAD. If not, see * +# * . * +# * * +# *************************************************************************** + +# This is a build and test workflow for CI of FreeCAD. +# This workflow aims at building and testing FreeCAD on a Conda environment on Linux. + +name: Build Ubuntu 22.04 (Conda) +on: + workflow_call: + inputs: + artifactBasename: + type: string + required: true + testOnBuildDir: + default: false + type: boolean + required: false + allowedToFail: + default: false + type: boolean + required: false + outputs: + reportFile: + value: ${{ jobs.Build.outputs.reportFile }} + +jobs: + Build: + runs-on: ubuntu-22.04 + continue-on-error: ${{ inputs.allowedToFail }} + env: + CCACHE_DIR: ${{ github.workspace }}/ccache + CCACHE_CONFIGPATH: ${{ github.workspace }}/ccache/config + CCACHE_MAXSIZE: 1G + CCACHE_COMPILERCHECK: "%compiler% -dumpfullversion -dumpversion" # default:mtime + CCACHE_COMPRESS: true + CCACHE_COMPRESSLEVEL: 1 + builddir: ${{ github.workspace }}/build/release/ + logdir: /tmp/logs/ + reportdir: /tmp/report/ + reportfilename: ${{ inputs.artifactBasename }}-report.md + defaults: + run: + shell: bash -l {0} + outputs: + reportFile: ${{ steps.Init.outputs.reportFile }} + + steps: + - name: Checking out source code + uses: actions/checkout@v3 + with: + submodules: true + - name: Setup Miniconda + uses: conda-incubator/setup-miniconda@v2 + with: + activate-environment: .conda/freecad + environment-file: conda/conda-env.yaml + channels: conda-forge,defaults + channel-priority: true + miniforge-version: latest + - name: Install FreeCAD dependencies + run: | + ./conda/setup-environment.sh + - name: Set Environment Variables + run: | + echo "CC=$CC" >> "$GITHUB_ENV" + echo "CXX=$CXX" >> "$GITHUB_ENV" + - name: Make needed directories, files and initializations + id: Init + run: | + mkdir -p ${{ env.CCACHE_DIR }} + mkdir -p ${{ env.CCACHE_CONFIGPATH }} + mkdir -p ${{ env.builddir }} + mkdir -p ${{ env.logdir }} + mkdir -p ${{ env.reportdir }} + echo "reportFile=${{ env.reportfilename }}" >> $GITHUB_OUTPUT + - name: Generate cache key + id: genCacheKey + uses: ./.github/workflows/actions/linux/generateCacheKey + with: + compiler: ${{ env.CXX }} + - name: Restore Compiler Cache + uses: pat-s/always-upload-cache@v3 + with: + path: ${{ env.CCACHE_DIR }} + key: FC-${{ steps.genCacheKey.outputs.cacheKey }}-${{ github.ref }}-${{ github.run_id }} + restore-keys: | + FC-${{ steps.genCacheKey.outputs.cacheKey }}-${{ github.ref }}- + FC-${{ steps.genCacheKey.outputs.cacheKey }}- + - name: Print CCache statistics before build, reset stats and print config + run: | + ccache -s + ccache -z + ccache -p + - name: CMake Configure + uses: ./.github/workflows/actions/linux/configure + with: + extraParameters: --preset conda-linux-release -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/.conda/freecad/opt/freecad + builddir: ${{ env.builddir }} + logFile: ${{ env.logdir }}Cmake.log + errorFile: ${{ env.logdir }}CmakeErrors.log + reportFile: ${{env.reportdir}}${{ env.reportfilename }} + - name: CMake Build + uses: ./.github/workflows/actions/linux/build + with: + builddir: ${{ env.builddir }} + logFile: ${{ env.logdir }}Build.log + errorFile: ${{ env.logdir }}BuildErrors.log + reportFile: ${{env.reportdir}}${{ env.reportfilename }} + - name: Print ccache statistics after Build + run: | + ccache -s + - name: FreeCAD CLI tests on build dir + if: inputs.testOnBuildDir + timeout-minutes: 10 + uses: ./.github/workflows/actions/runPythonTests + with: + testDescription: "CLI tests on build dir" + testCommand: ${{ env.builddir }}/bin/FreeCADCmd -t 0 + logFile: ${{ env.logdir }}TestCLIBuild.log + reportFile: ${{env.reportdir}}${{ env.reportfilename }} + - name: FreeCAD GUI tests on build dir + if: inputs.testOnBuildDir + timeout-minutes: 15 + uses: ./.github/workflows/actions/runPythonTests + with: + testDescription: "GUI tests on build dir" + testCommand: xvfb-run ${{ env.builddir }}/bin/FreeCAD -t 0 + logFile: ${{ env.logdir }}TestGUIBuild.log + reportFile: ${{env.reportdir}}${{ env.reportfilename }} + - name: C++ tests + timeout-minutes: 1 + uses: ./.github/workflows/actions/runCPPTests/runAllTests + with: + reportdir: ${{ env.reportdir }} + builddir: ${{ env.builddir }} + reportFile: ${{ env.reportdir }}${{ env.reportfilename }} + - name: CMake Install + uses: ./.github/workflows/actions/linux/install + with: + builddir: ${{ env.builddir }} + logFile: ${{ env.logdir }}Install.log + errorFile: ${{ env.logdir }}InstallErrors.log + reportFile: ${{env.reportdir}}${{ env.reportfilename }} + - name: FreeCAD CLI tests on install + timeout-minutes: 10 + uses: ./.github/workflows/actions/runPythonTests + with: + testDescription: "CLI tests on install" + testCommand: ${{ github.workspace }}/.conda/freecad/opt/freecad/bin/FreeCADCmd -t 0 + logFile: ${{ env.logdir }}TestCLIInstall.log + reportFile: ${{env.reportdir}}${{ env.reportfilename }} + - name: FreeCAD GUI tests on install + timeout-minutes: 15 + uses: ./.github/workflows/actions/runPythonTests + with: + testDescription: "GUI tests on install" + testCommand: xvfb-run ${{ github.workspace }}/.conda/freecad/opt/freecad/bin/FreeCAD -t 0 + logFile: ${{ env.logdir }}TestGUIInstall.log + reportFile: ${{env.reportdir}}${{ env.reportfilename }} + - name: Upload logs + if: always() + uses: actions/upload-artifact@v3 + with: + name: ${{ inputs.artifactBasename }}-Logs + path: | + ${{ env.logdir }} + /var/crash/*FreeCAD* + - name: Upload report + if: always() + uses: actions/upload-artifact@v3 + with: + name: ${{ env.reportfilename }} + path: | + ${{env.reportdir}}${{ env.reportfilename }} diff --git a/.github/workflows/sub_buildWindowsConda.yml b/.github/workflows/sub_buildWindowsConda.yml new file mode 100644 index 0000000000..4ce65d27bd --- /dev/null +++ b/.github/workflows/sub_buildWindowsConda.yml @@ -0,0 +1,129 @@ +# *************************************************************************** +# * Copyright (c) 2023 0penBrain * +# * * +# * This program is free software; you can redistribute it and/or modify * +# * it under the terms of the GNU Lesser General Public License (LGPL) * +# * as published by the Free Software Foundation; either version 2 of * +# * the License, or (at your option) any later version. * +# * for detail see the LICENCE text file. * +# * * +# * This program is distributed in the hope that it will be useful, * +# * but WITHOUT ANY WARRANTY; without even the implied warranty of * +# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +# * GNU Library General Public License for more details. * +# * * +# * You should have received a copy of the GNU Library General Public * +# * License along with this program; if not, write to the Free Software * +# * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * +# * USA * +# * * +# *************************************************************************** + +# This is a build and test workflow for CI of FreeCAD. +# This workflow aims at building and testing FreeCAD using a Conda environment on Windows with MSVC. + +name: Build Windows (Conda) +on: + workflow_call: + inputs: + artifactBasename: + type: string + required: true + allowedToFail: + default: false + type: boolean + required: false + outputs: + reportFile: + value: ${{ jobs.Build.outputs.reportFile }} + +jobs: + Build: + runs-on: windows-latest + continue-on-error: ${{ inputs.allowedToFail }} + env: + CCACHE_DIR: C:/FC/cache/ + CCACHE_COMPILERCHECK: "%compiler%" # default:mtime + CCACHE_MAXSIZE: 1G + CCACHE_COMPRESS: true + CCACHE_COMPRESSLEVEL: 1 + CCACHE_NOHASHDIR: true + CCACHE_DIRECT: true + #CCACHE_SLOPPINESS: "pch_defines,time_macros" # Can't get PCH to work on Windows + CCACHE_LOGFILE: C:/logs/ccache.log + ## Have to use C:\ because not enough space on workspace drive + builddir: C:/FC/build/ + logdir: C:/logs/ + reportdir: C:/report/ + reportfilename: ${{ inputs.artifactBasename }}-report.md + outputs: + reportFile: ${{ steps.Init.outputs.reportFile }} + + steps: + - name: Checking out source code + uses: actions/checkout@v3 + with: + submodules: true + - name: Setup Miniconda + uses: conda-incubator/setup-miniconda@v2 + with: + activate-environment: .conda/freecad + environment-file: conda/conda-env.yaml + channels: conda-forge,defaults + channel-priority: true + miniforge-version: latest + - name: Install FreeCAD dependencies + run: | + conda config --add envs_dirs $PWD/.conda + mamba-devenv -f conda/environment.devenv.yml + - name: Make needed directories, files and initializations + id: Init + run: | + mkdir ${{ env.CCACHE_DIR }} + mkdir ${{ env.builddir }} + mkdir ${{ env.logdir }} + mkdir ${{ env.reportdir }} + echo "reportFile=${{ env.reportfilename }}" >> $GITHUB_OUTPUT + - name: Restore compiler cache + uses: pat-s/always-upload-cache@v3 + with: + path: ${{ env.CCACHE_DIR }} + key: FC-Windows-Conda-${{ github.ref }}-${{ github.run_id }} + restore-keys: | + FC-Windows-Conda-${{ github.ref }}- + FC-Windows-Conda- + - name: Print Ccache statistics before build, reset stats and print config + run: | + ccache -s + ccache -z + ccache -p + - name: Configuring CMake + shell: cmd /C CALL {0} + run: > + conda\cmake.cmd --preset conda-windows-release -DFREECAD_USE_PCH:BOOL=OFF -DFREECAD_RELEASE_PDB:BOOL=OFF -DFREECAD_USE_CCACHE:BOOL=ON + - name: Compiling sources + shell: cmd /C CALL {0} + run: > + conda\cmake.cmd --build build\release + - name: Print Ccache statistics after build + run: | + ccache -s + - name: CMake Install + shell: cmd /C CALL {0} + run: | + conda\cmake.cmd --install build\release + - name: C++ unit tests + if: false # Disabled because seems to not exist on Windows build + timeout-minutes: 1 + run: | + . build\release\test\Tests_run --gtest_output=json:${{ env.reportdir }}gtest_results.json # 2>&1 | tee -filepath ${{ env.logdir }}/unitTests.log + - name: FreeCAD CLI tests + run: | + . build\release\bin\FreeCADCmd -t 0 # 2>&1 | tee -filepath ${{ env.logdir }}/integrationTests.log + - name: Upload logs + if: always() + uses: actions/upload-artifact@v3 + with: + name: ${{ inputs.artifactBasename }}-Logs + path: | + ${{ env.logdir }} From 4c596a64ecbeb9fac38d8fb11f55c5da633904ed Mon Sep 17 00:00:00 2001 From: Jacob Oursland Date: Thu, 30 Nov 2023 18:38:15 -0700 Subject: [PATCH 09/13] CI: Add macOS. --- .github/workflows/CI_master.yml | 15 ++ .../workflows/actions/macos/build/action.yml | 73 ++++++++ .../actions/macos/configure/action.yml | 78 ++++++++ .../actions/macos/generateCacheKey/action.yml | 44 +++++ .../actions/macos/install/action.yml | 73 ++++++++ .../runCPPTests/runSingleTest/action.yml | 2 +- .../actions/runPythonTests/action.yml | 2 +- .../workflows/sub_buildMacOSCondaApple.yml | 166 ++++++++++++++++++ .../workflows/sub_buildMacOSCondaIntel.yml | 166 ++++++++++++++++++ 9 files changed, 617 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/actions/macos/build/action.yml create mode 100644 .github/workflows/actions/macos/configure/action.yml create mode 100644 .github/workflows/actions/macos/generateCacheKey/action.yml create mode 100644 .github/workflows/actions/macos/install/action.yml create mode 100644 .github/workflows/sub_buildMacOSCondaApple.yml create mode 100644 .github/workflows/sub_buildMacOSCondaIntel.yml diff --git a/.github/workflows/CI_master.yml b/.github/workflows/CI_master.yml index 1de7510563..44b40ede93 100644 --- a/.github/workflows/CI_master.yml +++ b/.github/workflows/CI_master.yml @@ -39,6 +39,19 @@ jobs: with: artifactBasename: Prepare-${{ github.run_id }} + # GA in Jan-Mar 2024 Timeframe: https://github.com/actions/runner-images/issues/8439#issuecomment-1755601587 + # MacOS_13_Conda_Apple: + # needs: [Prepare] + # uses: ./.github/workflows/sub_buildMacOSCondaApple.yml + # with: + # artifactBasename: MacOS_13_Conda_Apple-${{ github.run_id }} + + MacOS_13_Conda_Intel: + needs: [Prepare] + uses: ./.github/workflows/sub_buildMacOSCondaIntel.yml + with: + artifactBasename: MacOS_13_Conda_Intel-${{ github.run_id }} + Ubuntu_20-04: needs: [Prepare] uses: ./.github/workflows/sub_buildUbuntu2004.yml @@ -75,6 +88,8 @@ jobs: WrapUp: needs: [ Prepare, + # MacOS_13_Conda_Apple, + MacOS_13_Conda_Intel, Ubuntu_20-04, Ubuntu_22-04_Conda, Windows, diff --git a/.github/workflows/actions/macos/build/action.yml b/.github/workflows/actions/macos/build/action.yml new file mode 100644 index 0000000000..0eee7f15e3 --- /dev/null +++ b/.github/workflows/actions/macos/build/action.yml @@ -0,0 +1,73 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +# *************************************************************************** +# * * +# * Copyright (c) 2023 0penBrain. * +# * * +# * This file is part of FreeCAD. * +# * * +# * FreeCAD is free software: you can redistribute it and/or modify it * +# * under the terms of the GNU Lesser General Public License as * +# * published by the Free Software Foundation, either version 2.1 of the * +# * License, or (at your option) any later version. * +# * * +# * FreeCAD is distributed in the hope that it will be useful, but * +# * WITHOUT ANY WARRANTY; without even the implied warranty of * +# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * +# * Lesser General Public License for more details. * +# * * +# * You should have received a copy of the GNU Lesser General Public * +# * License along with FreeCAD. If not, see * +# * . * +# * * +# *************************************************************************** + +name: build +description: "macOS: build application" + +inputs: + builddir: + description: "Directory where build will happen" + required: true + logFile: + description: "Path for log file" + required: true + errorFile: + description: "Path to error file" + required: true + reportFile: + description: "Path for report file" + required: true + extraParameters: + description: "Extra parameters to CMake build" + required: false + +runs: + using: "composite" + steps: + - name: Build + id: build + shell: bash -l {0} + run: | + (cmake --build ${{ inputs.builddir }} -j$(nproc) ${{ inputs.extraParameters }}) \ + 2> >(tee -a ${{ inputs.errorFile }}) | tee -a ${{ inputs.logFile }} + - name: Write report + shell: bash -l {0} + if: always() + run: | + if [ ${{ steps.build.outcome }} == 'success' ] + then + echo "
:heavy_check_mark: CMake build succeeded" >> ${{ inputs.reportFile }} + else + echo "
:fire: CMake build failed" >> ${{ inputs.reportFile }} + fi + echo "" >> ${{ inputs.reportFile }} + echo "Build Error Log (stderr output):" >> ${{ inputs.reportFile }} + echo '```' >> ${{ inputs.reportFile }} + cat ${{ inputs.errorFile }} >> ${{ inputs.reportFile }} + echo '```' >> ${{ inputs.reportFile }} + echo "Build Log (only built targets reported):" >> ${{ inputs.reportFile }} + echo '```' >> ${{ inputs.reportFile }} + cat ${{ inputs.logFile }} | sed -ne "/Built target/p" >> ${{ inputs.reportFile }} + echo '```' >> ${{ inputs.reportFile }} + echo "
">> ${{ inputs.reportFile }} + echo "" >> ${{ inputs.reportFile }} diff --git a/.github/workflows/actions/macos/configure/action.yml b/.github/workflows/actions/macos/configure/action.yml new file mode 100644 index 0000000000..89a83d6340 --- /dev/null +++ b/.github/workflows/actions/macos/configure/action.yml @@ -0,0 +1,78 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +# *************************************************************************** +# * * +# * Copyright (c) 2023 0penBrain. * +# * * +# * This file is part of FreeCAD. * +# * * +# * FreeCAD is free software: you can redistribute it and/or modify it * +# * under the terms of the GNU Lesser General Public License as * +# * published by the Free Software Foundation, either version 2.1 of the * +# * License, or (at your option) any later version. * +# * * +# * FreeCAD is distributed in the hope that it will be useful, but * +# * WITHOUT ANY WARRANTY; without even the implied warranty of * +# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * +# * Lesser General Public License for more details. * +# * * +# * You should have received a copy of the GNU Lesser General Public * +# * License along with FreeCAD. If not, see * +# * . * +# * * +# *************************************************************************** + +name: configure +description: "macOS: configure CMake" + +inputs: + sourcedir: + description: "Directory where sources are stored" + required: false + default: ./ + builddir: + description: "Directory where build will happen" + required: true + logFile: + description: "Path for log file" + required: true + errorFile: + description: "Path to error file" + required: true + reportFile: + description: "Path for report file" + required: true + extraParameters: + description: "Extra parameters to CMake configure" + required: false + +runs: + using: "composite" + steps: + - name: Configure CMake + id: configure + shell: bash -l {0} + run: | + (cmake -S ${{ inputs.sourcedir }} -B ${{ inputs.builddir }} -D CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE ${{inputs.extraParameters }}) \ + 2> >(tee -a ${{ inputs.errorFile }}) | tee -a ${{ inputs.logFile }} + - name: Write report + shell: bash -l {0} + if: always() + run: | + if [ ${{ steps.configure.outcome }} == 'success' ] + then + echo "
:heavy_check_mark: CMake configure succeeded" >> ${{ inputs.reportFile }} + echo "" >> ${{ inputs.reportFile }} + echo "Configure Error Log (stderr output):" >> ${{ inputs.reportFile }} + echo '```' >> ${{ inputs.reportFile }} + cat ${{ inputs.errorFile }} >> ${{ inputs.reportFile }} + echo '```' >> ${{ inputs.reportFile }} + else + echo "
:fire: CMake configure failed" >> ${{ inputs.reportFile }} + fi + echo "" >> ${{ inputs.reportFile }} + echo "Configure Log (only final configuration values reported):" >> ${{ inputs.reportFile }} + echo '```' >> ${{ inputs.reportFile }} + cat ${{ inputs.logFile }} | sed -ne "/^ *==/,/^====/p" >> ${{ inputs.reportFile }} + echo '```' >> ${{ inputs.reportFile }} + echo "
">> ${{ inputs.reportFile }} + echo "" >> ${{ inputs.reportFile }} diff --git a/.github/workflows/actions/macos/generateCacheKey/action.yml b/.github/workflows/actions/macos/generateCacheKey/action.yml new file mode 100644 index 0000000000..ca444f739f --- /dev/null +++ b/.github/workflows/actions/macos/generateCacheKey/action.yml @@ -0,0 +1,44 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +# *************************************************************************** +# * * +# * Copyright (c) 2023 0penBrain. * +# * * +# * This file is part of FreeCAD. * +# * * +# * FreeCAD is free software: you can redistribute it and/or modify it * +# * under the terms of the GNU Lesser General Public License as * +# * published by the Free Software Foundation, either version 2.1 of the * +# * License, or (at your option) any later version. * +# * * +# * FreeCAD is distributed in the hope that it will be useful, but * +# * WITHOUT ANY WARRANTY; without even the implied warranty of * +# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * +# * Lesser General Public License for more details. * +# * * +# * You should have received a copy of the GNU Lesser General Public * +# * License along with FreeCAD. If not, see * +# * . * +# * * +# *************************************************************************** + +name: generateCacheKey +description: "macOS: generates a cache key taking into account distro and compiler" + +inputs: + compiler: + description: "Binary name/path of compiler to be used" + required: true +outputs: + cacheKey: + description: "Cache key with distro and compiler version" + value: ${{ steps.generateCacheKey.outputs.cacheKey }} + +runs: + using: "composite" + steps: + - id: generateCacheKey + shell: bash -l {0} + run: | + cacheKey=$(sw_vers --productName)-$(sw_vers --productVersion)-$(basename ${{ inputs.compiler }})$(${{ inputs.compiler }} -dumpfullversion -dumpversion) + echo "Generated cache key : $cacheKey" + echo "cacheKey=$cacheKey" >> $GITHUB_OUTPUT diff --git a/.github/workflows/actions/macos/install/action.yml b/.github/workflows/actions/macos/install/action.yml new file mode 100644 index 0000000000..1b513b9fdb --- /dev/null +++ b/.github/workflows/actions/macos/install/action.yml @@ -0,0 +1,73 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +# *************************************************************************** +# * * +# * Copyright (c) 2023 0penBrain. * +# * * +# * This file is part of FreeCAD. * +# * * +# * FreeCAD is free software: you can redistribute it and/or modify it * +# * under the terms of the GNU Lesser General Public License as * +# * published by the Free Software Foundation, either version 2.1 of the * +# * License, or (at your option) any later version. * +# * * +# * FreeCAD is distributed in the hope that it will be useful, but * +# * WITHOUT ANY WARRANTY; without even the implied warranty of * +# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * +# * Lesser General Public License for more details. * +# * * +# * You should have received a copy of the GNU Lesser General Public * +# * License along with FreeCAD. If not, see * +# * . * +# * * +# *************************************************************************** + +name: install +description: "macOS: install application" + +inputs: + builddir: + description: "Directory where build is stored" + required: true + logFile: + description: "Path for log file" + required: true + errorFile: + description: "Path to error file" + required: true + reportFile: + description: "Path for report file" + required: true + extraParameters: + description: "Extra parameters to CMake install" + required: false + +runs: + using: "composite" + steps: + - name: Install + id: install + shell: bash -l {0} + run: | + (sudo cmake --install ${{ inputs.builddir }} ${{ inputs.extraParameters }}) \ + 2> >(tee -a ${{ inputs.errorFile }}) | tee -a ${{ inputs.logFile }} + - name: Write report + shell: bash -l {0} + if: always() + run: | + if [ ${{ steps.install.outcome }} == 'success' ] + then + echo "
:heavy_check_mark: CMake install succeeded" >> ${{ inputs.reportFile }} + else + echo "
:fire: CMake install failed" >> ${{ inputs.reportFile }} + fi + echo "" >> ${{ inputs.reportFile }} + echo "Install Error Log (stderr output):" >> ${{ inputs.reportFile }} + echo '```' >> ${{ inputs.reportFile }} + cat ${{ inputs.errorFile }} >> ${{ inputs.reportFile }} + echo '```' >> ${{ inputs.reportFile }} + echo "Install Error Log (stdout output trimmed to the last 100 Lines):" >> ${{ inputs.reportFile }} + echo '```' >> ${{ inputs.reportFile }} + tail -n 100 ${{ inputs.logFile }} >> ${{ inputs.reportFile }} + echo '```' >> ${{ inputs.reportFile }} + echo "
">> ${{ inputs.reportFile }} + echo "" >> ${{ inputs.reportFile }} diff --git a/.github/workflows/actions/runCPPTests/runSingleTest/action.yml b/.github/workflows/actions/runCPPTests/runSingleTest/action.yml index b99c01466a..3b1736c612 100644 --- a/.github/workflows/actions/runCPPTests/runSingleTest/action.yml +++ b/.github/workflows/actions/runCPPTests/runSingleTest/action.yml @@ -45,7 +45,7 @@ runs: steps: - name: Run C++ tests shell: bash -l {0} - run: stdbuf -oL -eL ${{ inputs.testCommand }} |& tee -a ${{ inputs.testLogFile }} + run: ${{ inputs.testCommand }} | tee -a ${{ inputs.testLogFile }} - name: Parse test results if: always() id: report diff --git a/.github/workflows/actions/runPythonTests/action.yml b/.github/workflows/actions/runPythonTests/action.yml index 26b362d2bb..dca94e48fe 100644 --- a/.github/workflows/actions/runPythonTests/action.yml +++ b/.github/workflows/actions/runPythonTests/action.yml @@ -45,7 +45,7 @@ runs: id: runTests shell: bash -l {0} run: | - stdbuf -oL -eL ${{ inputs.testCommand }} |& sed -Ee "/[[:blank:]]*\([[:digit:]]{1,3} %\)[[:blank:]]*/d" | tee -a ${{ inputs.logFile }} + ${{ inputs.testCommand }} | sed -Ee "/[[:blank:]]*\([[:digit:]]{1,3} %\)[[:blank:]]*/d" | tee -a ${{ inputs.logFile }} - name: Write report shell: bash -l {0} if: always() diff --git a/.github/workflows/sub_buildMacOSCondaApple.yml b/.github/workflows/sub_buildMacOSCondaApple.yml new file mode 100644 index 0000000000..3a7a8ebb0e --- /dev/null +++ b/.github/workflows/sub_buildMacOSCondaApple.yml @@ -0,0 +1,166 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +# *************************************************************************** +# * * +# * Copyright (c) 2023 0penBrain. * +# * * +# * This file is part of FreeCAD. * +# * * +# * FreeCAD is free software: you can redistribute it and/or modify it * +# * under the terms of the GNU Lesser General Public License as * +# * published by the Free Software Foundation, either version 2.1 of the * +# * License, or (at your option) any later version. * +# * * +# * FreeCAD is distributed in the hope that it will be useful, but * +# * WITHOUT ANY WARRANTY; without even the implied warranty of * +# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * +# * Lesser General Public License for more details. * +# * * +# * You should have received a copy of the GNU Lesser General Public * +# * License along with FreeCAD. If not, see * +# * . * +# * * +# *************************************************************************** + +# This is a build and test workflow for CI of FreeCAD. +# This workflow aims at building and testing FreeCAD on a Conda environment on macOS. + +name: Build macOS 13 (Apple Silicon) +on: + workflow_call: + inputs: + artifactBasename: + type: string + required: true + testOnBuildDir: + default: false + type: boolean + required: false + allowedToFail: + default: false + type: boolean + required: false + outputs: + reportFile: + value: ${{ jobs.Build.outputs.reportFile }} + +jobs: + Build: + runs-on: macos-13-xlarge + continue-on-error: ${{ inputs.allowedToFail }} + env: + CCACHE_DIR: ${{ github.workspace }}/ccache + CCACHE_CONFIGPATH: ${{ github.workspace }}/ccache/config + CCACHE_MAXSIZE: 1G + CCACHE_COMPILERCHECK: "%compiler% -dumpfullversion -dumpversion" # default:mtime + CCACHE_COMPRESS: true + CCACHE_COMPRESSLEVEL: 1 + CC: arm64-apple-darwin20.0.0-clang + CXX: arm64-apple-darwin20.0.0-clang++ + builddir: ${{ github.workspace }}/build/release/ + logdir: /tmp/logs/ + reportdir: /tmp/report/ + reportfilename: ${{ inputs.artifactBasename }}-report.md + defaults: + run: + shell: bash -l {0} + outputs: + reportFile: ${{ steps.Init.outputs.reportFile }} + + steps: + - name: Checking out source code + uses: actions/checkout@v3 + with: + submodules: true + - name: Setup Miniconda + uses: conda-incubator/setup-miniconda@v2 + with: + activate-environment: .conda/freecad + environment-file: conda/conda-env.yaml + channels: conda-forge,defaults + channel-priority: true + miniforge-version: latest + - name: Install FreeCAD dependencies + run: | + ./conda/setup-environment.sh + - name: Set Environment Variables + run: | + echo "CC=$CC" >> "$GITHUB_ENV" + echo "CXX=$CXX" >> "$GITHUB_ENV" + - name: Make needed directories, files and initializations + id: Init + run: | + mkdir -p ${{ env.CCACHE_DIR }} + mkdir -p ${{ env.CCACHE_CONFIGPATH }} + mkdir -p ${{ env.builddir }} + mkdir -p ${{ env.logdir }} + mkdir -p ${{ env.reportdir }} + echo "reportFile=${{ env.reportfilename }}" >> $GITHUB_OUTPUT + - name: Generate cache key + id: genCacheKey + uses: ./.github/workflows/actions/macos/generateCacheKey + with: + compiler: ${{ env.CXX }} + - name: Restore Compiler Cache + uses: pat-s/always-upload-cache@v3 + with: + path: ${{ env.CCACHE_DIR }} + key: FC-${{ steps.genCacheKey.outputs.cacheKey }}-${{ github.ref }}-${{ github.run_id }} + restore-keys: | + FC-${{ steps.genCacheKey.outputs.cacheKey }}-${{ github.ref }}- + FC-${{ steps.genCacheKey.outputs.cacheKey }}- + - name: Print CCache statistics before build, reset stats and print config + run: | + ccache -s + ccache -z + ccache -p + - name: CMake Configure + run: | + mamba run --live-stream -p .conda/freecad cmake --preset conda-macos-release -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/.conda/freecad/opt/freecad + - name: CMake Build + run: | + mamba run --live-stream -p .conda/freecad cmake --build build/release + - name: Print ccache statistics after Build + run: | + ccache -s + - name: FreeCAD CLI tests on build dir + if: inputs.testOnBuildDir + timeout-minutes: 10 + uses: ./.github/workflows/actions/runPythonTests + with: + testDescription: "CLI tests on build dir" + testCommand: ${{ env.builddir }}/bin/FreeCADCmd -t 0 + logFile: ${{ env.logdir }}TestCLIBuild.log + reportFile: ${{env.reportdir}}${{ env.reportfilename }} + - name: C++ tests + timeout-minutes: 1 + uses: ./.github/workflows/actions/runCPPTests/runAllTests + with: + reportdir: ${{ env.reportdir }} + builddir: ${{ env.builddir }} + reportFile: ${{ env.reportdir }}${{ env.reportfilename }} + - name: CMake Install + run: | + mamba run --live-stream -p .conda/freecad cmake --install build/release + - name: FreeCAD CLI tests on install + timeout-minutes: 10 + uses: ./.github/workflows/actions/runPythonTests + with: + testDescription: "CLI tests on install" + testCommand: ${{ github.workspace }}/.conda/freecad/opt/freecad/bin/FreeCADCmd -t 0 + logFile: ${{ env.logdir }}TestCLIInstall.log + reportFile: ${{env.reportdir}}${{ env.reportfilename }} + - name: Upload logs + if: always() + uses: actions/upload-artifact@v3 + with: + name: ${{ inputs.artifactBasename }}-Logs + path: | + ${{ env.logdir }} + /var/crash/*FreeCAD* + - name: Upload report + if: always() + uses: actions/upload-artifact@v3 + with: + name: ${{ env.reportfilename }} + path: | + ${{env.reportdir}}${{ env.reportfilename }} diff --git a/.github/workflows/sub_buildMacOSCondaIntel.yml b/.github/workflows/sub_buildMacOSCondaIntel.yml new file mode 100644 index 0000000000..b6f497428e --- /dev/null +++ b/.github/workflows/sub_buildMacOSCondaIntel.yml @@ -0,0 +1,166 @@ +# SPDX-License-Identifier: LGPL-2.1-or-later +# *************************************************************************** +# * * +# * Copyright (c) 2023 0penBrain. * +# * * +# * This file is part of FreeCAD. * +# * * +# * FreeCAD is free software: you can redistribute it and/or modify it * +# * under the terms of the GNU Lesser General Public License as * +# * published by the Free Software Foundation, either version 2.1 of the * +# * License, or (at your option) any later version. * +# * * +# * FreeCAD is distributed in the hope that it will be useful, but * +# * WITHOUT ANY WARRANTY; without even the implied warranty of * +# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * +# * Lesser General Public License for more details. * +# * * +# * You should have received a copy of the GNU Lesser General Public * +# * License along with FreeCAD. If not, see * +# * . * +# * * +# *************************************************************************** + +# This is a build and test workflow for CI of FreeCAD. +# This workflow aims at building and testing FreeCAD on a Conda environment on macOS. + +name: Build macOS 13 (Intel) +on: + workflow_call: + inputs: + artifactBasename: + type: string + required: true + testOnBuildDir: + default: false + type: boolean + required: false + allowedToFail: + default: false + type: boolean + required: false + outputs: + reportFile: + value: ${{ jobs.Build.outputs.reportFile }} + +jobs: + Build: + runs-on: macos-13 + continue-on-error: ${{ inputs.allowedToFail }} + env: + CCACHE_DIR: ${{ github.workspace }}/ccache + CCACHE_CONFIGPATH: ${{ github.workspace }}/ccache/config + CCACHE_MAXSIZE: 1G + CCACHE_COMPILERCHECK: "%compiler% -dumpfullversion -dumpversion" # default:mtime + CCACHE_COMPRESS: true + CCACHE_COMPRESSLEVEL: 1 + CC: x86_64-apple-darwin13.4.0-clang + CXX: x86_64-apple-darwin13.4.0-clang++ + builddir: ${{ github.workspace }}/build/release/ + logdir: /tmp/logs/ + reportdir: /tmp/report/ + reportfilename: ${{ inputs.artifactBasename }}-report.md + defaults: + run: + shell: bash -l {0} + outputs: + reportFile: ${{ steps.Init.outputs.reportFile }} + + steps: + - name: Checking out source code + uses: actions/checkout@v3 + with: + submodules: true + - name: Setup Miniconda + uses: conda-incubator/setup-miniconda@v2 + with: + activate-environment: .conda/freecad + environment-file: conda/conda-env.yaml + channels: conda-forge,defaults + channel-priority: true + miniforge-version: latest + - name: Install FreeCAD dependencies + run: | + ./conda/setup-environment.sh + - name: Set Environment Variables + run: | + echo "CC=$CC" >> "$GITHUB_ENV" + echo "CXX=$CXX" >> "$GITHUB_ENV" + - name: Make needed directories, files and initializations + id: Init + run: | + mkdir -p ${{ env.CCACHE_DIR }} + mkdir -p ${{ env.CCACHE_CONFIGPATH }} + mkdir -p ${{ env.builddir }} + mkdir -p ${{ env.logdir }} + mkdir -p ${{ env.reportdir }} + echo "reportFile=${{ env.reportfilename }}" >> $GITHUB_OUTPUT + - name: Generate cache key + id: genCacheKey + uses: ./.github/workflows/actions/macos/generateCacheKey + with: + compiler: ${{ env.CXX }} + - name: Restore Compiler Cache + uses: pat-s/always-upload-cache@v3 + with: + path: ${{ env.CCACHE_DIR }} + key: FC-${{ steps.genCacheKey.outputs.cacheKey }}-${{ github.ref }}-${{ github.run_id }} + restore-keys: | + FC-${{ steps.genCacheKey.outputs.cacheKey }}-${{ github.ref }}- + FC-${{ steps.genCacheKey.outputs.cacheKey }}- + - name: Print CCache statistics before build, reset stats and print config + run: | + ccache -s + ccache -z + ccache -p + - name: CMake Configure + run: | + mamba run --live-stream -p .conda/freecad cmake --preset conda-macos-release -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/.conda/freecad/opt/freecad + - name: CMake Build + run: | + mamba run --live-stream -p .conda/freecad cmake --build build/release + - name: Print ccache statistics after Build + run: | + ccache -s + - name: FreeCAD CLI tests on build dir + if: inputs.testOnBuildDir + timeout-minutes: 10 + uses: ./.github/workflows/actions/runPythonTests + with: + testDescription: "CLI tests on build dir" + testCommand: ${{ env.builddir }}/bin/FreeCADCmd -t 0 + logFile: ${{ env.logdir }}TestCLIBuild.log + reportFile: ${{env.reportdir}}${{ env.reportfilename }} + - name: C++ tests + timeout-minutes: 1 + uses: ./.github/workflows/actions/runCPPTests/runAllTests + with: + reportdir: ${{ env.reportdir }} + builddir: ${{ env.builddir }} + reportFile: ${{ env.reportdir }}${{ env.reportfilename }} + - name: CMake Install + run: | + mamba run --live-stream -p .conda/freecad cmake --install build/release + - name: FreeCAD CLI tests on install + timeout-minutes: 10 + uses: ./.github/workflows/actions/runPythonTests + with: + testDescription: "CLI tests on install" + testCommand: ${{ github.workspace }}/.conda/freecad/opt/freecad/bin/FreeCADCmd -t 0 + logFile: ${{ env.logdir }}TestCLIInstall.log + reportFile: ${{env.reportdir}}${{ env.reportfilename }} + - name: Upload logs + if: always() + uses: actions/upload-artifact@v3 + with: + name: ${{ inputs.artifactBasename }}-Logs + path: | + ${{ env.logdir }} + /var/crash/*FreeCAD* + - name: Upload report + if: always() + uses: actions/upload-artifact@v3 + with: + name: ${{ env.reportfilename }} + path: | + ${{env.reportdir}}${{ env.reportfilename }} From 23955bf6bb92d2dc10c815cb00fdec5fad582f26 Mon Sep 17 00:00:00 2001 From: Jacob Oursland Date: Fri, 1 Dec 2023 12:46:13 -0700 Subject: [PATCH 10/13] CI: Enable C++ unit tests on Windows on Conda. --- .github/workflows/sub_buildWindows.yml | 4 ++-- .github/workflows/sub_buildWindowsConda.yml | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/sub_buildWindows.yml b/.github/workflows/sub_buildWindows.yml index e899d3c7a1..03e700d6e4 100644 --- a/.github/workflows/sub_buildWindows.yml +++ b/.github/workflows/sub_buildWindows.yml @@ -133,10 +133,10 @@ jobs: run: | Move-Item -Force -Path ${{ env.libpackdir }}bin -Destination ${{ env.builddir }} - name: C++ unit tests - if: false # Disabled because seems to not exist on Windows build + if: false # Disabled because seems to not function on Windows build timeout-minutes: 1 run: | - . ${{ env.builddir }}\test\Tests_run --gtest_output=json:${{ env.reportdir }}gtest_results.json # 2>&1 | tee -filepath ${{ env.logdir }}\unitTests.log + . ${{ env.builddir }}\tests\Release\Tests_run --gtest_output=json:${{ env.reportdir }}gtest_results.json # 2>&1 | tee -filepath ${{ env.logdir }}\unitTests.log - name: FreeCAD CLI tests run: | . ${{ env.builddir }}\bin\FreeCADCmd -t 0 # 2>&1 | tee -filepath ${{ env.logdir }}\integrationTests.log diff --git a/.github/workflows/sub_buildWindowsConda.yml b/.github/workflows/sub_buildWindowsConda.yml index 4ce65d27bd..d2c0bde34c 100644 --- a/.github/workflows/sub_buildWindowsConda.yml +++ b/.github/workflows/sub_buildWindowsConda.yml @@ -113,10 +113,9 @@ jobs: run: | conda\cmake.cmd --install build\release - name: C++ unit tests - if: false # Disabled because seems to not exist on Windows build timeout-minutes: 1 run: | - . build\release\test\Tests_run --gtest_output=json:${{ env.reportdir }}gtest_results.json # 2>&1 | tee -filepath ${{ env.logdir }}/unitTests.log + . build\release\tests\Tests_run --gtest_output=json:${{ env.reportdir }}gtest_results.json # 2>&1 | tee -filepath ${{ env.logdir }}/unitTests.log - name: FreeCAD CLI tests run: | . build\release\bin\FreeCADCmd -t 0 # 2>&1 | tee -filepath ${{ env.logdir }}/integrationTests.log From 6501e17461899fc51dd41fc1c8c8c5f4e46e23a2 Mon Sep 17 00:00:00 2001 From: Jacob Oursland Date: Fri, 1 Dec 2023 13:09:45 -0700 Subject: [PATCH 11/13] CI: Reorder Ubuntu 20.04 packages in alphabetical order. --- .github/workflows/sub_buildUbuntu2004.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sub_buildUbuntu2004.yml b/.github/workflows/sub_buildUbuntu2004.yml index 7bc91f38e2..01a1f8984c 100644 --- a/.github/workflows/sub_buildUbuntu2004.yml +++ b/.github/workflows/sub_buildUbuntu2004.yml @@ -79,6 +79,7 @@ jobs: run: | sudo apt-get update -qq sudo apt-get install -y --no-install-recommends \ + ccache \ doxygen \ graphviz \ imagemagick \ @@ -131,17 +132,16 @@ jobs: python3-pyside2.qtgui \ python3-pyside2.qtnetwork \ python3-pyside2.qtsvg \ + python3-pyside2.qtwebchannel \ python3-pyside2.qtwebengine \ python3-pyside2.qtwebenginecore \ python3-pyside2.qtwebenginewidgets \ - python3-pyside2.qtwebchannel \ python3-pyside2.qtwidgets \ qtbase5-dev \ qttools5-dev \ qtwebengine5-dev \ shiboken2 \ swig \ - ccache \ xvfb - name: Make needed directories, files and initializations id: Init From 1304f48fd6a3635b628e93d6dcb08eeec13ad069 Mon Sep 17 00:00:00 2001 From: Jacob Oursland Date: Fri, 1 Dec 2023 14:12:23 -0700 Subject: [PATCH 12/13] CI: Use Ninja build on Ubuntu 20.04. --- .github/workflows/sub_buildUbuntu2004.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sub_buildUbuntu2004.yml b/.github/workflows/sub_buildUbuntu2004.yml index 01a1f8984c..772ea1c35d 100644 --- a/.github/workflows/sub_buildUbuntu2004.yml +++ b/.github/workflows/sub_buildUbuntu2004.yml @@ -118,6 +118,7 @@ jobs: libzipios++-dev \ netgen \ netgen-headers \ + ninja-build \ occt-draw \ pyqt5-dev-tools \ pyside2-tools \ @@ -173,7 +174,7 @@ jobs: - name: CMake Configure uses: ./.github/workflows/actions/linux/configure with: - extraParameters: --preset release + extraParameters: -G Ninja --preset release builddir: ${{ env.builddir }} logFile: ${{ env.logdir }}Cmake.log errorFile: ${{ env.logdir }}CmakeErrors.log From f6465f5c1f55d8448ff9471b7be659256e2a8ac3 Mon Sep 17 00:00:00 2001 From: Jacob Oursland Date: Sun, 3 Dec 2023 22:07:32 -0700 Subject: [PATCH 13/13] CMake: permit ccache with conda. --- CMakeLists.txt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e800f9d917..e161c3d529 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,11 +10,7 @@ if (POLICY CMP0072) set(OpenGL_GL_PREFERENCE LEGACY) endif(POLICY CMP0072) -if (BUILD_WITH_CONDA AND WIN32) - option(FREECAD_USE_CCACHE "Auto detect and use ccache during compilation" OFF) -else() - option(FREECAD_USE_CCACHE "Auto detect and use ccache during compilation" ON) -endif() +option(FREECAD_USE_CCACHE "Auto detect and use ccache during compilation" ON) if(FREECAD_USE_CCACHE) find_program(CCACHE_PROGRAM ccache) #This check should occur before project()