https://issues.dlang.org/show_bug.cgi?id=16595

Jacob Carlborg <d...@me.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |d...@me.com

--- Comment #1 from Jacob Carlborg <d...@me.com> ---
The implementation of "thisExePath" on macOS calls "realpath". The intention is
to get the full path without any extra "/", "." or "..". Removing the call to
"realpath" from "thisExePath" resolves in the following behavior:

$ ./d/main
/Users/jacob/development/./d/main

The Linux implementation is using "readlink" to read "/proc/self/exe". This
resolves symbolic links as well. I don't know any other way to do it on Linux.
So the behavior of macOS and Linux is at least consistent. I don't remember the
behavior of the other platforms when it comes to symbolic links.

The workaround would be to implement "thisExePath" yourself. That is,
copy-paste the implementation of the existing "thisExePath" and remove the call
to "realpath". Perhaps add a call to "asNormalizedPath" if you want to remove
any extra "/", "." and ".."

--

Reply via email to