The environment variables must be defined in the scope of the rake process. During the installation process, the build system invokes processes under sudo, which very likely does not have the target environment variables defined. An expected linker command specifying -L#{ENV['OSPL_HOME']}/lib will become -L/lib (which will not include the target libraries). It would be very useful if the Corto build system would warn of undefined environment variables.
Utilizing environment variables to build and link against third party libraries simplify devops efforts. Example:
The environment variables must be defined in the scope of the rake process. During the installation process, the build system invokes processes under
sudo
, which very likely does not have the target environment variables defined. An expected linker command specifying-L#{ENV['OSPL_HOME']}/lib
will become-L/lib
(which will not include the target libraries). It would be very useful if the Corto build system would warn of undefined environment variables.NOTE: A potential workaround to specify environment variables to "keep" when running as
sudo
is explained @ https://stackoverflow.com/questions/8633461/how-to-keep-environment-variables-when-using-sudo. Add the following to/etc/sudoers
: