Skip to content
This repository has been archived by the owner on Jun 8, 2020. It is now read-only.

Fix CCACHE=sccache with recent sccache versions #180

Merged
merged 1 commit into from Oct 21, 2019
Merged

Conversation

SimonSapin
Copy link
Member

@SimonSapin SimonSapin commented Oct 20, 2019

Chosen part of the output with sccache 0.2.12:

error: failed to execute compile
caused by: Compiler not supported: "/usr/bin/ar: invalid option -- \'E\'\nUsage: /usr/bin/ar [emulation options] [-]{dmpqrstx}[abcDfilMNoPsSTuvV] [--plugin <name>] [member-name] [count] archive-file file...\n       /usr/bin/ar -M [<mri-script]\n commands:\n  d            - delete file(s) from the archive\n  m[ab]        - move file(s) in the archive\n  p            - print file(s) found in the archive\n  q[f]         - quick append file(s) to the archive\n  r[ab][f][u]  - replace existing or insert new file(s) into the archive\n  s            - act as ranlib\n  t            - display contents of archive\n  x[o]         - extract file(s) from the archive\n command specific modifiers:\n  [a]          - put file(s) after [member-name]\n  [b]          - put file(s) before [member-name] (same as [i])\n  [D]          - use zero for timestamps and uids/gids (default)\n  [U]          - use actual timestamps and uids/gids\n  [N]          - use instance [count] of name\n  [f]          - truncate inserted file names\n  [P]          - use full path names when matching\n  [o]          - preserve original dates\n  [u]          - only replace files that are newer than current archive contents\n generic modifiers:\n  [c]          - do not warn if the library had to be created\n  [s]          - create an archive index (cf. ranlib)\n  [S]          - do not build a symbol table\n  [T]          - make a thin archive\n  [v]          - be verbose\n  [V]          - display the version number\n  @<file>      - read options from <file>\n  --target=BFDNAME - specify the target object format as BFDNAME\n optional:\n  --plugin <p> - load the specified plugin\n emulation options: \n  No emulation specific options\n/usr/bin/ar: supported targets: elf64-x86-64 elf32-i386 elf32-iamcu elf32-x86-64 a.out-i386-linux pei-i386 pei-x86-64 elf64-l1om elf64-k1om elf64-little elf64-big elf32-little elf32-big pe-x86-64 pe-bigobj-x86-64 pe-i386 plugin srec symbolsrec verilog tekhex binary ihex\n"
make[2]: *** [libskia.a] Error 2
make[1]: *** [CMakeFiles/skia.dir/all] Error 2
make: *** [all] Error 2

CC servo/servo#24491

Chosen part of the output with sccache 0.2.12:

```
error: failed to execute compile
caused by: Compiler not supported: "/usr/bin/ar: invalid option -- \'E\'\nUsage: /usr/bin/ar [emulation options] [-]{dmpqrstx}[abcDfilMNoPsSTuvV] [--plugin <name>] [member-name] [count] archive-file file...\n       /usr/bin/ar -M [<mri-script]\n commands:\n  d            - delete file(s) from the archive\n  m[ab]        - move file(s) in the archive\n  p            - print file(s) found in the archive\n  q[f]         - quick append file(s) to the archive\n  r[ab][f][u]  - replace existing or insert new file(s) into the archive\n  s            - act as ranlib\n  t            - display contents of archive\n  x[o]         - extract file(s) from the archive\n command specific modifiers:\n  [a]          - put file(s) after [member-name]\n  [b]          - put file(s) before [member-name] (same as [i])\n  [D]          - use zero for timestamps and uids/gids (default)\n  [U]          - use actual timestamps and uids/gids\n  [N]          - use instance [count] of name\n  [f]          - truncate inserted file names\n  [P]          - use full path names when matching\n  [o]          - preserve original dates\n  [u]          - only replace files that are newer than current archive contents\n generic modifiers:\n  [c]          - do not warn if the library had to be created\n  [s]          - create an archive index (cf. ranlib)\n  [S]          - do not build a symbol table\n  [T]          - make a thin archive\n  [v]          - be verbose\n  [V]          - display the version number\n  @<file>      - read options from <file>\n  --target=BFDNAME - specify the target object format as BFDNAME\n optional:\n  --plugin <p> - load the specified plugin\n emulation options: \n  No emulation specific options\n/usr/bin/ar: supported targets: elf64-x86-64 elf32-i386 elf32-iamcu elf32-x86-64 a.out-i386-linux pei-i386 pei-x86-64 elf64-l1om elf64-k1om elf64-little elf64-big elf32-little elf32-big pe-x86-64 pe-bigobj-x86-64 pe-i386 plugin srec symbolsrec verilog tekhex binary ihex\n"
make[2]: *** [libskia.a] Error 2
make[1]: *** [CMakeFiles/skia.dir/all] Error 2
make: *** [all] Error 2
```
@SimonSapin
Copy link
Member Author

I don’t really understand the issue, but not using sccache for linking seems to fix the issue while keeping most of the benefits of caching during compilation.

Copy link
Member

@emilio emilio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good but it seems it may be worth having an upstream issue about this? Specially if it used to work.

@SimonSapin
Copy link
Member Author

On principle yes, but I have no idea how RULE_LAUNCH_LINK, sccache, and /usr/bin/ar all interact together. So it looks like non-trivial investigation would be needed before getting at expected/actual behavior of sccache as appropriate for a bug report :/

@emilio
Copy link
Member

emilio commented Oct 20, 2019

After a quick DuckDuckGo search looks like we're not the only ones with this issue: EOSIO/eosio.cdt@d70cfd0

@emilio
Copy link
Member

emilio commented Oct 20, 2019

Filed mozilla/sccache#550

@emilio
Copy link
Member

emilio commented Oct 20, 2019

ccache seems to just forward everything that doesn't quack as a compiler I guess:

$ ccache echo "foo"
foo

@SimonSapin
Copy link
Member Author

@bors-servo r=emilio

@bors-servo
Copy link

📌 Commit 6fbeaf8 has been approved by emilio

@bors-servo
Copy link

⌛ Testing commit 6fbeaf8 with merge fe8b4c7...

bors-servo pushed a commit that referenced this pull request Oct 21, 2019
Fix `CCACHE=sccache` with recent sccache versions

Chosen part of the output with sccache 0.2.12:

```
error: failed to execute compile
caused by: Compiler not supported: "/usr/bin/ar: invalid option -- \'E\'\nUsage: /usr/bin/ar [emulation options] [-]{dmpqrstx}[abcDfilMNoPsSTuvV] [--plugin <name>] [member-name] [count] archive-file file...\n       /usr/bin/ar -M [<mri-script]\n commands:\n  d            - delete file(s) from the archive\n  m[ab]        - move file(s) in the archive\n  p            - print file(s) found in the archive\n  q[f]         - quick append file(s) to the archive\n  r[ab][f][u]  - replace existing or insert new file(s) into the archive\n  s            - act as ranlib\n  t            - display contents of archive\n  x[o]         - extract file(s) from the archive\n command specific modifiers:\n  [a]          - put file(s) after [member-name]\n  [b]          - put file(s) before [member-name] (same as [i])\n  [D]          - use zero for timestamps and uids/gids (default)\n  [U]          - use actual timestamps and uids/gids\n  [N]          - use instance [count] of name\n  [f]          - truncate inserted file names\n  [P]          - use full path names when matching\n  [o]          - preserve original dates\n  [u]          - only replace files that are newer than current archive contents\n generic modifiers:\n  [c]          - do not warn if the library had to be created\n  [s]          - create an archive index (cf. ranlib)\n  [S]          - do not build a symbol table\n  [T]          - make a thin archive\n  [v]          - be verbose\n  [V]          - display the version number\n  @<file>      - read options from <file>\n  --target=BFDNAME - specify the target object format as BFDNAME\n optional:\n  --plugin <p> - load the specified plugin\n emulation options: \n  No emulation specific options\n/usr/bin/ar: supported targets: elf64-x86-64 elf32-i386 elf32-iamcu elf32-x86-64 a.out-i386-linux pei-i386 pei-x86-64 elf64-l1om elf64-k1om elf64-little elf64-big elf32-little elf32-big pe-x86-64 pe-bigobj-x86-64 pe-i386 plugin srec symbolsrec verilog tekhex binary ihex\n"
make[2]: *** [libskia.a] Error 2
make[1]: *** [CMakeFiles/skia.dir/all] Error 2
make: *** [all] Error 2
```

CC servo/servo#24491
@bors-servo
Copy link

☀️ Test successful - checks-travis
Approved by: emilio
Pushing fe8b4c7 to master...

@bors-servo bors-servo merged commit 6fbeaf8 into master Oct 21, 2019
SimonSapin added a commit to servo/servo that referenced this pull request Oct 21, 2019
SimonSapin added a commit to servo/servo that referenced this pull request Oct 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants