Skip to content

Inconsistent path resolution with symbolic links between display editor and display runtime #3873

Description

@minijackson

My realization of the week: at least on Linux, when symbolic links are at play, a/b/../c doesn't necessarily means a/c (b can be a symbolic link, so a/b/.. means the parent of the target directory of b).

When using symbolic linked directories, it seems the display editor and the display runtime doesn't resolve relative paths the same way.

How to reproduce:

  • In a given directory, run:

    mkdir -p test/a/b
    ln -sfn ./a/b test/c
  • Open Phoebus, and:

    • create a display test-target.bob in the newly created test folder,
    • create a display test-source.bob in the test/c/ folder (through the symbolic link),
    • in test-source.bob, create an Embedded Display, and using the Phoebus interface, make it point to test-target.bob,
    • run the display, and observe Phoebus saying that it can't find the file

Created structure:

.
└── test
    ├── a
    │   └── b
    │       └── test-source.bob
    ├── c -> ./a/b
    └── test-target.bob

The created Embedded Display points to ../../test-target.bob which correct: relative to the display this is test/c/../../test-target.bob which resolves to test/a/b/../../test-target.bob -> test/test-target.bob (and not test-target.bob).

For us, this happened because we develop some of our displays in different Git repositories, and have a different structure to present to the operators in production. For development, we created that structure using symbolic links so that modifying displays in that structure modifies the displays in our Git repositories:

dev-bundle
├── sources
│   └── our-internal-gitlab.example.com
│       ├── git-repo1
│       ├── git-repo2
│       └── etc.
└── views
    ├── LCS
    │   └── LLRF -> ../../sources/our-internal-gitlab.example.com/LLRF-views
    └── MCS -> ../sources/our-internal-gitlab.example.com/MCS-views

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions