ros-infrastructure / catkin_pkg

Standalone Python library for the catkin build system.
https://github.com/ros/catkin
Other
47 stars 91 forks source link

Fix symlink resolution on Windows w/short filenames #365

Closed cottsay closed 6 months ago

cottsay commented 6 months ago

Two issues here:

  1. os.path.realpath() doesn't resolve symlinks at all prior to Python 3.8. Best we can do is skip the test there.
  2. It doesn't appear that os.path.realpath() is idempotent on Windows when path resolution requires both symlink resolution and 8.3/short filename resolution. Calling it twice seems to give the result we want.
cottsay commented 6 months ago

That's a really weird behavior.

It was pretty hard to track down since I wasn't hitting the problem locally. It appears that the GitHub Actions runners use 8.3 filenames in TMP (probably in an effort to make the directory path shorter), which is the only reason I became aware of the misbehavior.

Can you add a comment

Done in 7cc7ad6.