Skip to content

AMENT_TRACE_SETUP_FILES unbound variable #148

@Ryanf55

Description

@Ryanf55

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions