Skip to content

Use a relative target for the latest log symlink#983

Open
Old-Ding wants to merge 1 commit into
ros2:rollingfrom
Old-Ding:codex/relative-latest-log-symlink
Open

Use a relative target for the latest log symlink#983
Old-Ding wants to merge 1 commit into
ros2:rollingfrom
Old-Ding:codex/relative-latest-log-symlink

Conversation

@Old-Ding

Copy link
Copy Markdown

Description

Create the latest log symlink with the run directory basename as its target. Because the link and run directory are siblings, the relative target resolves identically in place and remains valid when the parent log directory is mounted at a different absolute path.

Add a platform-independent regression test that verifies the target is relative and resolves back to the run directory.

Fixes #978

Is this user-facing behavior change?

Yes. latest continues to resolve to the newest run directory, but os.readlink() now returns a relative basename instead of an absolute path. This keeps the link usable across host and container mount paths.

Did you use Generative AI?

Yes. OpenAI Codex (GPT-5) was used to trace the logging path, implement the one-line behavior change, add the regression test, and review the diff. The contributor reviewed and locally validated the final change.

Additional Information

Local validation:

  • pytest launch/test/launch/test_logging.py: 21 passed
  • pytest launch/test/launch: 280 passed
  • pytest launch/test/test_flake8.py: 1 passed

The latest link and each run directory are siblings. Point the link at the run directory basename so it remains valid when the parent log directory is mounted at a different absolute path.

Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
@mergify

mergify Bot commented Jul 10, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use a relative target for the latest log symlink so it survives different absolute mount paths (host/Docker)

1 participant