ament / ament/ament_package

AMENT_TRACE_SETUP_FILES unbound variable

Offen
#148 0 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
help wanted
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

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.