ament / ament/ament_package

AMENT_TRACE_SETUP_FILES unbound variable

Aperta
#148 0 commenti 1 reazione 0 assegnatari Vedi su GitHub
help wanted
Lingua principale
Python
Stelle
12
Fork
23
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

# 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
```

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.