Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Args set using colcon-defaults do not reflect in workflow run #815

Closed
quarkytale opened this issue Apr 19, 2023 · 9 comments
Closed

Args set using colcon-defaults do not reflect in workflow run #815

quarkytale opened this issue Apr 19, 2023 · 9 comments
Labels
bug Something isn't working

Comments

@quarkytale
Copy link

quarkytale commented Apr 19, 2023

Description

Using colcon-defaults in the workflow file do not print out the exact command being run. Not sure if this is a bug or expected behavior from colcon.

To Reproduce

The project's build and test step is configured as:

- name: Build and test
        uses: ros-tooling/action-ros-ci@v0.3
        with:
          package-name:
          vcs-repo-file-url: |
            $GITHUB_WORKSPACE/dependencies.repos
          target-ros2-distro: humble
          rosdep-skip-keys: gz-transport12 gz-common5 gz-math7 gz-msgs9 gz-gui7 gz-cmake3 gz-sim7
          colcon-defaults: |
            {
              "build": {
                "cmake-args": [
                  "-DSKIP_QGROUNDCONTROL=1"
                ]
              },
              "test": {
                "retest-until-pass": 5
              },
              "test": {
                "packages-select-regex": [
                  "package_name"
                ]
              }
            }

Expected Behavior

Seeing the exact command being run in the Github Actions workflow log, for this example:

colcon build --symlink-install -DSKIP_QGROUNDCONTROL=1 --event-handlers=console_cohesion+
colcon test --packages-select-regex=package_name --retest-until-pass=5 --event-handlers=console_cohesion+

Actual Behavior

But instead this is the entire output for build and test step:

Run ros-tooling/action-ros-ci@v0.3
/usr/bin/docker exec  e5d220f76bf4bd1be41ffa2d9900558aa18e497e160b58b13324191345f5c05a sh -c "cat /etc/*release | grep ^ID"
Repos files: override - none
Repos files: supplemental - none
Invoking: bash -c,rosdep update --include-eol-distros
Invoking: bash -c,vcs import --force --recursive src/ --input $GITHUB_WORKSPACE/dependencies.repos
Invoking: bash -c,vcs diff -s --repos /__w/package_name/package_name/ros_ws | cut -d ' ' -f 1 | grep "package_name$" | xargs rm -rf
Invoking: bash -c,vcs import --force --recursive src/ < package.repo
Invoking: bash -c,vcs log -l1 src/
Invoking: bash -c,sudo apt-get update
Invoking: bash -c,./install_rosdeps.sh humble
Invoking: bash -c,source /opt/ros/humble/setup.sh && colcon build --symlink-install --event-handlers=console_cohesion+
Invoking: bash -c,source /opt/ros/humble/setup.sh && colcon lcov-result --initial
Invoking: bash -c,source /opt/ros/humble/setup.sh && colcon test --event-handlers=console_cohesion+
Invoking: bash -c,source /opt/ros/humble/setup.sh && colcon test-result --all
Invoking: bash -c,source /opt/ros/humble/setup.sh && colcon test-result --verbose
Invoking: bash -c,source /opt/ros/humble/setup.sh && colcon lcov-result --verbose
Invoking: bash -c,source /opt/ros/humble/setup.sh && colcon coveragepy-result --verbose --coverage-report-args -m

Note: the args set have the desired effect on the build and test, this is regarding just the command printed out in the logs.

System

  • OS: Ubuntu Jammy
  • ROS 2 Distro: Humble
@quarkytale quarkytale added the bug Something isn't working label Apr 19, 2023
@christophebedard
Copy link
Member

christophebedard commented Apr 19, 2023

What you provide to the colcon-defaults input is written to a defaults.yaml file, which is picked up by colcon. Not seeing options you add to colcon-defaults in the commands that action-ros-ci runs is expected. As you said, what you put in colcon-defaults still gets picked up by colcon and works, but it's just not going to be printed.

We could make action-ros-ci print out the contents of the defaults.yaml file, though.

Also, it would be cool if colcon had a --simulate option that would print out the equivalent command, taking into account the actual CLI args and the defaults.yaml file.

@padhupradheep
Copy link

In our case, we're setting the

{
    "build": {
        "symlink-install": false
    }
}

but while getting built I can see symlinking happening

@christophebedard
Copy link
Member

christophebedard commented Aug 2, 2023

Try to reproduce locally. This might not be an issue with action-ros-ci and could be an issue with colcon. If you think you still have an issue with action-ros-ci, then please open another issue.

@padhupradheep
Copy link

Sorry for the trouble it was indeed a local issue.

Both colcon and action-ros-ci works as expected.

@antbono
Copy link

antbono commented Apr 10, 2024

I am trying to use the same option of @padhupradheep

colcon-defaults: |
 {
     {
        "build": {
            "symlink-install": false
      }
}

But symlinking still happens during the building.

Having a look a the code

`--symlink-install`,

it seems to me that is not possibile to disable such an option.

I think the problem is with action-ros-ci since I can build locally wihout using the symlink option.

@christophebedard do you think I should open a new issue?

@christophebedard
Copy link
Member

Yeah, looks like --symlink-install is hardcoded there, so disabling it using a defaults.yaml file wouldn't change anything. I don't really remember why it's hardcoded; probably because it's generally better. It should be pretty easy to make it an option similar to #830. A PR would be welcome :)

@antbono
Copy link

antbono commented Apr 11, 2024

Hi Christoph!

Thank you for the quick reply :)

Unfortunately, I don't have any experience with TypeScript. Anyway, I'll have a look at #830. If I can understand the code, I'll send a PR.

@christophebedard
Copy link
Member

You do kind of need to install Node.js and all (https://github.com/ros-tooling/action-ros-ci/blob/master/DEVELOPING.md). It's such a small change that I could do it when I get some time. If you could just open an issue for this request, that would be great. Also please mention in the issue the reason why you're specifically not using --symlink-install.

@antbono
Copy link

antbono commented Apr 11, 2024

Thank you for the support.

I'll open a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants