Skip to content

$(dirname) is affected by previous ($find-pkg-share ...) #618

@felixdivo

Description

@felixdivo

Bug report

Required Info:

  • Operating System:
    • Ubuntu 20.04
  • Installation type:
    • binaries
  • Version or commit hash:
    • up to date
  • DDS implementation:
    • irrelevant
  • Client library (if applicable):
    • irrelevant

Steps to reproduce issue

Create file test.launch.yaml.

launch:
  - executable:
      cmd: echo $(dirname)
      name: obvious
      output: screen
  - include:
      file: $(find-pkg-share some_package)/file.launch.yaml
  - executable:
      cmd: echo $(dirname)
      name: surprise
      output: screen

The file file.launch.yaml in some_package:

launch: []

Run ros2 launch test.launch.yaml.

Expected behavior

echo $(dirname) outputs the path to test.launch.yaml each time.

Actual behavior

echo $(dirname) outputs the path to test.launch.yaml the first time and the path to the package share of some_package the second time. It appears that "the context" is somehow not reset. Is this really intentional? I also could not find the docs for that substitution.

Additional information

launch:
  - executable:
      cmd: echo $(dirname)
      name: obvious
      output: screen
  - executable:
      cmd: echo $(find-pkg-share some_package)
      name: testing_this
      output: screen
  - executable:
      cmd: echo $(dirname)
      name: surprise
      output: screen

In this setting echo $(dirname) outputs the path to test.launch.yaml each time.

Implementation considerations

It is very unexpected but also breaking when changed.

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions