Because of symlinks, on POSIX systems, in general you can't claim that foo/bar/../baz is the same path as foo/baz. If foo/bar is a symlink with target flip/flop then the abspath of foo/bar/../baz is actually foo/flip/baz. Normalizing the path symbolically changes the meaning of the path. (reducing // to / is still valid though)
Other issues like #11650 are symptoms of this issue, execvp is not the only call that changes behaviour when path components are stripped out.
The std::path::posix::Path module needs to leave the paths un-normalized internally, and re-introduce an explicit normpath method (distinct from os::make_absolute for the reasons outlined above).
Because of symlinks, on POSIX systems, in general you can't claim that
foo/bar/../bazis the same path asfoo/baz. Iffoo/baris a symlink with targetflip/flopthen the abspath offoo/bar/../bazis actuallyfoo/flip/baz. Normalizing the path symbolically changes the meaning of the path. (reducing//to/is still valid though)Other issues like #11650 are symptoms of this issue,
execvpis not the only call that changes behaviour when path components are stripped out.The
std::path::posix::Pathmodule needs to leave the paths un-normalized internally, and re-introduce an explicitnormpathmethod (distinct fromos::make_absolutefor the reasons outlined above).