Does it make sense to interpret //path/to/somewhere as a network destination on every platform?
I ran into a "destrooting" error (intermediate install to $DESTDIR) because of a redundant initial /
that slipped into my build scripts.
:info:destroot CMake Error at settings/cmake_install.cmake:49 (file):
:info:destroot file called with network path DESTINATION. This does not make sense when
:info:destroot using DESTDIR. Specify local absolute path or remove DESTDIR environment
:info:destroot variable.
:info:destroot DESTINATION=
:info:destroot //Applications/MacPorts/KF5
As /Applications/MacPorts
suggests, this is on a Mac system. I know that //Applications
would be interpreted as a network file "opcode" on MS Windows (and used to be on Apollo Domain/OS) but this is not the case on any other current OS that I know of. Posix OSes will just ignore the redudant slash.
Yet in the code (https://gitlab.kitware.com/cmake/cmake/-/blob/v3.28.1/Source/cmFileInstaller.cxx#L426) I see no attempt to handle this situation in a platform-specific manner.
Is there a point to that? How likely is it that someone would use the same build configuration (a DESTINATION starting with //
) on MSWin and on Mac/Linux/... AND use DESTDIR to do a temporary/test install?
IMHO it does certainly NOT make sense to raise this error knowing that a non-temporary install (without the use of DESTDIR) will just let the OS handle //path/to/somewhere
the normal way. If the error above is intended to protect users from unwanted/unforeseen platform-specific behaviour the direct install path should probably raise an error when a network destination is used on platforms that don't support them, no?!