This is an archive of the discontinued LLVM Phabricator instance.

[cmake] Create versioned symlinks on versioned tools
AbandonedPublic

Authored by mgorny on Oct 3 2016, 1:16 AM.

Details

Summary

Create versioned symlink structure when symlinking a tool that has
the VERSION property set (e.g. clang).

Currently, if symlink target had version set, CMake created symlink from
non-versioned name to the versioned name implicitly and we created
additional symlinks to the non-versioned name. For example:

clang -> clang-4.0
clang++ -> clang
...

With this patch, a versioned symlink that points to the versioned (real)
executable is created first, and a non-versioned symlink to
the versioned symlink is created afterwards. The resulting structure
becomes:

clang++-4.0 -> clang-4.0
clang -> clang-4.0
clang++ -> clang++-4.0
...

As a result, this improves consistency between the symlinks and makes it
easier to maintain multiple versions of clang installed on the same
system. In particular, after installing a new version the 'bare'
symlinks are clobbered but the versioned symlinks continue to work.

Diff Detail

Event Timeline

mgorny updated this revision to Diff 73243.Oct 3 2016, 1:16 AM
mgorny retitled this revision from to [cmake] Create versioned symlinks on versioned tools.
mgorny updated this object.
mgorny added reviewers: beanz, doug.gregor, joerg.
mgorny added a subscriber: llvm-commits.
mgorny abandoned this revision.Jan 30 2019, 12:12 AM

Rebasing is not worth the effort.