Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 763288 - can no longer use ccache for portage builds
Summary: can no longer use ccache for portage builds
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-03 16:14 UTC by Davyd McColl
Modified: 2021-01-05 21:27 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build log (build.log,4.75 KB, text/x-log)
2021-01-03 16:14 UTC, Davyd McColl
Details
ccache log (ccache.log,783.01 KB, text/x-log)
2021-01-03 16:14 UTC, Davyd McColl
Details
ccache config file (ccache.conf,374 bytes, text/plain)
2021-01-03 16:20 UTC, Davyd McColl
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Davyd McColl 2021-01-03 16:14:01 UTC
Created attachment 680908 [details]
build log

running `genlop -e ccache`, I can see that ccache was updated on my machine yesterday (Saturday 2 Jan 2021) from 3.7.12 to 4.1, and since then, all packages fail to build with one of the following errors:

- C compiler cannot create executables
- Unknown compiler(s): [['x86_64-pc-linux-gnu-gcc']]

disabling the ccache feature in make conf (or via FEATURES="-ccache" on the cli) allows builds to proceed successfully. An example is from `emerge -1 --verbose faac`, with logs attached.
Comment 1 Davyd McColl 2021-01-03 16:14:24 UTC
Created attachment 680911 [details]
ccache log
Comment 2 Davyd McColl 2021-01-03 16:17:57 UTC
I have also followed gentoo forum threads with similar errors, but none of the resolutions I've found help, including
- commenting out my CFLAGS in make.conf (currently '-march=native -O2')
- rebuilding & checking ldd config

and I can verify that the compiler x86_64-pc-linux-gnu-gcc not only exists (and is in the path), but that it can build simple c programs (well, being able to emerge updated packages also works, so I guess that should be a given).
Comment 3 Davyd McColl 2021-01-03 16:19:37 UTC
also, it was difficult for me to select the correct importance for this report -- technically it's a blocker because it blocks me from using ccache, but I can work around it.

I've also tried a clean ccache cache dir -- no change.
Comment 4 Davyd McColl 2021-01-03 16:20:53 UTC
Created attachment 680914 [details]
ccache config file
Comment 5 Jonas Stein gentoo-dev 2021-01-03 16:39:14 UTC
It is sad to read that you have problems with ccache. The situation seems to be a bit more complicate and requires some analysis.
We can not help you efficiently via bug tracker. The bug tracker aims rather on specific problems in .ebuilds and less on individual systems. 

I have had very good experience on the gentoo IRC [1] with questions like this. Of course there are also forums and mailing lists [2,3].
I hope you understand, that I will close the bug here therefore and wish you good luck on one of the mentioned channels [4].
Please reopen the ticket in order to provide an indication for an specific error in an ebuild or any gentoo related product.

[1] https://www.gentoo.org/get-involved/irc-channels/
[2] https://forums.gentoo.org/
[3] https://www.gentoo.org/get-involved/mailing-lists/all-lists.html
[4] https://www.gentoo.org/support/
Comment 6 Sergei Trofimovich (RETIRED) gentoo-dev 2021-01-03 20:51:35 UTC
Your `build.log` says that compiler is not runnable via `ccache`:

```
checking whether the C compiler works... no
configure: error: in `/var/tmp/portage/media-libs/faac-1.30/work/faac-1_30-abi_x86_32.x86':
configure: error: C compiler cannot create executables
See `config.log' for more details

!!! Please attach the following file when seeking support:
!!! /var/tmp/portage/media-libs/faac-1.30/work/faac-1_30-abi_x86_32.x86/config.log
```

Can you attach that file as well? Maybe it will tell you why things are broken.
Comment 7 Davyd McColl 2021-01-05 17:05:43 UTC
It appears that the problem stems from the following behavior:

1. running `emerge -1 {atom}` creates the ccache log file with 644 permissions, owned by root
2. running `emerge --update --newuse --changed-use --deep --changed-deps --keep-going @world` appears to create the file, also with 644 permissions, but as the user portage

So if (1) precedes (2), ccache cannot log and compilation fails. I've suggested at https://github.com/ccache/ccache/issues/767 that an inability to log should not break compilation, but it's also probably interesting that two similar emerge commands appear to be run as different users.

Personally, I've worked around the issue in my update wrapper script, but I haven't needed to for the last year or so that I've been using ccache, so somewhere along the line, there's a deviance in behavior. I'm not sure if I should be logging an issue elsewhere and would appreciate input.
Comment 8 Sergei Trofimovich (RETIRED) gentoo-dev 2021-01-05 21:27:10 UTC
I'd say `log_file = /tmp/ccache.log` is an invalid user configuration.

portage runs different phases by different users on purpose:
- pkg_* phases are usually ran by root as they usualy apply changes to the system (and sometimes happen to run a compiler)
- src_* phases are usually ran by portage user as all the changes should happen in $WORKDIR

If you configure a shared place got both users to log stuff you might have to configure an empty file and it's perimissions up-front (I'm assuming ccache would only append to the file, thus /etc/local.d/ might be good enough for it).