Hi Julien,

Quoting Johannes Schauer Marin Rodrigues (2024-12-30 08:31:58)
> Quoting Johannes Schauer Marin Rodrigues (2024-12-25 08:06:13)
> > Quoting Julien Puydt (2024-12-05 17:17:14)
> > > I updated my chroot two hours ago ; then I couldn't use it anymore, so I
> > > tried to update it again :
> > > 
> > > $ sbuild-update --chroot-mode=unshare --update --dist-upgrade --
> > > autoremove -d unstable
> > > Use of uninitialized value $dist in pattern match (m//) at
> > > /usr/share/perl5/Sbuild/ChrootUnshare.pm line 168.
> > > Use of uninitialized value $dist in pattern match (m//) at
> > > /usr/share/perl5/Sbuild/ChrootUnshare.pm line 168.
> > > Use of uninitialized value $dist in concatenation (.) or string at
> > > /usr/share/perl5/Sbuild/ChrootUnshare.pm line 188.
> > > I: Unpacking /home/jpuydt/.cache/sbuild/unstable-amd64.tar.zst to
> > > /tmp/tmp.sbuild.PlufuvF3vB...
> > > zstd: /*stdin*\: unsupported format 
> > > tar: Child returned status 1
> > > tar: Error is not recoverable: exiting now
> > > bad exit status (2): /usr/libexec/sbuild-usernsexec u:0:100000:65536
> > >  g:0:100000:65536
> > >  -- tar --exclude=./dev/urandom --exclude=./dev/random --
> > > exclude=./dev/full --exclude=./dev/null --exclude=./dev/console --
> > > exclude=./dev/zero --exclude=./dev/tty --exclude=./dev/ptmx --directory
> > > /tmp/tmp.sbuild.PlufuvF3vB --extract --zstd
> > > Error setting up unstable chroot
> > > Chroot setup failed at /usr/bin/sbuild-update line 145.
> > > 
> > > From the error message, I would say something isn't a valid zstd file
> > > but:
> > > $ file /home/jpuydt/.cache/sbuild/unstable-amd64.tar.zst
> > > /home/jpuydt/.cache/sbuild/unstable-amd64.tar.zst: Zstandard compressed
> > > data (v0.8+), Dictionary ID: None
> > > 
> > > 
> > > So I'm a bit at loss as to why things are broken.
> > 
> > my hunch is this part of the zstd manual page:
> > 
> > >   ○   -f, --force: disable input and output checks. Allows overwriting
> > >       existing files, input from console, output to stdout,  operating
> > >       on  links, block devices, etc. During decompression and when the
> > >       output destination is stdout, pass-through unrecognized  formats
> > >       as-is.
> > 
> > Sbuild does not pass the --force parameter when it passes data to extract to
> > the zstd utility.
> > 
> > In your /usr/share/perl5/Sbuild/ChrootUnshare.pm, can you try applying this
> > patch:
> > 
> > --- a/usr/share/perl5/Sbuild/ChrootUnshare.pm
> > +++ b/usr/share/perl5/Sbuild/ChrootUnshare.pm
> > @@ -517,7 +517,7 @@ sub begin_session {
> >              } elsif ("\xFD7zXZ" eq substr $chunk, 0, 5) {
> >                  @decompress = ('xz', '--decompress', '--stdout');
> >              } elsif ("\x28\xB5\x2F\xFD" eq substr $chunk, 0, 4) {
> > -                @decompress = ('zstd', '--decompress', '--stdout');
> > +                @decompress = ('zstd', '--decompress', '--stdout', 
> > '--force');
> >              } elsif ("\x04\x22\x4d\x18" eq substr $chunk, 0, 4) {
> >                  # tar does not seem to support lz4 magic, but we do
> >                  @decompress = ('lz4', '--decompress', '--stdout');
> > 
> > 
> > Should that be the problem, we could add the --force flag and call it a day.
> > But as its name implies, the --force flag is doing more things than just 
> > allow
> > reading data from standard input (see above). Why does zstd need --force for
> > such a task while all other compressors do not? Sounds like a bug?
> 
> while hunting down the zstd mess in #1091169 I came up with another solution
> than using --force. Could you please update your sbuild installation to 0.88.1
> from testing or unstable and then apply this patch:
> 
> --- /usr/share/perl5/Sbuild/ChrootUnshare.pm
> +++ /usr/share/perl5/Sbuild/ChrootUnshare.pm
> @@ -533,14 +533,15 @@ sub begin_session {
>          my $pid_decompress = fork();
>          if ($pid_decompress == 0) {
>              open(STDOUT, '>&', $decompress_writer);
> +            open(STDIN, '<', $tarball);
>              close $filter_reader;
>              close $tar_reader;
>              close $filter_writer;
>              if ($self->get_conf('DEBUG')) {
>                  printf STDERR (
> -                    "running $decompress[0] --decompress --stdout 
> $tarball\n");
> +                    "running $decompress[0] --decompress --stdout\n");
>              }
> -            exec @decompress, $tarball;
> +            exec @decompress;
>          }
>          my $pid_filter = fork();
>          if ($pid_filter == 0) {
> 
> And then try to run the initial command again and post its output.

I think this bug is the same as #1091169. Can you please confirm?

I want to do another subild upload soon and I need your feedback if you want
this issue to be addressed in it.

Thanks!

cheers, josch

Attachment: signature.asc
Description: signature

Reply via email to