Re: Bug#931641: perl: FTBFS under qemu-user

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Bug#931641: perl: FTBFS under qemu-user

John Paul Adrian Glaubitz
Hi!

On 7/8/19 6:18 PM, Niko Tyni wrote:

> This can be reproduced under for instance qemu-armhf with
>
>   mkdir b && cd b && ../Configure -des -Dmksymlinks
>
> resulting in lots of 'Permission denied' errors when extracting cflags.SH
> because the script mistakes the shell absolute path for its argument and
> tries to write in the same directory where the shell resides.
>
> An even simpler reproducer is
>
>   touch config.sh && sh < cflags.SH
>
> This is not specific to Perl 5.30, our packaging just started to use
> -Dmksymlinks there and triggered the issue.
>
> I'm not sure yet where this should be fixed. I'd like to avoid reverting
> the -Dmksymlinks part introduced in 5.30.0-2 as I think enabling parallel
> builds was an improvement. But we'll see.

I will open a bug report upstream with qemu.

Thanks,
Adrian

--
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - [hidden email]
`. `'   Freie Universitaet Berlin - [hidden email]
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

Reply | Threaded
Open this post in threaded view
|

Re: Bug#931641: perl: FTBFS under qemu-user

John Paul Adrian Glaubitz
> That should fix it:
>
> https://github.com/openSUSE/qemu/commit/b9d571b22b86948586a3ee622a854b5fc694cc04
> https://github.com/openSUSE/qemu/commit/3cec667753967b778563899cbd21cc2e617d4389

That doesn't work, unfortunately. At least, I cannot get it to work in Debian.

Both the patch from Laurent and these two patches from Alex and you seem cause
issues with the shell environment so that chrooting into the build root no longer
works.

It seems that it's not trivial to fix this problem while still being able to just
run "chroot /path/to/m68k/build/root" without any additional parameters or having
to call binaries directly.

I need the simple chroot command to work so that I can use it for sbuild.

Adrian

--
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - [hidden email]
`. `'   Freie Universitaet Berlin - [hidden email]
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

Reply | Threaded
Open this post in threaded view
|

Re: Bug#931641: perl: FTBFS under qemu-user

Andreas Schwab-2
On Jul 10 2019, John Paul Adrian Glaubitz <[hidden email]> wrote:

>> That should fix it:
>>
>> https://github.com/openSUSE/qemu/commit/b9d571b22b86948586a3ee622a854b5fc694cc04
>> https://github.com/openSUSE/qemu/commit/3cec667753967b778563899cbd21cc2e617d4389
>
> That doesn't work, unfortunately. At least, I cannot get it to work in Debian.
>
> Both the patch from Laurent and these two patches from Alex and you seem cause
> issues with the shell environment so that chrooting into the build root no longer
> works.

Make sure you have the P flag and the interpreter pointing to the
*-binfmt wrapper.

Andreas.

--
Andreas Schwab, [hidden email]
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

Reply | Threaded
Open this post in threaded view
|

Re: Bug#931641: perl: FTBFS under qemu-user

John Paul Adrian Glaubitz
On 7/10/19 7:28 PM, Andreas Schwab wrote:
>> Both the patch from Laurent and these two patches from Alex and you seem cause
>> issues with the shell environment so that chrooting into the build root no longer
>> works.
>
> Make sure you have the P flag and the interpreter pointing to the
> *-binfmt wrapper.

Laurent helped me debugging and the problem is that Debian has its own binfmt-support
packages which competes with systemd-binfmt with the former not setting the preserve
flag.

It works when writing the configuration into /proc manually:

root@nofan:~/qemu> echo -1 > /proc/sys/fs/binfmt_misc/qemu-m68k
root@nofan:~/qemu> cat /etc/binfmt.d/qemu-m68k.conf > /proc/sys/fs/binfmt_misc/register
root@nofan:~/qemu> chroot /local_scratch/sid-m68k-sbuild/
(sid-m68k-sbuild)root@nofan:/# sh -c 'echo $0'
sh
(sid-m68k-sbuild)root@nofan:/#

Adrian

--
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - [hidden email]
`. `'   Freie Universitaet Berlin - [hidden email]
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

Reply | Threaded
Open this post in threaded view
|

Re: Bug#931641: perl: FTBFS under qemu-user

John Paul Adrian Glaubitz
Hi!

On 7/10/19 7:45 PM, John Paul Adrian Glaubitz wrote:
> Laurent helped me debugging and the problem is that Debian has its own binfmt-support
> packages which competes with systemd-binfmt with the former not setting the preserve
> flag.

It works for me with the attached patch by Laurent Vivier.

Activate with:

# apt purge binfmt-support
# rm /usr/bin/qemu-m68k-static
# cp -av m68k-linux-user/qemu-m68k /usr/bin/qemu-m68k-static
# ./scripts/qemu-binfmt-conf.sh --systemd m68k --qemu-path /usr/bin --qemu-suffix -static --credential yes --persistent yes

Then just rebooted the machine and it worked.

systemd-binfmt works better for me than Debian's own binfmt-support.

Adrian

--
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - [hidden email]
`. `'   Freie Universitaet Berlin - [hidden email]
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

0001-linux-user-manage-binfmt-misc-preserve-arg-0-flag.patch (1K) Download Attachment