icecc / icecream

Distributed compiler with a central scheduler to share build load
GNU General Public License v2.0
1.6k stars 252 forks source link

Do the installed symlinks need to be absolute? #611

Open Zalewa opened 1 year ago

Zalewa commented 1 year ago

Currently all the symbolic links that are installed with make install are absolute with the prefix dir being prepended to them.

$ find . -type l -exec echo -n {} '-> ' \; -exec readlink {} \;
./libexec/icecc/icecc-create-env -> /opt/icecc/icecream_debug_amd64/bin/icecc-create-env
./libexec/icecc/bin/g++ -> /opt/icecc/icecream_debug_amd64/bin/icecc
./libexec/icecc/bin/gcc -> /opt/icecc/icecream_debug_amd64/bin/icecc
./libexec/icecc/bin/cc -> /opt/icecc/icecream_debug_amd64/bin/icecc
./libexec/icecc/bin/clang -> /opt/icecc/icecream_debug_amd64/bin/icecc
./libexec/icecc/bin/clang++ -> /opt/icecc/icecream_debug_amd64/bin/icecc
./libexec/icecc/bin/c++ -> /opt/icecc/icecream_debug_amd64/bin/icecc
./bin/icerun -> /opt/icecc/icecream_debug_amd64/bin/icecc

Is there a reason they couldn't be relative, like this?

$ find . -type l -exec echo -n {} '-> ' \; -exec readlink {} \;
./libexec/icecc/icecc-create-env -> ../../bin/icecc-create-env
./libexec/icecc/bin/g++ -> ../../../bin/icecc
./libexec/icecc/bin/gcc -> ../../../bin/icecc
./libexec/icecc/bin/cc -> ../../../bin/icecc
./libexec/icecc/bin/clang -> ../../../bin/icecc
./libexec/icecc/bin/oko -> ../../../bin/icecc
./libexec/icecc/bin/clang++ -> ../../../bin/icecc
./libexec/icecc/bin/c++ -> ../../../bin/icecc
./bin/icerun -> icecc

I don't see drawbacks to this, and it would help make the package be more relocatable after make install.

coolo commented 1 year ago

Calculating relative symlinks in a portable way is harder. I bet there are autoconf macros to check if $LN_S supports --relative, you may want to look into it.