Bug#1030704: extra-package doesn't work with autopkgtest-virt-server=docker

2023-03-15 Thread Christian Kastner
Hi,

On 2023-02-06 17:33, Shengjing Zhu wrote:
> +--+
> | Update chroot   
>  |
> +--+
> 
> Get:1 
> file:/build/golang-github-coredhcp-coredhcp-xIXI4Z/resolver-dcoFh4/apt_archive
>  ./ InRelease
> Ign:1 
> file:/build/golang-github-coredhcp-coredhcp-xIXI4Z/resolver-dcoFh4/apt_archive
>  ./ InRelease
> Get:2 
> file:/build/golang-github-coredhcp-coredhcp-xIXI4Z/resolver-dcoFh4/apt_archive
>  ./ Release [603 B]
> Get:2 
> file:/build/golang-github-coredhcp-coredhcp-xIXI4Z/resolver-dcoFh4/apt_archive
>  ./ Release [603 B]
> Get:3 
> file:/build/golang-github-coredhcp-coredhcp-xIXI4Z/resolver-dcoFh4/apt_archive
>  ./ Release.gpg
> Ign:3 
> file:/build/golang-github-coredhcp-coredhcp-xIXI4Z/resolver-dcoFh4/apt_archive
>  ./ Release.gpg
> Get:4 
> file:/build/golang-github-coredhcp-coredhcp-xIXI4Z/resolver-dcoFh4/apt_archive
>  ./ Packages [999 B]
> Err:4 
> file:/build/golang-github-coredhcp-coredhcp-xIXI4Z/resolver-dcoFh4/apt_archive
>  ./ Packages
>   Could not open file 
> /var/lib/apt/lists/partial/_build_golang-github-coredhcp-coredhcp-xIXI4Z_resolver-dcoFh4_apt%5farchive_._Packages
>  - open (13: Permission denied)
> ...
> Fetched 440 kB in 2s (289 kB/s)
> Reading package lists...
> E: Failed to fetch 
> store:/var/lib/apt/lists/partial/_build_golang-github-coredhcp-coredhcp-xIXI4Z_resolver-dcoFh4_apt%5farchive_._Packages
>   Could not open file 
> /var/lib/apt/lists/partial/_build_golang-github-coredhcp-coredhcp-xIXI4Z_resolver-dcoFh4_apt%5farchive_._Packages
>  - open (13: Permission denied)
> E: Some index files failed to download. They have been ignored, or old ones 
> used instead.

Is it possible that you are running with umask 0027? If you, can you try
with umask 0022?

I ran into a similar issue in autopkgtest, and I think they could be
related. See [1].

Best,
Christian

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1032487



Bug#1030704: extra-package doesn't work with autopkgtest-virt-server=docker

2023-02-06 Thread Shengjing Zhu
Package: sbuild
Version: 0.85.0
Severity: normal
X-Debbugs-Cc: z...@debian.org

I'm exploring to build package with autopkgtest-virt-server=docker. The
following combination fails for me.

gbp buildpackage --git-builder='sbuild --chroot-mode=autopkgtest 
--autopkgtest-virt-server=docker 
--autopkgtest-virt-server-opt=autopkgtest/debian:sid --purge-deps=never 
--extra-package=/home/zsj/Workspaces/debian/package/pkg-go/build-area/ 
--anything-failed-commands="sleep infinity"'

I get

```
+--+
| Update chroot|
+--+

Get:1 
file:/build/golang-github-coredhcp-coredhcp-xIXI4Z/resolver-dcoFh4/apt_archive 
./ InRelease
Ign:1 
file:/build/golang-github-coredhcp-coredhcp-xIXI4Z/resolver-dcoFh4/apt_archive 
./ InRelease
Get:2 
file:/build/golang-github-coredhcp-coredhcp-xIXI4Z/resolver-dcoFh4/apt_archive 
./ Release [603 B]
Get:2 
file:/build/golang-github-coredhcp-coredhcp-xIXI4Z/resolver-dcoFh4/apt_archive 
./ Release [603 B]
Get:3 
file:/build/golang-github-coredhcp-coredhcp-xIXI4Z/resolver-dcoFh4/apt_archive 
./ Release.gpg
Ign:3 
file:/build/golang-github-coredhcp-coredhcp-xIXI4Z/resolver-dcoFh4/apt_archive 
./ Release.gpg
Get:4 
file:/build/golang-github-coredhcp-coredhcp-xIXI4Z/resolver-dcoFh4/apt_archive 
./ Packages [999 B]
Err:4 
file:/build/golang-github-coredhcp-coredhcp-xIXI4Z/resolver-dcoFh4/apt_archive 
./ Packages
  Could not open file 
/var/lib/apt/lists/partial/_build_golang-github-coredhcp-coredhcp-xIXI4Z_resolver-dcoFh4_apt%5farchive_._Packages
 - open (13: Permission denied)
...
Fetched 440 kB in 2s (289 kB/s)
Reading package lists...
E: Failed to fetch 
store:/var/lib/apt/lists/partial/_build_golang-github-coredhcp-coredhcp-xIXI4Z_resolver-dcoFh4_apt%5farchive_._Packages
  Could not open file 
/var/lib/apt/lists/partial/_build_golang-github-coredhcp-coredhcp-xIXI4Z_resolver-dcoFh4_apt%5farchive_._Packages
 - open (13: Permission denied)
E: Some index files failed to download. They have been ignored, or old ones 
used instead.
```

Then I exec to the container, I find

root@b431ad0334a7:/# ls -l
total 68
drwxrwsr--   3 sbuild sbuild 4096 Feb  6 16:01 build

root@b431ad0334a7:/# ls -l build/
drwxrwx--- 4 zsj sbuild 4096 Feb  6 16:01 golang-github-coredhcp-coredhcp-xIXI4Z

These directories doesn't have read permission for all users.

After I change the permission, apt succeeds.
# chmod a+rx -R build/
# apt update
...
All packages are up to date.

-- System Information:
Debian Release: bookworm/sid
  APT prefers testing
  APT policy: (500, 'testing'), (100, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 6.1.0-2-amd64 (SMP w/16 CPU threads; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages sbuild depends on:
ii  adduser 3.130
ii  libsbuild-perl  0.85.0
ii  perl5.36.0-7

Versions of packages sbuild recommends:
ii  autopkgtest  5.28
pn  debootstrap  
pn  schroot  
ii  uidmap   1:4.13+dfsg1-1

Versions of packages sbuild suggests:
pn  deborphan  
ii  e2fsprogs  1.46.6-1
ii  kmod   30+20221128-1
ii  wget   1.21.3-1+b2

-- no debconf information