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

Gotcha passing relative paths to icecc-create-env #454

Closed jwatt closed 5 years ago

jwatt commented 5 years ago

Using icecream obtained via Homebrew on macOS, I tried to create a toolchain for from the clang 8.0 pre-built binaries from the clang website (I also tried 7.0, but had the same problem). I ran:

wget http://releases.llvm.org/8.0.0/clang+llvm-8.0.0-x86_64-apple-darwin.tar.xz
tar xvf clang+llvm-8.0.0-x86_64-apple-darwin.tar.xz
/usr/local/Cellar/icecream/1.2/libexec/icecc/icecc-create-env --clang ./clang+llvm-8.0.0-x86_64-apple-darwin/bin/clang /usr/local/Cellar/icecream/1.2/libexec/icecc/compilerwrapper

This does a lot of work and almost completes successfully, but just before the end this happens:

<snip>
adding file /usr/lib/dyld
adding file /usr/bin/gcc
adding file /usr/bin/g++
cp: /usr/bin/clang=clang+llvm-8.0.0-x86_64-apple-darwin/bin/clang: No such file or directory
md5: /tmp/iceccenvXpgCqn/usr/bin/clang=clang+llvm-8.0.0-x86_64-apple-darwin/bin/clang: No such file or directory
creating e73d7f938c400c359d12d935b3fc67a3.tar.gz
tar: usr/bin/clang=clang+llvm-8.0.0-x86_64-apple-darwin/bin/clang: Cannot stat: No such file or directory
tar: Error exit delayed from previous errors.
Couldn't create archive

It seems that the path to clang+llvm-8.0.0-x86_64-apple-darwin/bin/clang specified to icecc-create-env needs to be an absolute path to avoid this error.

Presumably this gotcha could be eliminated if icecc-create-env would fix up a relative path before using it internally. (Or by fixing the code that ends up resolving relative paths against the wrong directory, but I guess that may be less trivial.)

I originally filed this issue with Homebrew but apparently they don't customize icecream, so presumably it's an issue with the vanilla icecc-create-env script.

llunak commented 5 years ago

Fixed, thank you.