Debian Bug report logs - #666525
pbuilder fails to create directory under ccache when run with sudo

version graph

Package: pbuilder; Maintainer for pbuilder is Debian pbuilder maintenance team <pbuilder-maint@lists.alioth.debian.org>; Source for pbuilder is src:pbuilder.

Reported by: Praveen A <pravi.a@gmail.com>

Date: Sat, 31 Mar 2012 13:51:02 UTC

Severity: important

Tags: patch

Merged with 670651, 675691, 675843

Found in versions pbuilder/0.211, pbuilder/0.215, pbuilder/0.210, 0.206~bpo60+1

Fixed in version pbuilder/0.212

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Debian pbuilder maintenance team <pbuilder-maint@lists.alioth.debian.org>:
Bug#666525; Package pbuilder. (Sat, 31 Mar 2012 13:51:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Praveen A <pravi.a@gmail.com>:
New Bug report received and forwarded. Copy sent to Debian pbuilder maintenance team <pbuilder-maint@lists.alioth.debian.org>. (Sat, 31 Mar 2012 13:51:05 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Praveen A <pravi.a@gmail.com>
To: submit@bugs.debian.org
Subject: pbuilder fails to create directory under ccash when run with sudo
Date: Sat, 31 Mar 2012 19:19:00 +0530
package: pbuilder
severity: normal
version: 0.210

It was working properly earlier before I updated it two days back. Now
it works if I use su instead of sudo. It failed a few times.

error I get is
ccache: FATAL: Failed to create
/media/forge/debian/pbuilder/ccache/0/3: Permission denied

my .pbuilderrc is

BASETGZ=/media/forge/debian/pbuilder/sid-base.tgz
BUILDPLACE=/media/forge/debian/pbuilder/build
CCACHEDIR=/media/forge/debian/pbuilder/ccache
BASEPATH=/media/forge/debian/pbuilder/base.cow
COWBUILDER_BASE=/media/forge/debian/pbuilder/
DISTRIBUTION=sid
BUILDRESULT=/media/forge/debian/pbuilder/results
APTCACHE=/media/forge/debian/pbuilder/aptcache
AUTOCLEANAPTCACHE=yes

/dev/sdb2 on /media/forge type ext3
(rw,nosuid,relatime,errors=continue,barrier=1,data=ordered,uhelper=udisks)

It is on an external usb drive.
-- 
പ്രവീണ്‍ അരിമ്പ്രത്തൊടിയില്‍
You have to keep reminding your government that you don't get your
rights from them; you give them permission to rule, only so long as
they follow the rules: laws and constitution.




Information forwarded to debian-bugs-dist@lists.debian.org, Debian pbuilder maintenance team <pbuilder-maint@lists.alioth.debian.org>:
Bug#666525; Package pbuilder. (Sun, 19 Aug 2012 14:48:11 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jurij Smakov <jurij@wooyd.org>:
Extra info received and forwarded to list. Copy sent to Debian pbuilder maintenance team <pbuilder-maint@lists.alioth.debian.org>. (Sun, 19 Aug 2012 14:48:11 GMT) Full text and rfc822 format available.

Message #10 received at 666525@bugs.debian.org (full text, mbox):

From: Jurij Smakov <jurij@wooyd.org>
To: 666525@bugs.debian.org
Subject: Bumping severity to RC
Date: Sun, 19 Aug 2012 15:47:31 +0100
retitle 666525 pbuilder fails to create directory under ccache when run with sudo
severity 666525 serious
thanks

Hello,

I just ran into this bug. On a freshly installed testing system I ran

sudo pbuilder --create --distribution sid --mirror http://ftp.ie.debian.org/debian 

and then ran a build with:

sudo pbuilder build *.dsc

Package build gets to the compilation stage and fails with error 
messages:

[...]
gcc -m32 -Os -Wall -I. -I../include -fomit-frame-pointer -fno-strict-aliasing -DSMALL_RELOC=0x280000 -DLARGE_RELOC=0x380000 -fno-stack-protector -c printf.c
ccache: FATAL: Failed to create /var/cache/pbuilder/ccache/a/c: Permission denied
make[2]: *** [printf.o] Error 1
make[2]: Leaving directory `/tmp/buildd/silo-1.4.14+git20120819/build-tree/common'
make[1]: *** [all] Error 1
make[1]: Leaving directory `/tmp/buildd/silo-1.4.14+git20120819/build-tree'
make: *** [build-stamp] Error 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2

Here are the permissions of relevant directories:

jurij@debian:~$ ls -la /var/cache/pbuilder/
total 93404
drwxr-xr-x  9 root root     4096 Aug 19 15:12 .
drwxr-xr-x 10 root root     4096 Aug 19 13:44 ..
drwxr-xr-x  2 root root    12288 Aug 19 15:17 aptcache
-rw-r--r--  1 root root 95597991 Aug 19 15:12 base.tgz
drwxr-xr-x  2 root root     4096 Aug 19 15:17 build
drwxr-xr-x 12 1234 1234     4096 Aug 19 15:17 ccache
drwxr-xr-x  2 root root     4096 May 30 11:04 pbuildd
drwxr-xr-x  2 root root     4096 May 30 11:04 pbuilder-mnt
drwxr-xr-x  2 root root     4096 May 30 11:04 pbuilder-umlresult
drwxr-xr-x  2 root root     4096 May 30 11:04 result
jurij@debian:~$ ls -la /var/cache/pbuilder/ccache/
total 52
drwxr-xr-x 12 1234 1234 4096 Aug 19 15:17 .
drwxr-xr-x  9 root root 4096 Aug 19 15:12 ..
drwxr-xr-x  2 1234 1234 4096 Aug 19 15:17 1
drwxr-xr-x  2 1234 1234 4096 Aug 19 15:17 3
drwxr-xr-x  2 1234 1234 4096 Aug 19 15:17 4
drwxr-xr-x  2 1234 1234 4096 Aug 19 15:17 5
drwxr-xr-x  2 1234 1234 4096 Aug 19 15:17 8
drwxr-xr-x  2 1234 1234 4096 Aug 19 15:17 9
drwxr-xr-x  2 root root 4096 Aug 19 15:14 a
drwxr-xr-x  2 1234 1234 4096 Aug 19 15:17 b
-rw-r--r--  1 root root  190 Aug 19 15:14 CACHEDIR.TAG
drwxr-xr-x  2 1234 1234 4096 Aug 19 15:17 e
drwxr-xr-x  2 root root 4096 Aug 19 15:14 tmp
jurij@debian:~$ 

I don't think it's acceptable to release a package which fails a basic 
operation with default settings (I did not create or modify 
~/.pbuilderrc or any other related configuration files), hence the RC 
severity. Looking around, I see a number of discussions mentioning 
similar problems, for example:

http://lists.debian.org/debian-devel/2012/05/msg00223.html

In case it matters, these tests were carried out on a sparc system.

Best regards,
-- 
Jurij Smakov                                           jurij@wooyd.org
Key: http://www.wooyd.org/pgpkey/                      KeyID: C99E03CC



Changed Bug title to 'pbuilder fails to create directory under ccache when run with sudo' from 'pbuilder fails to create directory under ccash when run with sudo' Request was from Jurij Smakov <jurij@wooyd.org> to control@bugs.debian.org. (Sun, 19 Aug 2012 14:48:12 GMT) Full text and rfc822 format available.

Severity set to 'serious' from 'normal' Request was from Jurij Smakov <jurij@wooyd.org> to control@bugs.debian.org. (Sun, 19 Aug 2012 14:48:13 GMT) Full text and rfc822 format available.

Marked as found in versions pbuilder/0.211. Request was from Jurij Smakov <jurij@wooyd.org> to control@bugs.debian.org. (Sun, 19 Aug 2012 14:57:06 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Debian pbuilder maintenance team <pbuilder-maint@lists.alioth.debian.org>:
Bug#666525; Package pbuilder. (Sat, 08 Sep 2012 18:33:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Maximiliano Curia <maxy@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian pbuilder maintenance team <pbuilder-maint@lists.alioth.debian.org>. (Sat, 08 Sep 2012 18:33:04 GMT) Full text and rfc822 format available.

Message #21 received at 666525@bugs.debian.org (full text, mbox):

From: Maximiliano Curia <maxy@debian.org>
To: 666525@bugs.debian.org, 666525-submitter@bugs.debian.org
Subject: RE: pbuilder fails to create directory under ccache when run with sudo
Date: Sat, 8 Sep 2012 20:28:28 +0200
Hello.

Well, after a few tries I could reproduce this problem, I'm sure there
are multiple ways this problem would present itself but normally is
easier to find the problem once you have a reproducible path.

With a pbuilder version 0.212 you need to enable ccache, that implies adding:
CCACHEDIR="/var/cache/pbuilder/ccache"
to the /etc/pbuilderrc file

1 - Delete /var/cache/pbuilder
2 - # pbuilder --create
3 - try to build the current elfutils package (not every package fails).

This fails with the error reported in the bug.

The workaround is:

1 - Check that /var/cache/pbuilder/ccache exists, and if doesn't create it.
2 - Run pbuilder --update
3 - Try building elfutils again. If it fails, run pbuilder --update once again.

This will fix the problem (but not the bug!!)



Message sent on to Praveen A <pravi.a@gmail.com>:
Bug#666525. (Sat, 08 Sep 2012 18:33:12 GMT) Full text and rfc822 format available.

Marked as fixed in versions 0.212/. Request was from Junichi Uekawa <dancer@netfort.gr.jp> to control@bugs.debian.org. (Tue, 11 Sep 2012 09:45:03 GMT) Full text and rfc822 format available.

Marked as fixed in versions pbuilder/0.212. Request was from Junichi Uekawa <dancer@netfort.gr.jp> to control@bugs.debian.org. (Tue, 11 Sep 2012 09:45:08 GMT) Full text and rfc822 format available.

Marked as found in versions 0.206~bpo60+1. Request was from Junichi Uekawa <dancer@netfort.gr.jp> to control@bugs.debian.org. (Tue, 11 Sep 2012 09:45:09 GMT) Full text and rfc822 format available.

Merged 666525 670651 675691 675843 Request was from Junichi Uekawa <dancer@netfort.gr.jp> to control@bugs.debian.org. (Tue, 11 Sep 2012 09:45:12 GMT) Full text and rfc822 format available.

No longer marked as fixed in versions 0.212/. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Fri, 21 Sep 2012 18:27:59 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Debian pbuilder maintenance team <pbuilder-maint@lists.alioth.debian.org>:
Bug#666525; Package pbuilder. (Fri, 21 Sep 2012 19:54:29 GMT) Full text and rfc822 format available.

Acknowledgement sent to owner@bugs.debian.org:
Extra info received and forwarded to list. Copy sent to Debian pbuilder maintenance team <pbuilder-maint@lists.alioth.debian.org>. (Fri, 21 Sep 2012 19:54:29 GMT) Full text and rfc822 format available.

Message #39 received at 666525@bugs.debian.org (full text, mbox):

From: Don Armstrong <don@debian.org>
To: 666525@bugs.debian.org
Subject: Wrong versions fixed in bug 666525
Date: Fri, 21 Sep 2012 12:50:59 -0700
This bug (666525) had an incorrect found or fixed version which was
caused by 686106. I have removed the incorrect found or fixed version,
and added it back as a correct version. [This was the source of the
internal messages which you have received previously.]

If you have any questions, please contact owner@bugs.debian.org

Don Armstrong




Information forwarded to debian-bugs-dist@lists.debian.org, Debian pbuilder maintenance team <pbuilder-maint@lists.alioth.debian.org>:
Bug#666525; Package pbuilder. (Sun, 18 Aug 2013 13:54:09 GMT) Full text and rfc822 format available.

Acknowledgement sent to Yann Dirson <ydirson@free.fr>:
Extra info received and forwarded to list. Copy sent to Debian pbuilder maintenance team <pbuilder-maint@lists.alioth.debian.org>. (Sun, 18 Aug 2013 13:54:09 GMT) Full text and rfc822 format available.

Message #44 received at 666525@bugs.debian.org (full text, mbox):

From: Yann Dirson <ydirson@free.fr>
To: 666525@bugs.debian.org, control@bugs.debian.org
Subject: Bug#666525: not fixed yet in pbuilder 0.215
Date: Sun, 18 Aug 2013 15:50:51 +0200
found 666525 pbuilder/0.215
thanks

I regularly got in the previous weeks, when working on gcompris, qgo,
and today with tagua:

[ 36%] Building CXX object src/CMakeFiles/tagua.dir/hlvariant/minichess5/variant.o
ccache: FATAL: Failed to create /work/pbuilder/ccache/b/0: Permission denied
make[3]: *** [src/CMakeFiles/tagua.dir/hlvariant/minichess5/variant.o] Error 1


Trying to avoid the problem, I had just regenerated by base.tgz from
scratch, but it obviously did not help.

I am using the "shell on failure" hook from
http://bazaar.launchpad.net/%7Ekubuntu-members/pbuilder/pbuilder-hooks/,
which helps me see what's wrong:

# ls -l /work/pbuilder/ccache
total 72
drwxr-xr-x 6 pbuilder pbuilder 4096 Aug 18 13:30 0
...
drwxr-xr-x 5 pbuilder pbuilder 4096 Aug 18 13:30 9
-rw-r--r-- 1 root     root      190 Aug 18 13:22 CACHEDIR.TAG
drwxr-xr-x 5 pbuilder pbuilder 4096 Aug 18 13:30 a
drwxr-xr-x 2 root     root     4096 Aug 18 13:22 b
drwxr-xr-x 5 pbuilder pbuilder 4096 Aug 18 13:30 c
drwxr-xr-x 3 pbuilder pbuilder 4096 Aug 18 13:30 d
drwxr-xr-x 9 pbuilder pbuilder 4096 Aug 18 13:30 e
drwxr-xr-x 3 pbuilder pbuilder 4096 Aug 18 13:30 f
drwxr-xr-x 2 root     root     4096 Aug 18 13:22 tmp

The workaround I use is very far from satisfactory, but far less
costly than rerunning the build from scratch: from the hook's shell
run:

        chown -R pbuilder.pbuilder /work/pbuilder/ccache

then let the build go on:

     dpkg-buildpackage -us -uc -nc

... and manually copy the generated files from the chroot before
exiting the shell.



Marked as found in versions pbuilder/0.215. Request was from Yann Dirson <ydirson@free.fr> to control@bugs.debian.org. (Sun, 18 Aug 2013 13:54:20 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Debian pbuilder maintenance team <pbuilder-maint@lists.alioth.debian.org>:
Bug#666525; Package pbuilder. (Sun, 25 Aug 2013 21:18:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Yann Dirson <ydirson@free.fr>:
Extra info received and forwarded to list. Copy sent to Debian pbuilder maintenance team <pbuilder-maint@lists.alioth.debian.org>. (Sun, 25 Aug 2013 21:18:05 GMT) Full text and rfc822 format available.

Message #51 received at 666525@bugs.debian.org (full text, mbox):

From: Yann Dirson <ydirson@free.fr>
To: 666525@bugs.debian.org
Subject: Bug#666525: culprit located as dpkg-architecture ?
Date: Sun, 25 Aug 2013 23:14:49 +0200
[Message part 1 (text/plain, inline)]
Running a build with systemtap set to intercept:
* calls to mkdir() as root under ccache
* mkdir failures with EACCESS

... reveals quite constant shape of the process tree leading to the
suspect mkdir's, and strong correlation with the EACCESS problems (and
with the actual ccache subdirs owned by root, as expected):

$ stap /work/yann/deb/cssc/mkdir.stap
go...
mkdir /work/pbuilder/ccache/tmp
process traceback:
  gcc(32018) sh(32017) dpkg-architectu(32016) pbuilder-satisf(32015) pbuilder-satisf(32014) pbuilder-buildp(30987) pbuilder(30986) sudo(30985) pdebuild(29971) bash(4485) screen(4306)
mkdir /work/pbuilder/ccache/2
process traceback:
  gcc(32018) sh(32017) dpkg-architectu(32016) pbuilder-satisf(32015) pbuilder-satisf(32014) pbuilder-buildp(30987) pbuilder(30986) sudo(30985) pdebuild(29971) bash(4485) screen(4306)
mkdir /work/pbuilder/ccache/2/4 => EACCESS
mkdir /work/pbuilder/ccache/2/5 => EACCESS
mkdir /work/pbuilder/ccache/2/d => EACCESS
mkdir /work/pbuilder/ccache/2/6 => EACCESS
mkdir /work/pbuilder/ccache/2/e => EACCESS
mkdir /work/pbuilder/ccache/2/e => EACCESS
...


dpkg-architecture launching gcc ?  Now that's a funny surprise :)

I hope this information will be of some help...
[mkdir.stap (text/plain, attachment)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian pbuilder maintenance team <pbuilder-maint@lists.alioth.debian.org>:
Bug#666525; Package pbuilder. (Thu, 29 Aug 2013 22:06:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Yann Dirson <ydirson@free.fr>:
Extra info received and forwarded to list. Copy sent to Debian pbuilder maintenance team <pbuilder-maint@lists.alioth.debian.org>. (Thu, 29 Aug 2013 22:06:04 GMT) Full text and rfc822 format available.

Message #56 received at 666525@bugs.debian.org (full text, mbox):

From: Yann Dirson <ydirson@free.fr>
To: 666525@bugs.debian.org, ccache@packages.debian.org
Subject: Re: Bug#666525: trying to disable ccache locally, failing
Date: Fri, 30 Aug 2013 00:03:09 +0200
By tuning the stap script to SIGSTOP the offending process, we can get
a much better view of the situation - here using pstree:

pbuilder,4611 /usr/sbin/pbuilder --build --buildresult .. --debbuildopts  --debbuildopts -i ../cssc_1.3.0-1.dsc
  └─pbuilder-buildp,4612 /usr/lib/pbuilder/pbuilder-buildpackage --buildresult .. --debbuildopts  --debbuildopts -i ../cssc_1.3.0-1.dsc
      └─pbuilder-satisf,5767 /usr/lib/pbuilder/pbuilder-satisfydepends --control ../cssc_1.3.0-1.dsc --chroot /work/pbuilder/build//4612 --internal-chrootexec chroot /work/pbuilder/build//4612  --binary-all
          └─pbuilder-satisf,5768 /usr/lib/pbuilder/pbuilder-satisfydepends --control ../cssc_1.3.0-1.dsc --chroot /work/pbuilder/build//4612 --internal-chrootexec chroot /work/pbuilder/build//4612  --binary-all
              └─dpkg-architectu,5769 /usr/bin/dpkg-architecture -qDEB_HOST_ARCH
                  └─sh,5770 -c ${CC:-gcc} -dumpmachine
                      └─gcc,5771 -dumpmachine

A quick test can be done of reqesting disabling of ccache while calling dpkg-architecture.

Test:

--- /usr/lib/pbuilder/pbuilder-satisfydepends.orig      2013-08-29 23:34:32.000000000 +0200
+++ /usr/lib/pbuilder/pbuilder-satisfydepends   2013-08-29 23:36:23.000000000 +0200
@@ -59,7 +59,7 @@
 
 function checkbuilddep_internal () {
 # Use this function to fulfill the dependency (almost)
-    local ARCH=$($CHROOTEXEC dpkg-architecture -qDEB_HOST_ARCH)
+    local ARCH=$($CHROOTEXEC env CCACHE_DISABLE=1 dpkg-architecture -qDEB_HOST_ARCH)
     local BUILD_DEP_DEB_DIR
     local BUILD_DEP_DEB_CONTROL
     local DEPENDS

For some reason, the stap script still traps a mkdir done as root,
while I can check through /proc that dpkg-architecture and gcc do have
CCACHE_DISABLE=1 in their env.

Another try: if ccache ignores the disable request, maybe we can ask
it not to touch the cache ?

--- /usr/lib/pbuilder/pbuilder-satisfydepends.orig      2013-08-29 23:34:32.000000000 +0200
+++ /usr/lib/pbuilder/pbuilder-satisfydepends   2013-08-29 23:56:48.000000000 +0200
@@ -59,7 +59,7 @@
 
 function checkbuilddep_internal () {
 # Use this function to fulfill the dependency (almost)
-    local ARCH=$($CHROOTEXEC dpkg-architecture -qDEB_HOST_ARCH)
+    local ARCH=$($CHROOTEXEC env CCACHE_READONLY=1 CCACHE_TEMPDIR=${TMPDIR:-/tmp} dpkg-architecture -qDEB_HOST_ARCH)
     local BUILD_DEP_DEB_DIR
     local BUILD_DEP_DEB_CONTROL
     local DEPENDS

... but similarly, ccache seems to ignore the request, which can be
seen in the processes' env.


Is there some ccache subtlety I'm missing ?  Could ccache maints lend a hand here ?

Best regards,
-- 
Yann



Information forwarded to debian-bugs-dist@lists.debian.org, Debian pbuilder maintenance team <pbuilder-maint@lists.alioth.debian.org>:
Bug#666525; Package pbuilder. (Sat, 31 Aug 2013 16:45:18 GMT) Full text and rfc822 format available.

Acknowledgement sent to Joel Rosdahl <joel@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian pbuilder maintenance team <pbuilder-maint@lists.alioth.debian.org>. (Sat, 31 Aug 2013 16:45:18 GMT) Full text and rfc822 format available.

Message #61 received at 666525@bugs.debian.org (full text, mbox):

From: Joel Rosdahl <joel@debian.org>
To: Yann Dirson <ydirson@free.fr>
Cc: 666525@bugs.debian.org, ccache@packages.debian.org
Subject: Re: Bug#666525: trying to disable ccache locally, failing
Date: Sat, 31 Aug 2013 18:42:01 +0200
[Message part 1 (text/plain, inline)]
Hi,

> ccache seems to ignore the request [...] Is there some ccache subtlety
I'm missing?

ccache doesn't ignore the request, it just happens to make sure that the
ccache directory exists before reacting to CCACHE_DISABLE (or
CCACHE_READONLY)... Looks like it has been that way since day one (well,
day two, actually:
http://gitweb.samba.org/?p=ccache.git;a=commit;h=10920460b5b00b77316602eb4e7c998a80464a88
).

I've fixed the bug now (upstream), but there's no workaround in currently
released ccache versions, I'm afraid.

-- Joel


On 30 August 2013 00:03, Yann Dirson <ydirson@free.fr> wrote:

> By tuning the stap script to SIGSTOP the offending process, we can get
> a much better view of the situation - here using pstree:
>
> pbuilder,4611 /usr/sbin/pbuilder --build --buildresult .. --debbuildopts
>  --debbuildopts -i ../cssc_1.3.0-1.dsc
>   └─pbuilder-buildp,4612 /usr/lib/pbuilder/pbuilder-buildpackage
> --buildresult .. --debbuildopts  --debbuildopts -i ../cssc_1.3.0-1.dsc
>       └─pbuilder-satisf,5767 /usr/lib/pbuilder/pbuilder-satisfydepends
> --control ../cssc_1.3.0-1.dsc --chroot /work/pbuilder/build//4612
> --internal-chrootexec chroot /work/pbuilder/build//4612  --binary-all
>           └─pbuilder-satisf,5768 /usr/lib/pbuilder/pbuilder-satisfydepends
> --control ../cssc_1.3.0-1.dsc --chroot /work/pbuilder/build//4612
> --internal-chrootexec chroot /work/pbuilder/build//4612  --binary-all
>               └─dpkg-architectu,5769 /usr/bin/dpkg-architecture
> -qDEB_HOST_ARCH
>                   └─sh,5770 -c ${CC:-gcc} -dumpmachine
>                       └─gcc,5771 -dumpmachine
>
> A quick test can be done of reqesting disabling of ccache while calling
> dpkg-architecture.
>
> Test:
>
> --- /usr/lib/pbuilder/pbuilder-satisfydepends.orig      2013-08-29
> 23:34:32.000000000 +0200
> +++ /usr/lib/pbuilder/pbuilder-satisfydepends   2013-08-29
> 23:36:23.000000000 +0200
> @@ -59,7 +59,7 @@
>
>  function checkbuilddep_internal () {
>  # Use this function to fulfill the dependency (almost)
> -    local ARCH=$($CHROOTEXEC dpkg-architecture -qDEB_HOST_ARCH)
> +    local ARCH=$($CHROOTEXEC env CCACHE_DISABLE=1 dpkg-architecture
> -qDEB_HOST_ARCH)
>      local BUILD_DEP_DEB_DIR
>      local BUILD_DEP_DEB_CONTROL
>      local DEPENDS
>
> For some reason, the stap script still traps a mkdir done as root,
> while I can check through /proc that dpkg-architecture and gcc do have
> CCACHE_DISABLE=1 in their env.
>
> Another try: if ccache ignores the disable request, maybe we can ask
> it not to touch the cache ?
>
> --- /usr/lib/pbuilder/pbuilder-satisfydepends.orig      2013-08-29
> 23:34:32.000000000 +0200
> +++ /usr/lib/pbuilder/pbuilder-satisfydepends   2013-08-29
> 23:56:48.000000000 +0200
> @@ -59,7 +59,7 @@
>
>  function checkbuilddep_internal () {
>  # Use this function to fulfill the dependency (almost)
> -    local ARCH=$($CHROOTEXEC dpkg-architecture -qDEB_HOST_ARCH)
> +    local ARCH=$($CHROOTEXEC env CCACHE_READONLY=1
> CCACHE_TEMPDIR=${TMPDIR:-/tmp} dpkg-architecture -qDEB_HOST_ARCH)
>      local BUILD_DEP_DEB_DIR
>      local BUILD_DEP_DEB_CONTROL
>      local DEPENDS
>
> ... but similarly, ccache seems to ignore the request, which can be
> seen in the processes' env.
>
>
> Is there some ccache subtlety I'm missing ?  Could ccache maints lend a
> hand here ?
>
> Best regards,
> --
> Yann
>
>
[Message part 2 (text/html, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian pbuilder maintenance team <pbuilder-maint@lists.alioth.debian.org>:
Bug#666525; Package pbuilder. (Mon, 02 Sep 2013 20:51:10 GMT) Full text and rfc822 format available.

Acknowledgement sent to Yann Dirson <ydirson@free.fr>:
Extra info received and forwarded to list. Copy sent to Debian pbuilder maintenance team <pbuilder-maint@lists.alioth.debian.org>. (Mon, 02 Sep 2013 20:51:10 GMT) Full text and rfc822 format available.

Message #66 received at 666525@bugs.debian.org (full text, mbox):

From: Yann Dirson <ydirson@free.fr>
To: Joel Rosdahl <joel@debian.org>
Cc: 666525@bugs.debian.org, ccache@packages.debian.org, control@bugs.debian.org
Subject: Re: Bug#666525: trying to disable ccache locally, failing
Date: Mon, 2 Sep 2013 22:48:15 +0200
tags 666525 + patch
thanks

On Sat, Aug 31, 2013 at 06:42:01PM +0200, Joel Rosdahl wrote:
> Hi,
> 
> > ccache seems to ignore the request [...] Is there some ccache subtlety
> I'm missing?
> 
> ccache doesn't ignore the request, it just happens to make sure that the
> ccache directory exists before reacting to CCACHE_DISABLE (or
> CCACHE_READONLY)... Looks like it has been that way since day one (well,
> day two, actually:
> http://gitweb.samba.org/?p=ccache.git;a=commit;h=10920460b5b00b77316602eb4e7c998a80464a88
> ).
> 
> I've fixed the bug now (upstream), but there's no workaround in currently
> released ccache versions, I'm afraid.

Well, here is one that, although arguably kludgy, does works for me:
simply forcing the dpkg-architecture run to write somewhere else.

--- /usr/lib/pbuilder/pbuilder-satisfydepends.orig      2013-08-29 23:34:32.000000000 +0200
+++ /usr/lib/pbuilder/pbuilder-satisfydepends   2013-08-31 19:35:14.000000000 +0200
@@ -59,7 +59,7 @@
 
 function checkbuilddep_internal () {
 # Use this function to fulfill the dependency (almost)
-    local ARCH=$($CHROOTEXEC dpkg-architecture -qDEB_HOST_ARCH)
+    local ARCH=$($CHROOTEXEC env CCACHE_DIR=${TMPDIR:-/tmp}/faraway/ccache dpkg-architecture -qDEB_HOST_ARCH)
     local BUILD_DEP_DEB_DIR
     local BUILD_DEP_DEB_CONTROL
     local DEPENDS



Added tag(s) patch. Request was from Yann Dirson <ydirson@free.fr> to control@bugs.debian.org. (Mon, 02 Sep 2013 20:51:13 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Debian pbuilder maintenance team <pbuilder-maint@lists.alioth.debian.org>:
Bug#666525; Package pbuilder. (Sun, 06 Oct 2013 12:15:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ivo De Decker <ivo.dedecker@ugent.be>:
Extra info received and forwarded to list. Copy sent to Debian pbuilder maintenance team <pbuilder-maint@lists.alioth.debian.org>. (Sun, 06 Oct 2013 12:15:04 GMT) Full text and rfc822 format available.

Message #73 received at 666525@bugs.debian.org (full text, mbox):

From: Ivo De Decker <ivo.dedecker@ugent.be>
To: Yann Dirson <ydirson@free.fr>
Cc: Joel Rosdahl <joel@debian.org>, 666525@bugs.debian.org, ccache@packages.debian.org
Subject: Re: Bug#666525: trying to disable ccache locally, failing
Date: Sun, 6 Oct 2013 14:13:46 +0200
[Message part 1 (text/plain, inline)]
Control: severity -1 important

Hi,

First of all: ccache is no longer the default, so this bug should not be RC.

To reproduce the issue, add the following entries to /etc/pbuilderrc and
rebuild the base tarball (it's only easy to reproduce if ccache is in the base
tarball, and not installed afterwards).

CCACHEDIR="/var/cache/pbuilder/ccache"
EXTRAPACKAGES="ccache"


On Mon, Sep 02, 2013 at 10:48:15PM +0200, Yann Dirson wrote:
> Well, here is one that, although arguably kludgy, does works for me:
> simply forcing the dpkg-architecture run to write somewhere else.

The main issue is that the ccache dir is owned by the build user, but that it
is enabled for all commands, even those running as root. The real solution is
to make sure that ccache is only used when running as the build user. In that
case this issue goes away.

The attached patch should fix that by adding the CCACHE_DIR environment to the
SUTOUSER command. This means that all other commands (including the
dpkg-architecture which is called by pbuilder-satisfydepends) don't run
ccache.

Cheers,

Ivo

[pbuilder_ccache_666525.diff (text/x-diff, attachment)]

Severity set to 'important' from 'serious' Request was from Ivo De Decker <ivo.dedecker@ugent.be> to 666525-submit@bugs.debian.org. (Sun, 06 Oct 2013 12:15:04 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Fri Apr 18 08:25:29 2014; Machine Name: beach.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.