make: Entering directory '/var/tmp/portage/app-emulation/runc-1.0.0_rc6_p20181203-r1/work/runc-1.0.0_rc6_p20181203/src/github.com/opencontainers/runc' go build -buildmode=pie -ldflags "-X main.gitCommit=96ec2177ae841256168fcf76954f7177af9446eb -X main.version=1.0.0-rc6+dev " -tags "ambient seccomp" -o runc . failed to initialize build cache at /root/cache/go-build: mkdir /root/cache: permission denied make: *** [Makefile:30: runc] Error 1 make: Leaving directory '/var/tmp/portage/app-emulation/runc-1.0.0_rc6_p20181203-r1/work/runc-1.0.0_rc6_p20181203/src/github.com/opencontainers/runc' * ERROR: app-emulation/runc-1.0.0_rc6_p20181203-r1::gentoo failed (compile phase): ------------------------------------------------------------------- This is an unstable amd64 chroot image at a tinderbox (==build bot) name: 17.1-desktop-gnome_abi32+64_20190225-042012 ------------------------------------------------------------------- Please see the tracker bug for details. gcc-config -l: [1] x86_64-pc-linux-gnu-8.3.0 * Available Python interpreters, in order of preference: [1] python3.7 [2] python3.6 [3] python2.7 (fallback) [4] jython2.7 (fallback) Available Ruby profiles: [1] ruby24 (with Rubygems) * [2] ruby25 (with Rubygems) [3] ruby26 (with Rubygems) Available Rust versions: [1] rust-1.32.0 * java-config: The following VMs are available for generation-2: *) IcedTea JDK 3.10.0 [icedtea-bin-8] Available Java Virtual Machines: [1] icedtea-bin-8 system-vm emerge -qpvO app-emulation/runc [ebuild N ] app-emulation/runc-1.0.0_rc6_p20181203-r1 USE="ambient kmem seccomp -apparmor -hardened"
Created attachment 567134 [details] emerge-info.txt
Created attachment 567136 [details] app-emulation:runc-1.0.0_rc6_p20181203-r1:20190301-015852.log
Created attachment 567138 [details] emerge-history.txt
Created attachment 567140 [details] environment
Created attachment 567142 [details] etc.portage.tbz2
Created attachment 567144 [details] temp.tbz2
Bug is still present in app-emulation/runc-1.0.0_rc10, but it only manifests if I become root through 'su'. In this case, it looks like it is trying to use my users tmp directory for the cache. go build -buildmode=pie -ldflags "-X main.gitCommit=dc9208a3303feef5b3839f4323d9beb36df0a9dd -X main.version=1.0.0-rc10 " -tags "ambient seccomp" -o runc . failed to initialize build cache at /tmp/philippe/.cache/go-build: mkdir /tmp/philippe/.cache/go-build: permission denied When logged in as root, the problem disappears and I could successfully emerge runc. I get a similar issue in app-emulation/containerd-1.2.13 when 'su' is used.
I think the reason for why the tinderbox failed is because it has XDG_CACHE_HOME set to "/root/cache" which is read by go to determine the value of GOCACHE, leading to go to use an illegal path. https://github.com/golang/go/blob/47fb1fbd554a76dc961bfdedaa85efcb68646ed1/src/cmd/go/internal/cache/default.go#L60 https://github.com/golang/go/blob/master/src/os/file.go#L406 This error could be completely avoided by explicitly setting a valid GOCACHE path in golang-base eclass.
May it be closed in 1.0.0 version?