The DESTDIR environment variable is a well-documented mechanism used on UNIX systems to prefix the installation directory with another path during an invocation of make install. There are four reasons that colcon should never allow that variable to be passed when make might be invoked:
The behavior is not consistent across all of the platforms that colcon supports, which could mean that Linux behaves different from Windows.
Specifying DESTDIR during a build phase could have unintended consequences if the project isn't properly structured.
Other colcon package types (like Python) may not support DESTDIR, resulting in inconsistent behavior even within the same build invocation.
colcon is already using the more platform-agnostic CMAKE_INSTALL_PREFIX to set the installation directory, and both mechanisms would affect the final installation directory simultaneously.
Given that the widely adopted spirit of DESTDIR is to augment the installation directory on some systems, this change hides the variable for all CMake operations.
If there is desire for DESTDIR to augment the behavior of colcon in any way, it should be supported consistently on all platforms by all supported package types. Really, though, the supported mechanism for augmenting the installation directory (--install-base) is the right way to do this.
The
DESTDIR
environment variable is a well-documented mechanism used on UNIX systems to prefix the installation directory with another path during an invocation ofmake install
. There are four reasons that colcon should never allow that variable to be passed whenmake
might be invoked:DESTDIR
during a build phase could have unintended consequences if the project isn't properly structured.DESTDIR
, resulting in inconsistent behavior even within the same build invocation.CMAKE_INSTALL_PREFIX
to set the installation directory, and both mechanisms would affect the final installation directory simultaneously.Given that the widely adopted spirit of
DESTDIR
is to augment the installation directory on some systems, this change hides the variable for all CMake operations.If there is desire for
DESTDIR
to augment the behavior of colcon in any way, it should be supported consistently on all platforms by all supported package types. Really, though, the supported mechanism for augmenting the installation directory (--install-base) is the right way to do this.