Bug#1022704: ccache: broken in cross-architecture chroot

2022-10-25 Thread Raphaël Halimi

Le 25/10/2022 à 18:40, Joel Rosdahl a écrit :

Thanks!

Now I understand the problem and will work on a fix.

The issue is sharing the inode cache file between architectures. A workaround is
to either use separate temporary directories for the architectures (or different
cache directories when the temporary directory defaults to the cache directory,
which is the case for you), or to disable the inode cache by setting

 inode_cache = false

in the config file.


Hi,

I'm glad I could help you despite my lack of knowledge in this area.

I confirm that disabling the inode cache does work, I'll use this 
workaround while waiting for a fixed version to be released. Thanks !


Regards,

--
Raphaël Halimi



Bug#1022704: ccache: broken in cross-architecture chroot

2022-10-25 Thread Joel Rosdahl
Thanks!

Now I understand the problem and will work on a fix.

The issue is sharing the inode cache file between architectures. A workaround is
to either use separate temporary directories for the architectures (or different
cache directories when the temporary directory defaults to the cache directory,
which is the case for you), or to disable the inode cache by setting

inode_cache = false

in the config file.

Regards,
Joel



Bug#1022704: ccache: broken in cross-architecture chroot

2022-10-24 Thread Joel Rosdahl
On Mon, Oct 24, 2022, at 21:31, Raphaël Halimi wrote:
> I don't know how to use strace. Could you please direct me ?

If you find the process that hangs (likely a ccache process in this case) with
PID P, use

strace -p P

to attach to it and see which system call it is waiting for.

> The file does not exist on my machine; do I just need to create
> /var/cache/pbuilder/ccache/ccache.conf containing a single line "log_file=..."
> or is there something else to do ?

Yes, something like

echo "log_file = /var/cache/pbuilder/ccache/ccache.log" 
>/var/cache/pbuilder/ccache/ccache.conf

should do it.

Regards,
Joel



Bug#1022704: ccache: broken in cross-architecture chroot

2022-10-24 Thread Raphaël Halimi

Le 24/10/2022 à 20:17, Joel Rosdahl a écrit :

On Mon, Oct 24, 2022, at 15:26, Raphaël Halimi wrote:

Install pbuilder on an amd64 host and prepare an i386 chroot. Then, try to
build a package in it (I was rebuilding timidity). It should hang during the
configure phase.


I've never used pbuilder before, but I've tried creating an i386 chroot now,
setting CCACHEDIR according to pbuilderrc(5).

I then built timidity multiple times with "pdebuild --architecture i386", but it
works fine for me every time. I've checked that ccache 4.7.1-1 is being used and
that the ccache directory is being utilized. I'm afraid I'll need more help to
track this down.


That's weird. Before filing the bug, I tried to recreate my build 
environment in a brand new VM, and I observed the same behavior. Maybe 
the problem lies in my configuration ? Regarding ccache, I just set it 
to /var/cache/pbuilder/ccache (some packages failed to build when I 
initially put it in ~/.ccache, permissions problems I think, because 
pbuilder makes files in there owned by 1234).



1. When you say that it systematically hangs, can you check which process is
hanging and what it hangs on, e.g. using strace?


I don't know how to use strace. Could you please direct me ?


2. Would it be possible for you to set CCACHE_LOGFILE (or log_file in
ccache.conf in the ccache directory) to a file inside the pbuilder chroot 
and
then publish the created log file?


I'll try to do that. The file does not exist on my machine; do I just 
need to create /var/cache/pbuilder/ccache/ccache.conf containing a 
single line "log_file=..." or is there something else to do ?


Regards,

--
Raphaël Halimi



Bug#1022704: ccache: broken in cross-architecture chroot

2022-10-24 Thread Joel Rosdahl
On Mon, Oct 24, 2022, at 15:26, Raphaël Halimi wrote:
> Install pbuilder on an amd64 host and prepare an i386 chroot. Then, try to
> build a package in it (I was rebuilding timidity). It should hang during the
> configure phase.

I've never used pbuilder before, but I've tried creating an i386 chroot now,
setting CCACHEDIR according to pbuilderrc(5).

I then built timidity multiple times with "pdebuild --architecture i386", but it
works fine for me every time. I've checked that ccache 4.7.1-1 is being used and
that the ccache directory is being utilized. I'm afraid I'll need more help to
track this down.

1. When you say that it systematically hangs, can you check which process is
   hanging and what it hangs on, e.g. using strace?
2. Would it be possible for you to set CCACHE_LOGFILE (or log_file in
   ccache.conf in the ccache directory) to a file inside the pbuilder chroot and
   then publish the created log file?

Regards,
Joel



Bug#1022704: ccache: broken in cross-architecture chroot

2022-10-24 Thread Raphaël Halimi

Le 24/10/2022 à 14:31, Joel Rosdahl a écrit :

Can you give me more some detailed hints on how I can reproduce the issue?



Install pbuilder on an amd64 host and prepare an i386 chroot. Then, try 
to build a package in it (I was rebuilding timidity). It should hang 
during the configure phase.


I have a complicated setup with several chroots, custom pbuilderrc, sudo 
snippets to let some environment variables pass, etc etc; but, from 
memory, this should work :


sudo pbuilder create --architecture i386

apt-get source somepackage (preferably something using autotools)
cd somepackage
sudo pdebuild --architecture i386

Regards,

--
Raphaël Halimi



Bug#1022704: ccache: broken in cross-architecture chroot

2022-10-24 Thread Joel Rosdahl
On Mon, Oct 24, 2022, at 13:40, Raphaël Halimi wrote:
> I also tested it, it's broken too.

Thanks.

Can you give me more some detailed hints on how I can reproduce the issue?

Regards,
Joel



Bug#1022704: ccache: broken in cross-architecture chroot

2022-10-24 Thread Joel Rosdahl
Hi Raphaël,

Could you test if ccache 4.7.1-1 improves the situation?

Regards,
Joel

Bug#1022704: ccache: broken in cross-architecture chroot

2022-10-24 Thread Raphaël Halimi

Le 24/10/2022 à 13:38, Joel Rosdahl a écrit :

Hi Raphaël,

Could you test if ccache 4.7.1-1 improves the situation?


I also tested it, it's broken too.

Regards,

--
Raphaël Halimi



Bug#1022704: ccache: broken in cross-architecture chroot

2022-10-24 Thread Raphaël Halimi

Package: ccache
Version: 4.7-1

Dear maintainer,

I use pbuilder to build package both for native architecture (amd64) and 
foreign architectures (i386, armhf).


Since upgrading ccache in Debian Sid to 4.7-1, package building 
systematically hangs during the configure phase (checking for this, 
checking for that, etc) for foreign architectures.


It always happen, but not necessarily for the same files, although it's 
usually while checking for stdio.h or stdlib.h.


Downgrading to 4.6.3-1 in the chroot solves the problem, both for i386 
and armhf.


Regards,

--
Raphaël Halimi