AMENT_TRACE_SETUP_FILES unbound variable
- Vorherrschende Sprache
- Python
- Sterne
- 12
- Forks
- 23
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
# Problem
I use protections in all bash scripts to prevent bugs. Bash protection of `set -eu` for unbound variables errors out when sourcing a ROS environment. With complicated shell scripts, `-eu` is used in CI to ensure all variables used are defined.
# Steps to reproduce
```bash
set -eu
source /opt/ros/humble/setup.bash
>> Terminal closes
```
Logs
```
$ set -u
$ source /opt/ros/humble/setup.bash
>>> bash: AMENT_TRACE_SETUP_FILES: unbound variable
```
# Environment
* Ubuntu 22.04
* ROS 2 Humble (binaries)
# Workaround
```bash
# My long script
# Add protection
set -euf -o pipefail
echo foo
echo bar
# lots of other custom code here
set +u # temporary disable protection
source /opt/ros/humble/setup.bash
set -u # re-enable protection
# more custom code here
```
Beitragsleitfaden
Bewertung
Dieses Issue wurde noch nicht bewertet.