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

AMENT_TRACE_SETUP_FILES unbound variable #148

Open
Ryanf55 opened this issue May 3, 2024 · 0 comments
Open

AMENT_TRACE_SETUP_FILES unbound variable #148

Ryanf55 opened this issue May 3, 2024 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@Ryanf55
Copy link

Ryanf55 commented May 3, 2024

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

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

# 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
@sloretz sloretz added the help wanted Extra attention is needed label May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants