This is a partial revert of 10c48a77 with a fix for the symlink target name on MacOS See #84637 (cherry picked from commit ec2b7522)