Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic toolchain packaging not working properly with gcc outputting relative paths #389

Closed
luser opened this issue Mar 4, 2019 · 0 comments · Fixed by #634
Closed

Comments

@luser
Copy link
Contributor

luser commented Mar 4, 2019

The code we landed in #321 doesn't seem to be working exactly right. I ran a simple test distributed compile on my Linux machine and got:

luser@eye7:/build$ /build/sccache/target/debug/sccache gcc -c hello.c -o hello.o
gcc: error trying to exec 'as': execvp: No such file or directory
Compiler killed by signal 1

Looking at the contents of the toolchain tar on disk shows that as is missing:

$ tar tzf /home/luser/sccache-dist/toolchains/tc/f/f/ff6b8de934e8d03f7bf720597e3f7818bf8e8f21288c6349273e480bd335caa564b7103a7ae2655e6b1f1702a440b4d2f8d212dd11c9c0e9cfcfc7e4be209d34
tmp
etc/ld.so.conf
lib/x86_64-linux-gnu/libc.so.6
lib/x86_64-linux-gnu/libdl.so.2
lib/x86_64-linux-gnu/libm.so.6
lib/x86_64-linux-gnu/libz.so.1
lib64/ld-linux-x86-64.so.2
usr/bin/gcc
usr/lib/gcc/x86_64-linux-gnu/7/cc1
usr/lib/gcc/x86_64-linux-gnu/7/cc1plus
usr/lib/gcc/x86_64-linux-gnu/7/liblto_plugin.so
usr/lib/x86_64-linux-gnu/libgmp.so.10
usr/lib/x86_64-linux-gnu/libisl.so.19
usr/lib/x86_64-linux-gnu/libmpc.so.3
usr/lib/x86_64-linux-gnu/libmpfr.so.6

If I look at an older toolchain tar I have that was created by icecc-create-env it does include as:

$ tar tzf /home/luser/sccache-dist/toolchains/tc/6/8/6805131d38b0c2b2f8cf967c15d96e2a5ce23d26cfbc4f60f2750b5f323a4cacffb1f96149e27be05ba927b7cec674e748e0efa1e06ce2eecda4673fd1060a5d
bin/true
etc/ld.so.cache
etc/ld.so.conf
lib/x86_64-linux-gnu/libc.so.6
lib/x86_64-linux-gnu/libdl.so.2
lib/x86_64-linux-gnu/libm.so.6
lib/x86_64-linux-gnu/libz.so.1
lib64/ld-linux-x86-64.so.2
usr/bin/as
usr/bin/cc1
usr/bin/cc1plus
usr/bin/g++
usr/bin/gcc
usr/bin/objcopy
usr/lib/gcc/x86_64-linux-gnu/7/liblto_plugin.so
usr/lib/x86_64-linux-gnu/libbfd-2.30-system.so
usr/lib/x86_64-linux-gnu/libgmp.so.10
usr/lib/x86_64-linux-gnu/libisl.so.19
usr/lib/x86_64-linux-gnu/libmpc.so.3
usr/lib/x86_64-linux-gnu/libmpfr.so.6
usr/lib/x86_64-linux-gnu/libopcodes-2.30-system.so

The sccache server's log output contains:

 INFO 2019-03-04T14:19:35Z: sccache::compiler::c: Generating toolchain /usr/bin/gcc
DEBUG 2019-03-04T14:19:35Z: sccache::compiler::c: find named prog as output:
as

===

DEBUG 2019-03-04T14:19:35Z: sccache::compiler::c: find named prog objcopy output:
objcopy

===

DEBUG 2019-03-04T14:19:35Z: sccache::compiler::c: find named prog cc1 output:
/usr/lib/gcc/x86_64-linux-gnu/7/cc1

===

DEBUG 2019-03-04T14:19:35Z: sccache::compiler::c: find named prog cc1plus output:
/usr/lib/gcc/x86_64-linux-gnu/7/cc1plus

===

DEBUG 2019-03-04T14:19:35Z: sccache::compiler::c: find named file specs output:
specs

===

DEBUG 2019-03-04T14:19:35Z: sccache::compiler::c: find named file liblto_plugin.so output:
/usr/lib/gcc/x86_64-linux-gnu/7/liblto_plugin.so

===

Looking at the code involved it runs gcc -print-prog-name=as, which on my system just prints as:

$ gcc -print-prog-name=as
as

The packaging code doesn't handle non-absolute paths here, which seems to be the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant