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

#1030704#5
Date:
2023-02-06 16:33:21 UTC
From:
To:
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.

#1030704#10
Date:
2023-03-15 18:22:46 UTC
From:
To:
Hi,

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