Streamline compiler wrappers
(moved from lhcb/Rec!2699 (comment 5370268))
The compiler wrapper has "too much" in the PATH. Here's an example from the nightlies
#!/bin/sh
export PATH=/cvmfs/lhcb.cern.ch/lib/lcg/releases/gcc/11.1.0-e80bf/x86_64-centos7/bin:/cvmfs/lhcb.cern.ch/lib/lcg/releases/binutils/2.36.1-a9696/x86_64-centos7/bin:/cvmfs/lhcb.cern.ch/lib/bin/x86_64-centos7:/cvmfs/lhcb.cern.ch/lib/bin/Linux-x86_64:/cvmfs/lhcb.cern.ch/lib/bin:/cvmfs/lhcb.cern.ch/lib/contrib/CMake/3.19.3/Linux-x86_64/bin:/cvmfs/lhcb.cern.ch/lib/contrib/glimpse/4.18.6/Linux-x86_64/bin:/cvmfs/lhcb.cern.ch/lib/contrib/ninja/1.8.2.g81279.kitware.dyndep-1.jobserver-1/Linux-x86_64:/workspace/venv/centos7/bin:/usr/sbin:/usr/bin:/sbin:/bin
export LD_LIBRARY_PATH=/cvmfs/lhcb.cern.ch/lib/lcg/releases/gcc/11.1.0-e80bf/x86_64-centos7/lib64
exec /cvmfs/lhcb.cern.ch/lib/lcg/releases/gcc/11.1.0-e80bf/x86_64-centos7/bin/g++
slightly more readable
/cvmfs/lhcb.cern.ch/lib/lcg/releases/gcc/11.1.0-e80bf/x86_64-centos7/bin
/cvmfs/lhcb.cern.ch/lib/lcg/releases/binutils/2.36.1-a9696/x86_64-centos7/bin
/cvmfs/lhcb.cern.ch/lib/bin/x86_64-centos7
/cvmfs/lhcb.cern.ch/lib/bin/Linux-x86_64
/cvmfs/lhcb.cern.ch/lib/bin
/cvmfs/lhcb.cern.ch/lib/contrib/CMake/3.19.3/Linux-x86_64/bin
/cvmfs/lhcb.cern.ch/lib/contrib/glimpse/4.18.6/Linux-x86_64/bin
/cvmfs/lhcb.cern.ch/lib/contrib/ninja/1.8.2.g81279.kitware.dyndep-1.jobserver-1/Linux-x86_64
/workspace/venv/centos7/bin
/usr/sbin
/usr/bin
/sbin
/bin
I think only the first two paths are really needed. The static lcg wrapper looked better already:
$ cat `which lcg-c++-11.1.0`
#!/bin/sh
export PATH=/cvmfs/lhcb.cern.ch/lib/lcg/releases/gcc/11.1.0/x86_64-centos7/bin:/cvmfs/lhcb.cern.ch/lib/lcg/releases/binutils/2.36.1-a9696/x86_64-centos7/bin${PATH:+:$PATH}
LD_LIBRARY_PATH=$(printenv LD_LIBRARY_PATH | sed 's-[^:]*/\(gcc\|llvm\|clang\)/[^:]*:\?--g')
export LD_LIBRARY_PATH=/cvmfs/lhcb.cern.ch/lib/lcg/releases/gcc/11.1.0/x86_64-centos7/lib64:/cvmfs/lhcb.cern.ch/lib/lcg/releases/binutils/2.36.1-a9696/x86_64-centos7/lib${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
exec /cvmfs/lhcb.cern.ch/lib/lcg/releases/gcc/11.1.0/x86_64-centos7/bin/c++ "$@"