getExecutablePath from System.Environment in base should follow symlinks properly.
During the implementation of relocation capabilities in GHC for linux and macOS it came to light, that windows (which has had this support for quite some time), uses a custom implementation of
Ideally this logic should be moved into
base. Phyx- noted in D4121 that this should be possible for 8.6, as at that point Win32 should be new enough to be usable in base for this.
The result would be that the custom code in GHC (SysTools) and the older copy in GhcPkg of the same code can be unified with the linux and macOS CPP conditional branch.