ros-tooling/setup-ros

build failure for galactic: input has invalid distribution names

Closed this issue · 2 comments

Using action-ros-ci, building a repository works for all ROS2 distros but galactic.
The error message indicates that the distribution name is invalid. But galactic should be available on ubuntu-20.04, no? Puzzled as to what the problem is.

Here is the error message:

  /usr/bin/sudo rosdep init
  Wrote /etc/ros/rosdep/sources.list.d/20-default.list
  Recommended: please run
  
  	rosdep update
  
Error: Input has invalid distribution names.

And this is the relevant part of my workflow file. Works fine for "foxy", fails for "galactic":

 build_on_focal:
    name: build_focal_${{ matrix.distro }}
    runs-on: ubuntu-20.04
    strategy:
      fail-fast: false
      matrix:
        distro: [galactic, foxy]
    steps:
      - uses: actions/checkout@v3
        with:
          path: src/${{ inputs.repo }}
          fetch-depth: 0
      - uses: ros-tooling/setup-ros@v0.6
        with:
          required-ros-distributions: ${{ matrix.distro }}
      - uses: ros-tooling/action-ros-ci@v0.3
        with:
          target-ros2-distro: ${{ matrix.distro }}
          vcs-repo-file-url: ${{ inputs.vcs_url }}
          colcon-defaults: |
            {
              "build": {                                                                                                                                                                                      
                "cmake-args": [                                                                                                                                                                               
                    "-DCMAKE_BUILD_TYPE=RelWithDebInfo"                                                                                                                                                       
                ]                                                                                                                                                                                             
              }                                                                                                                                                                                               
            }                                                                                                                                                                                                 

The issue is that Galactic is now end-of-life, so setup-ros rejects it:

setup-ros/src/utils.ts

Lines 27 to 57 in 7293e28

export function getRequiredRosDistributions(): string[] {
let requiredRosDistributionsList: string[] = [];
const requiredRosDistributions = core.getInput("required-ros-distributions");
if (requiredRosDistributions) {
requiredRosDistributionsList = requiredRosDistributions.split(
RegExp("\\s")
);
}
if (!validateDistro(requiredRosDistributionsList)) {
throw new Error("Input has invalid distribution names.");
}
return requiredRosDistributionsList;
}
//list of valid linux distributions
const validDistro: string[] = ["noetic", "humble", "iron", "rolling"];
//Determine whether all inputs name supported ROS distributions.
export function validateDistro(
requiredRosDistributionsList: string[]
): boolean {
for (const rosDistro of requiredRosDistributionsList) {
if (validDistro.indexOf(rosDistro) <= -1) {
return false;
}
}
return true;
}
.

You're using setup-ros@v0.6 which still allows using Foxy but not Galactic: https://github.com/ros-tooling/setup-ros/blob/v0.6/src/utils.ts#L47. You'll need to use a version of setup-ros that still supports both Foxy and Galactic, so v0.5. But you'll need to use a newer version for newer distros like Iron.

I know this is annoying, but given the somewhat limited resources/time we have, we've decided to drop support for EOL distros.

Thanks much for the quick reply. Indeed, dropping down to v0.5 did the trick!
I am particularly fond of galactic because it allows both ROS1 and ROS2 installations from debian packages on the same platform (Ubuntu 20.04), which also happens to be the last OS version supported on my Xavier AGX. I understand the reasons for dropping support though.