Skip to content

Commit

Permalink
Add no-symlink-install option (#859)
Browse files Browse the repository at this point in the history
Signed-off-by: Christophe Bedard <christophe.bedard@apex.ai>
  • Loading branch information
christophebedard authored Apr 12, 2024
1 parent 3dfca1f commit 769c644
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 2 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,17 @@ jobs:
- run: test ! -f "${{ steps.test_skip_tests.outputs.ros-workspace-directory-name }}/build/ament_copyright/colcon_test.rc"
name: "Check that 'colcon test' wasn't run on ament_copyright"

- uses: ./
id: test_no_symlink_install
name: "Test single package, with no --symlink-install"
with:
package-name: ament_copyright
target-ros2-distro: ${{ matrix.ros_distribution }}
vcs-repo-file-url: ${{ env.DISTRO_REPOS_URL }}
no-symlink-install: true
- run: test ! -f "${{ steps.test_no_symlink_install.outputs.ros-workspace-directory-name }}/install/ament_copyright/lib/python3.*/site-packages/ament-copyright.egg-link"
name: "Check that an .egg-link file in the install dir does not exist for ament_copyright"

test_ros2_from_source_docker:
name: "Test ROS 2 from source Docker"
runs-on: ubuntu-latest
Expand Down
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ This action builds and tests a [ROS](http://wiki.ros.org/) or [ROS 2](https://do
1. [Build a ROS 1 workspace](#Build-a-ROS-1-workspace)
1. [Skip tests](#Skip-tests)
1. [Use a `colcon` `defaults.yaml` file](#Use-a-colcon-defaultsyaml-file)
1. [Do not use `--symlink-install` when building](#Do-not-use---symlink-install-when-building)
1. [Enable Address Sanitizer to automatically report memory issues](#Enable-Address-Sanitizer-to-automatically-report-memory-issues)
1. [Generate and process code coverage data](#Generate-and-process-code-coverage-data)
1. [Store `colcon` logs as build artifacts](#Store-colcon-logs-as-build-artifacts)
Expand Down Expand Up @@ -210,6 +211,23 @@ steps:
}
```

### Do not use `--symlink-install` when building

By default, [`--symlink-install` is used with `colcon build`](https://colcon.readthedocs.io/en/released/reference/verb/build.html).
To avoid this, set the `no-symlink-install` input to `true`.

```yaml
steps:
- uses: ros-tooling/setup-ros@v0.7
with:
required-ros-distributions: humble
- uses: ros-tooling/action-ros-ci@v0.3
with:
package-name: my_package
target-ros2-distro: humble
no-symlink-install: true
```

### Enable Address Sanitizer to automatically report memory issues

[ASan][addresssanitizer] is an open-source tool developed to automatically report
Expand Down
6 changes: 6 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ inputs:
Skip rosdep install.
Set to 'true'.
required: false
no-symlink-install:
default: ""
description: |
Do not use '--symlink-install' with 'colcon build'.
Set to 'true'.
required: false
rosdep-check:
default: ""
description: |
Expand Down
5 changes: 4 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11411,6 +11411,7 @@ function run_throw() {
const workspace = process.env.GITHUB_WORKSPACE;
const colconDefaults = core.getInput("colcon-defaults");
const colconMixinRepo = core.getInput("colcon-mixin-repository");
const noSymlinkInstall = core.getInput("no-symlink-install") === "true";
const extraCmakeArgsInput = core.getInput("extra-cmake-args");
const extraCmakeArgs = extraCmakeArgsInput
? ["--cmake-args", extraCmakeArgsInput]
Expand Down Expand Up @@ -11665,12 +11666,14 @@ done`;
let colconBuildCmd = [
`colcon`,
`build`,
`--symlink-install`,
...buildPackageSelection,
...colconExtraArgs,
...extraCmakeArgs,
`--event-handlers=console_cohesion+`,
];
if (!noSymlinkInstall) {
colconBuildCmd = [...colconBuildCmd, `--symlink-install`];
}
if (useMergeInstall) {
colconBuildCmd = [...colconBuildCmd, `--merge-install`];
}
Expand Down
5 changes: 4 additions & 1 deletion src/action-ros-ci.ts
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ async function run_throw(): Promise<void> {

const colconDefaults = core.getInput("colcon-defaults");
const colconMixinRepo = core.getInput("colcon-mixin-repository");
const noSymlinkInstall = core.getInput("no-symlink-install") === "true";

const extraCmakeArgsInput = core.getInput("extra-cmake-args");
const extraCmakeArgs = extraCmakeArgsInput
Expand Down Expand Up @@ -722,12 +723,14 @@ done`;
let colconBuildCmd = [
`colcon`,
`build`,
`--symlink-install`,
...buildPackageSelection,
...colconExtraArgs,
...extraCmakeArgs,
`--event-handlers=console_cohesion+`,
];
if (!noSymlinkInstall) {
colconBuildCmd = [...colconBuildCmd, `--symlink-install`];
}
if (useMergeInstall) {
colconBuildCmd = [...colconBuildCmd, `--merge-install`];
}
Expand Down

0 comments on commit 769c644

Please sign in to comment.