From 6a3385f125e0e20e98419fba0d5cdadd3ca74103 Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Mon, 25 Nov 2024 20:22:45 +0000 Subject: [PATCH 01/20] Install boost --- .../reusable-ros-tooling-win-build.yml | 25 +++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/.github/workflows/reusable-ros-tooling-win-build.yml b/.github/workflows/reusable-ros-tooling-win-build.yml index 22a884f..2e54d5c 100644 --- a/.github/workflows/reusable-ros-tooling-win-build.yml +++ b/.github/workflows/reusable-ros-tooling-win-build.yml @@ -45,6 +45,19 @@ jobs: required-ros-distributions: ${{ inputs.ros_distro }} use-ros2-testing: true + - name: Install boost + uses: MarkusJx/install-boost@v2.4.5 + id: install-boost + with: + # REQUIRED: Specify the required boost version + # A list of supported versions can be found here: + # https://github.com/MarkusJx/prebuilt-boost/blob/main/versions-manifest.json + boost_version: 1.86.0 + # OPTIONAL: Specify a platform version + platform_version: 2019 + # OPTIONAL: Specify a toolset + toolset: msvc + - name: Checkout default ref when build is not scheduled if: ${{ github.event_name != 'schedule' }} uses: actions/checkout@v4 @@ -73,11 +86,9 @@ jobs: "repo_file=" | Out-File -FilePath $Env:GITHUB_OUTPUT -Append } - - uses: actions/setup-python@v5 - with: - python-version: '3.8' - - uses: ros-tooling/action-ros-ci@0.3.15 + env: + BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }} with: target-ros2-distro: ${{ inputs.ros_distro }} package-name: ${{ steps.package_list_action.outputs.package_list }} @@ -86,9 +97,9 @@ jobs: colcon-mixin-repository: https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml colcon-defaults: | { - "test": { - "executor": "sequential" - } + "test": { + "executor": "sequential" + } } id: action-ros From cc163ad0352df79c8c55d4c3f9e74d7e80561a25 Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Mon, 25 Nov 2024 20:24:01 +0000 Subject: [PATCH 02/20] Is BOOST_ROOT necessary? --- .github/workflows/reusable-ros-tooling-win-build.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/reusable-ros-tooling-win-build.yml b/.github/workflows/reusable-ros-tooling-win-build.yml index 2e54d5c..e10f4bb 100644 --- a/.github/workflows/reusable-ros-tooling-win-build.yml +++ b/.github/workflows/reusable-ros-tooling-win-build.yml @@ -87,8 +87,6 @@ jobs: } - uses: ros-tooling/action-ros-ci@0.3.15 - env: - BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }} with: target-ros2-distro: ${{ inputs.ros_distro }} package-name: ${{ steps.package_list_action.outputs.package_list }} From 03bdac5a793d09a6c2e7ca6baa09f18c05e5e700 Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Mon, 25 Nov 2024 20:24:39 +0000 Subject: [PATCH 03/20] Make boost optional --- .github/workflows/reusable-ros-tooling-win-build.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/reusable-ros-tooling-win-build.yml b/.github/workflows/reusable-ros-tooling-win-build.yml index e10f4bb..9b6f0bd 100644 --- a/.github/workflows/reusable-ros-tooling-win-build.yml +++ b/.github/workflows/reusable-ros-tooling-win-build.yml @@ -24,6 +24,11 @@ on: required: false default: '' type: string + install_boost: + description: 'Install boost for the build' + required: false + default: false + type: boolean jobs: reusable_ros_tooling_source_build: @@ -47,6 +52,7 @@ jobs: - name: Install boost uses: MarkusJx/install-boost@v2.4.5 + if: ${{ inputs.install_boost }} id: install-boost with: # REQUIRED: Specify the required boost version From 78073520eb2fcd78eb0703158d87d5888c3ec9f0 Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Mon, 25 Nov 2024 22:02:42 +0000 Subject: [PATCH 04/20] Revert "Is BOOST_ROOT necessary?" This reverts commit cc163ad0352df79c8c55d4c3f9e74d7e80561a25. --- .github/workflows/reusable-ros-tooling-win-build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/reusable-ros-tooling-win-build.yml b/.github/workflows/reusable-ros-tooling-win-build.yml index 9b6f0bd..6e79057 100644 --- a/.github/workflows/reusable-ros-tooling-win-build.yml +++ b/.github/workflows/reusable-ros-tooling-win-build.yml @@ -93,6 +93,8 @@ jobs: } - uses: ros-tooling/action-ros-ci@0.3.15 + env: + BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }} with: target-ros2-distro: ${{ inputs.ros_distro }} package-name: ${{ steps.package_list_action.outputs.package_list }} From e571d7e697c43daeceb54ab976765dafb1e50b17 Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Tue, 26 Nov 2024 12:02:47 +0000 Subject: [PATCH 05/20] Add windows_dependencies input --- .github/workflows/reusable-ros-tooling-win-build.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/reusable-ros-tooling-win-build.yml b/.github/workflows/reusable-ros-tooling-win-build.yml index 6e79057..1f3e3d8 100644 --- a/.github/workflows/reusable-ros-tooling-win-build.yml +++ b/.github/workflows/reusable-ros-tooling-win-build.yml @@ -24,6 +24,11 @@ on: required: false default: '' type: string + windows_dependencies: + description: 'Path to a repos file with additional windows dependencies' + required: false + default: '' + type: string install_boost: description: 'Install boost for the build' required: false @@ -100,6 +105,7 @@ jobs: package-name: ${{ steps.package_list_action.outputs.package_list }} vcs-repo-file-url: | ${{ steps.check_local_repos.outputs.repo_file }} + ${{ env.repo_path }}/${{ inputs.windows_dependencies }} colcon-mixin-repository: https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml colcon-defaults: | { From dfacb02c48b5481f04fc6960f3f4ad705b395518 Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Tue, 26 Nov 2024 17:41:32 +0000 Subject: [PATCH 06/20] Try to install fmt via vcpkg --- .../workflows/reusable-ros-tooling-win-build.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/reusable-ros-tooling-win-build.yml b/.github/workflows/reusable-ros-tooling-win-build.yml index 1f3e3d8..8e21c0b 100644 --- a/.github/workflows/reusable-ros-tooling-win-build.yml +++ b/.github/workflows/reusable-ros-tooling-win-build.yml @@ -50,6 +50,17 @@ jobs: with: python-version: '3.8' + - name: vcpkg build + uses: johnwason/vcpkg-action@v6 + id: vcpkg + with: + pkgs: fmt + triplet: x64-windows-release + token: ${{ github.token }} + github-binarycache: true + + - run: Write-Output ${{ steps.vcpkg.outputs.vcpkg-cmake-config }} # just for debugging + - uses: ros-tooling/setup-ros@0.7.9 with: required-ros-distributions: ${{ inputs.ros_distro }} @@ -109,6 +120,11 @@ jobs: colcon-mixin-repository: https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml colcon-defaults: | { + "build": { + "cmake-args": [ + ${{ steps.vcpkg.outputs.vcpkg-cmake-config }}, + ] + }, "test": { "executor": "sequential" } From 55228307b34657f7cb0df549791ef2ca73090baa Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Tue, 26 Nov 2024 21:56:48 +0000 Subject: [PATCH 07/20] Make valid json --- .../reusable-ros-tooling-win-build.yml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/reusable-ros-tooling-win-build.yml b/.github/workflows/reusable-ros-tooling-win-build.yml index 8e21c0b..eecdbf6 100644 --- a/.github/workflows/reusable-ros-tooling-win-build.yml +++ b/.github/workflows/reusable-ros-tooling-win-build.yml @@ -59,7 +59,19 @@ jobs: token: ${{ github.token }} github-binarycache: true - - run: Write-Output ${{ steps.vcpkg.outputs.vcpkg-cmake-config }} # just for debugging + - name: Make json from vcpkg cmake + id: vcpkg-json + run: | + # Replace forward slashes with backslashes (for Windows) + $singlePath = "${{ steps.vcpkg.outputs.vcpkg-cmake-config }}" -replace "/", "\" + # Escape backlashes + $doublePath = $singlePath -replace "\\", "\\" + Write-Host "Transformed output: $doublePath" + # Split the string on spaces and assign to variables + $variables = $doublePath -split ' ' + "toolchain-file=$variables[0]" | Out-File -FilePath $Env:GITHUB_OUTPUT -Append + "target-triplet=$variables[1]" | Out-File -FilePath $Env:GITHUB_OUTPUT -Append + "manifest-mode=$variables[2]" | Out-File -FilePath $Env:GITHUB_OUTPUT -Append - uses: ros-tooling/setup-ros@0.7.9 with: @@ -122,7 +134,9 @@ jobs: { "build": { "cmake-args": [ - ${{ steps.vcpkg.outputs.vcpkg-cmake-config }}, + "${{ steps.vcpkg-json.outputs.toolchain-file }}", + "${{ steps.vcpkg-json.outputs.target-triplet }}", + "${{ steps.vcpkg-json.outputs.manifest-mode }}" ] }, "test": { From 6afbe1207e7c3e7c03956fdac4c61fc7afc38d1e Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Tue, 26 Nov 2024 22:30:41 +0000 Subject: [PATCH 08/20] Make valid json --- .../reusable-ros-tooling-win-build.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/reusable-ros-tooling-win-build.yml b/.github/workflows/reusable-ros-tooling-win-build.yml index eecdbf6..752b59e 100644 --- a/.github/workflows/reusable-ros-tooling-win-build.yml +++ b/.github/workflows/reusable-ros-tooling-win-build.yml @@ -62,16 +62,17 @@ jobs: - name: Make json from vcpkg cmake id: vcpkg-json run: | - # Replace forward slashes with backslashes (for Windows) - $singlePath = "${{ steps.vcpkg.outputs.vcpkg-cmake-config }}" -replace "/", "\" - # Escape backlashes + # Split the string on spaces and assign to variables + $variables = "${{ steps.vcpkg.outputs.vcpkg-cmake-config }}" -split ' ' + # Replace forward slashes with backslashes (for Windows) and escape them for json + $singlePath = $variables[0] -replace "/", "\" $doublePath = $singlePath -replace "\\", "\\" Write-Host "Transformed output: $doublePath" - # Split the string on spaces and assign to variables - $variables = $doublePath -split ' ' - "toolchain-file=$variables[0]" | Out-File -FilePath $Env:GITHUB_OUTPUT -Append - "target-triplet=$variables[1]" | Out-File -FilePath $Env:GITHUB_OUTPUT -Append - "manifest-mode=$variables[2]" | Out-File -FilePath $Env:GITHUB_OUTPUT -Append + $var2 = $variables[1] + $var3 = $variables[2] + "toolchain-file=$doublePath" | Out-File -FilePath $Env:GITHUB_OUTPUT -Append + "target-triplet=$var2" | Out-File -FilePath $Env:GITHUB_OUTPUT -Append + "manifest-mode=$var3" | Out-File -FilePath $Env:GITHUB_OUTPUT -Append - uses: ros-tooling/setup-ros@0.7.9 with: From b69d57ef804f3ad218ba5880a2fe8a30b15c04c4 Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Tue, 26 Nov 2024 22:47:44 +0000 Subject: [PATCH 09/20] Install empy --- .../reusable-ros-tooling-win-build.yml | 40 ++++++++++--------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/.github/workflows/reusable-ros-tooling-win-build.yml b/.github/workflows/reusable-ros-tooling-win-build.yml index 752b59e..f0c29f9 100644 --- a/.github/workflows/reusable-ros-tooling-win-build.yml +++ b/.github/workflows/reusable-ros-tooling-win-build.yml @@ -50,6 +50,25 @@ jobs: with: python-version: '3.8' + - uses: ros-tooling/setup-ros@0.7.9 + with: + required-ros-distributions: ${{ inputs.ros_distro }} + use-ros2-testing: true + + - name: Install boost + uses: MarkusJx/install-boost@v2.4.5 + if: ${{ inputs.install_boost }} + id: install-boost + with: + # REQUIRED: Specify the required boost version + # A list of supported versions can be found here: + # https://github.com/MarkusJx/prebuilt-boost/blob/main/versions-manifest.json + boost_version: 1.86.0 + # OPTIONAL: Specify a platform version + platform_version: 2019 + # OPTIONAL: Specify a toolset + toolset: msvc + - name: vcpkg build uses: johnwason/vcpkg-action@v6 id: vcpkg @@ -74,24 +93,9 @@ jobs: "target-triplet=$var2" | Out-File -FilePath $Env:GITHUB_OUTPUT -Append "manifest-mode=$var3" | Out-File -FilePath $Env:GITHUB_OUTPUT -Append - - uses: ros-tooling/setup-ros@0.7.9 - with: - required-ros-distributions: ${{ inputs.ros_distro }} - use-ros2-testing: true - - - name: Install boost - uses: MarkusJx/install-boost@v2.4.5 - if: ${{ inputs.install_boost }} - id: install-boost - with: - # REQUIRED: Specify the required boost version - # A list of supported versions can be found here: - # https://github.com/MarkusJx/prebuilt-boost/blob/main/versions-manifest.json - boost_version: 1.86.0 - # OPTIONAL: Specify a platform version - platform_version: 2019 - # OPTIONAL: Specify a toolset - toolset: msvc + - name: Install python dependencies + run: | + pip3 install empty - name: Checkout default ref when build is not scheduled if: ${{ github.event_name != 'schedule' }} From d06169c57f97fd70c4bb0101b3e8be0729c173df Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Tue, 26 Nov 2024 23:09:18 +0000 Subject: [PATCH 10/20] Fix repos logic --- .github/workflows/reusable-ros-tooling-win-build.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/reusable-ros-tooling-win-build.yml b/.github/workflows/reusable-ros-tooling-win-build.yml index f0c29f9..b2b7fde 100644 --- a/.github/workflows/reusable-ros-tooling-win-build.yml +++ b/.github/workflows/reusable-ros-tooling-win-build.yml @@ -122,7 +122,12 @@ jobs: "repo_file=${{ env.repo_path }}/${{ steps.package_list_action.outputs.repo_name }}.${{ inputs.ros_distro }}.repos" | Out-File -FilePath $Env:GITHUB_OUTPUT -Append } else { Write-Output "No local repos file found" - "repo_file=" | Out-File -FilePath $Env:GITHUB_OUTPUT -Append + } + if (-not [string]::IsNullOrEmpty("${{ inputs.windows_dependencies }}")) { + Write-Output "Using provided windows dependencies file" + "repo_file_windows=${{ env.repo_path }}/${{ inputs.windows_dependencies }}" | Out-File -FilePath $Env:GITHUB_OUTPUT -Append + } else { + Write-Output "No windows dependencies file provided" } - uses: ros-tooling/action-ros-ci@0.3.15 @@ -133,7 +138,7 @@ jobs: package-name: ${{ steps.package_list_action.outputs.package_list }} vcs-repo-file-url: | ${{ steps.check_local_repos.outputs.repo_file }} - ${{ env.repo_path }}/${{ inputs.windows_dependencies }} + ${{ steps.check_local_repos.outputs.repo_file_windows }} colcon-mixin-repository: https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml colcon-defaults: | { From 6d2c30e7153da6eb1fe39df218d2acc4006eb092 Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Tue, 26 Nov 2024 23:10:23 +0000 Subject: [PATCH 11/20] Make vcpkg optional --- .github/workflows/reusable-ros-tooling-win-build.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/reusable-ros-tooling-win-build.yml b/.github/workflows/reusable-ros-tooling-win-build.yml index b2b7fde..6047478 100644 --- a/.github/workflows/reusable-ros-tooling-win-build.yml +++ b/.github/workflows/reusable-ros-tooling-win-build.yml @@ -30,7 +30,12 @@ on: default: '' type: string install_boost: - description: 'Install boost for the build' + description: 'Install boost' + required: false + default: false + type: boolean + install_vcpkg: + description: 'Install vcpkg' required: false default: false type: boolean @@ -71,6 +76,7 @@ jobs: - name: vcpkg build uses: johnwason/vcpkg-action@v6 + if: ${{ inputs.install_vcpkg }} id: vcpkg with: pkgs: fmt @@ -79,6 +85,7 @@ jobs: github-binarycache: true - name: Make json from vcpkg cmake + if: ${{ inputs.install_vcpkg }} id: vcpkg-json run: | # Split the string on spaces and assign to variables From 23c332455e79b4aade339631bd56897988594454 Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Tue, 26 Nov 2024 23:14:06 +0000 Subject: [PATCH 12/20] Revert "Install empy" This reverts commit b69d57ef804f3ad218ba5880a2fe8a30b15c04c4. --- .../reusable-ros-tooling-win-build.yml | 40 +++++++++---------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/.github/workflows/reusable-ros-tooling-win-build.yml b/.github/workflows/reusable-ros-tooling-win-build.yml index 6047478..d773940 100644 --- a/.github/workflows/reusable-ros-tooling-win-build.yml +++ b/.github/workflows/reusable-ros-tooling-win-build.yml @@ -55,25 +55,6 @@ jobs: with: python-version: '3.8' - - uses: ros-tooling/setup-ros@0.7.9 - with: - required-ros-distributions: ${{ inputs.ros_distro }} - use-ros2-testing: true - - - name: Install boost - uses: MarkusJx/install-boost@v2.4.5 - if: ${{ inputs.install_boost }} - id: install-boost - with: - # REQUIRED: Specify the required boost version - # A list of supported versions can be found here: - # https://github.com/MarkusJx/prebuilt-boost/blob/main/versions-manifest.json - boost_version: 1.86.0 - # OPTIONAL: Specify a platform version - platform_version: 2019 - # OPTIONAL: Specify a toolset - toolset: msvc - - name: vcpkg build uses: johnwason/vcpkg-action@v6 if: ${{ inputs.install_vcpkg }} @@ -100,9 +81,24 @@ jobs: "target-triplet=$var2" | Out-File -FilePath $Env:GITHUB_OUTPUT -Append "manifest-mode=$var3" | Out-File -FilePath $Env:GITHUB_OUTPUT -Append - - name: Install python dependencies - run: | - pip3 install empty + - uses: ros-tooling/setup-ros@0.7.9 + with: + required-ros-distributions: ${{ inputs.ros_distro }} + use-ros2-testing: true + + - name: Install boost + uses: MarkusJx/install-boost@v2.4.5 + if: ${{ inputs.install_boost }} + id: install-boost + with: + # REQUIRED: Specify the required boost version + # A list of supported versions can be found here: + # https://github.com/MarkusJx/prebuilt-boost/blob/main/versions-manifest.json + boost_version: 1.86.0 + # OPTIONAL: Specify a platform version + platform_version: 2019 + # OPTIONAL: Specify a toolset + toolset: msvc - name: Checkout default ref when build is not scheduled if: ${{ github.event_name != 'schedule' }} From 6a03a89b2b3dc0c07a6a8fec4a13afebeb5b8708 Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Wed, 27 Nov 2024 07:01:34 +0000 Subject: [PATCH 13/20] Try to re-setup python version --- .github/workflows/reusable-ros-tooling-win-build.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/reusable-ros-tooling-win-build.yml b/.github/workflows/reusable-ros-tooling-win-build.yml index d773940..5cd1cbe 100644 --- a/.github/workflows/reusable-ros-tooling-win-build.yml +++ b/.github/workflows/reusable-ros-tooling-win-build.yml @@ -56,6 +56,7 @@ jobs: python-version: '3.8' - name: vcpkg build + # note: this changes the python version again uses: johnwason/vcpkg-action@v6 if: ${{ inputs.install_vcpkg }} id: vcpkg @@ -80,6 +81,13 @@ jobs: "toolchain-file=$doublePath" | Out-File -FilePath $Env:GITHUB_OUTPUT -Append "target-triplet=$var2" | Out-File -FilePath $Env:GITHUB_OUTPUT -Append "manifest-mode=$var3" | Out-File -FilePath $Env:GITHUB_OUTPUT -Append + python3 --version + + - uses: actions/setup-python@v5 + # setup-ros has hardcoded python 3.8, as it is the default version acc. to REP-2000 for jazzy + # let's use the same version here for the later action-ros-ci step + with: + python-version: '3.8' - uses: ros-tooling/setup-ros@0.7.9 with: From bb0f2f958ff6dce9ecb68a47f639a7276ab8ab84 Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Wed, 27 Nov 2024 08:57:33 +0000 Subject: [PATCH 14/20] Install fmt manually --- .../reusable-ros-tooling-win-build.yml | 47 ++++--------------- 1 file changed, 8 insertions(+), 39 deletions(-) diff --git a/.github/workflows/reusable-ros-tooling-win-build.yml b/.github/workflows/reusable-ros-tooling-win-build.yml index 5cd1cbe..42eb8d7 100644 --- a/.github/workflows/reusable-ros-tooling-win-build.yml +++ b/.github/workflows/reusable-ros-tooling-win-build.yml @@ -55,39 +55,15 @@ jobs: with: python-version: '3.8' - - name: vcpkg build - # note: this changes the python version again - uses: johnwason/vcpkg-action@v6 - if: ${{ inputs.install_vcpkg }} - id: vcpkg - with: - pkgs: fmt - triplet: x64-windows-release - token: ${{ github.token }} - github-binarycache: true - - - name: Make json from vcpkg cmake - if: ${{ inputs.install_vcpkg }} - id: vcpkg-json + - name: Install fmt run: | - # Split the string on spaces and assign to variables - $variables = "${{ steps.vcpkg.outputs.vcpkg-cmake-config }}" -split ' ' - # Replace forward slashes with backslashes (for Windows) and escape them for json - $singlePath = $variables[0] -replace "/", "\" - $doublePath = $singlePath -replace "\\", "\\" - Write-Host "Transformed output: $doublePath" - $var2 = $variables[1] - $var3 = $variables[2] - "toolchain-file=$doublePath" | Out-File -FilePath $Env:GITHUB_OUTPUT -Append - "target-triplet=$var2" | Out-File -FilePath $Env:GITHUB_OUTPUT -Append - "manifest-mode=$var3" | Out-File -FilePath $Env:GITHUB_OUTPUT -Append - python3 --version - - - uses: actions/setup-python@v5 - # setup-ros has hardcoded python 3.8, as it is the default version acc. to REP-2000 for jazzy - # let's use the same version here for the later action-ros-ci step - with: - python-version: '3.8' + git clone https://github.com/fmtlib/fmt.git + cd fmt + mkdir build + cd build + cmake .. + ls + cmake --build . --target INSTALL --config Release - uses: ros-tooling/setup-ros@0.7.9 with: @@ -153,13 +129,6 @@ jobs: colcon-mixin-repository: https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml colcon-defaults: | { - "build": { - "cmake-args": [ - "${{ steps.vcpkg-json.outputs.toolchain-file }}", - "${{ steps.vcpkg-json.outputs.target-triplet }}", - "${{ steps.vcpkg-json.outputs.manifest-mode }}" - ] - }, "test": { "executor": "sequential" } From 3a00b615e103637c0d5b32c052f98d6ade1d4745 Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Wed, 27 Nov 2024 09:32:03 +0000 Subject: [PATCH 15/20] Install eigen --- .../workflows/reusable-ros-tooling-win-build.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/reusable-ros-tooling-win-build.yml b/.github/workflows/reusable-ros-tooling-win-build.yml index 42eb8d7..4617c21 100644 --- a/.github/workflows/reusable-ros-tooling-win-build.yml +++ b/.github/workflows/reusable-ros-tooling-win-build.yml @@ -55,6 +55,19 @@ jobs: with: python-version: '3.8' + # install more dependencies here, we can't use vcpkg because it overrides the python version + # and colcon fails later + - name: Install Eigen + run: | + Invoke-WebRequest -Uri https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.zip -OutFile eigen-3.4.0.zip + Expand-Archive -Path eigen-3.4.0.zip -DestinationPath C:\Eigen + Move-Item -Path C:\Eigen\eigen-3.4.0\* -Destination C:\Eigen + Remove-Item -Path C:\Eigen\eigen-3.4.0 -Recurse + cd C:\Eigen + ls + cmake -B build -DCMAKE_INSTALL_PREFIX="C:\EigenInstall" + cmake --build build --target install + - name: Install fmt run: | git clone https://github.com/fmtlib/fmt.git From c8be05d9b65ce115ae3936ef7ce98a0457de5b5f Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Wed, 27 Nov 2024 10:02:50 +0000 Subject: [PATCH 16/20] Try to install fmt+eigen3 via vcpkg --- .../reusable-ros-tooling-win-build.yml | 50 +++++++++++-------- 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/.github/workflows/reusable-ros-tooling-win-build.yml b/.github/workflows/reusable-ros-tooling-win-build.yml index 4617c21..261cb77 100644 --- a/.github/workflows/reusable-ros-tooling-win-build.yml +++ b/.github/workflows/reusable-ros-tooling-win-build.yml @@ -55,28 +55,31 @@ jobs: with: python-version: '3.8' - # install more dependencies here, we can't use vcpkg because it overrides the python version - # and colcon fails later - - name: Install Eigen - run: | - Invoke-WebRequest -Uri https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.zip -OutFile eigen-3.4.0.zip - Expand-Archive -Path eigen-3.4.0.zip -DestinationPath C:\Eigen - Move-Item -Path C:\Eigen\eigen-3.4.0\* -Destination C:\Eigen - Remove-Item -Path C:\Eigen\eigen-3.4.0 -Recurse - cd C:\Eigen - ls - cmake -B build -DCMAKE_INSTALL_PREFIX="C:\EigenInstall" - cmake --build build --target install + - name: vcpkg build + uses: johnwason/vcpkg-action@v6 + if: ${{ inputs.install_vcpkg }} + id: vcpkg + with: + pkgs: fmt eigen3 + triplet: x64-windows-release + token: ${{ github.token }} + github-binarycache: true - - name: Install fmt + - name: Make json from vcpkg cmake + if: ${{ inputs.install_vcpkg }} + id: vcpkg-json run: | - git clone https://github.com/fmtlib/fmt.git - cd fmt - mkdir build - cd build - cmake .. - ls - cmake --build . --target INSTALL --config Release + # Split the string on spaces and assign to variables + $variables = "${{ steps.vcpkg.outputs.vcpkg-cmake-config }}" -split ' ' + # Replace forward slashes with backslashes (for Windows) and escape them for json + $singlePath = $variables[0] -replace "/", "\" + $doublePath = $singlePath -replace "\\", "\\" + Write-Host "Transformed output: $doublePath" + $var2 = $variables[1] + $var3 = $variables[2] + "toolchain-file=$doublePath" | Out-File -FilePath $Env:GITHUB_OUTPUT -Append + "target-triplet=$var2" | Out-File -FilePath $Env:GITHUB_OUTPUT -Append + "manifest-mode=$var3" | Out-File -FilePath $Env:GITHUB_OUTPUT -Append - uses: ros-tooling/setup-ros@0.7.9 with: @@ -142,6 +145,13 @@ jobs: colcon-mixin-repository: https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml colcon-defaults: | { + "build": { + "cmake-args": [ + "${{ steps.vcpkg-json.outputs.toolchain-file }}", + "${{ steps.vcpkg-json.outputs.target-triplet }}", + "${{ steps.vcpkg-json.outputs.manifest-mode }}" + ] + }, "test": { "executor": "sequential" } From 6f92c4e69e809422c58a5b921e1040c3e39c2a35 Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Wed, 27 Nov 2024 11:46:48 +0000 Subject: [PATCH 17/20] Add some debug output --- .github/workflows/reusable-ros-tooling-win-build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/reusable-ros-tooling-win-build.yml b/.github/workflows/reusable-ros-tooling-win-build.yml index 261cb77..f650b5a 100644 --- a/.github/workflows/reusable-ros-tooling-win-build.yml +++ b/.github/workflows/reusable-ros-tooling-win-build.yml @@ -81,6 +81,9 @@ jobs: "target-triplet=$var2" | Out-File -FilePath $Env:GITHUB_OUTPUT -Append "manifest-mode=$var3" | Out-File -FilePath $Env:GITHUB_OUTPUT -Append + # does this overwrite python setup? + cat "D:\a\control_toolbox\control_toolbox\vcpkg\ports\python3\portfile.cmake" + - uses: ros-tooling/setup-ros@0.7.9 with: required-ros-distributions: ${{ inputs.ros_distro }} From 12b0483143bc2be852384f5f687f1d9cbd7631ae Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Wed, 27 Nov 2024 12:07:23 +0000 Subject: [PATCH 18/20] Fork setup-ros --- .../workflows/reusable-ros-tooling-win-build.yml | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/.github/workflows/reusable-ros-tooling-win-build.yml b/.github/workflows/reusable-ros-tooling-win-build.yml index f650b5a..afab60a 100644 --- a/.github/workflows/reusable-ros-tooling-win-build.yml +++ b/.github/workflows/reusable-ros-tooling-win-build.yml @@ -49,11 +49,11 @@ jobs: # this will be src/{repo-owner}/{repo-name} repo_path: src/${{ github.repository }} steps: - - uses: actions/setup-python@v5 - # setup-ros has hardcoded python 3.8, as it is the default version acc. to REP-2000 for jazzy - # let's use the same version here for the later action-ros-ci step + + - uses: christophfroehlich/setup-ros@master with: - python-version: '3.8' + required-ros-distributions: ${{ inputs.ros_distro }} + use-ros2-testing: true - name: vcpkg build uses: johnwason/vcpkg-action@v6 @@ -81,14 +81,6 @@ jobs: "target-triplet=$var2" | Out-File -FilePath $Env:GITHUB_OUTPUT -Append "manifest-mode=$var3" | Out-File -FilePath $Env:GITHUB_OUTPUT -Append - # does this overwrite python setup? - cat "D:\a\control_toolbox\control_toolbox\vcpkg\ports\python3\portfile.cmake" - - - uses: ros-tooling/setup-ros@0.7.9 - with: - required-ros-distributions: ${{ inputs.ros_distro }} - use-ros2-testing: true - - name: Install boost uses: MarkusJx/install-boost@v2.4.5 if: ${{ inputs.install_boost }} From 46b08eaeaf9d6d834f35f5cbb7adc6ede3ae44cf Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Wed, 27 Nov 2024 12:50:44 +0000 Subject: [PATCH 19/20] Try setting 3.12 explicitely --- .github/workflows/reusable-ros-tooling-win-build.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/reusable-ros-tooling-win-build.yml b/.github/workflows/reusable-ros-tooling-win-build.yml index afab60a..f7bbdb1 100644 --- a/.github/workflows/reusable-ros-tooling-win-build.yml +++ b/.github/workflows/reusable-ros-tooling-win-build.yml @@ -50,6 +50,11 @@ jobs: repo_path: src/${{ github.repository }} steps: + - uses: actions/setup-python@v5 + # let's use the same version here for the later action-ros-ci step + with: + python-version: '3.12' + - uses: christophfroehlich/setup-ros@master with: required-ros-distributions: ${{ inputs.ros_distro }} From de626b867a64873e08acdf40d131acae52e64e1a Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Sun, 1 Dec 2024 20:11:48 +0000 Subject: [PATCH 20/20] Add comment --- .github/workflows/reusable-ros-tooling-win-build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/reusable-ros-tooling-win-build.yml b/.github/workflows/reusable-ros-tooling-win-build.yml index f7bbdb1..8af8498 100644 --- a/.github/workflows/reusable-ros-tooling-win-build.yml +++ b/.github/workflows/reusable-ros-tooling-win-build.yml @@ -65,6 +65,7 @@ jobs: if: ${{ inputs.install_vcpkg }} id: vcpkg with: + # eigen should be installed with setup-ros, but cmake can't find it in the action-ros-ci step pkgs: fmt eigen3 triplet: x64-windows-release token: ${{ github.token }}