public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Henning Schild <henning.schild@siemens.com>
Cc: Maksim Osipov <mosipov@ilbers.de>, isar-users@googlegroups.com
Subject: Re: [PATCH] buildchroot: build debian packages as "builder" not "root"
Date: Fri, 9 Nov 2018 10:37:56 +0100	[thread overview]
Message-ID: <3a22b503-1f3f-00ec-12c5-0d2360f8d84f@siemens.com> (raw)
In-Reply-To: <20181109103412.7eca6a2a@md1za8fc.ad001.siemens.net>

On 09.11.18 10:34, Henning Schild wrote:
> Am Fri, 9 Nov 2018 10:14:51 +0100
> schrieb Jan Kiszka <jan.kiszka@siemens.com>:
> 
>> On 08.11.18 15:54, Henning Schild wrote:
>>> Am Thu, 8 Nov 2018 14:32:42 +0100
>>> schrieb Jan Kiszka <jan.kiszka@siemens.com>:
>>>    
>>>> On 26.10.18 12:49, [ext] Henning Schild wrote:
>>>>> We used to build packages as "root" and now do that as a regular
>>>>> user. Not building as "root" allows us to find mistakes in
>>>>> debian/rules where privileged operations are used while they
>>>>> should not (a sudo was found in a rules-file). Further some build
>>>>> steps might actually expect to not run as root (seen in openssl
>>>>> test suite).
>>>>>
>>>>> Not building as root should increase overall quality and brings us
>>>>> closer to how debian packages are build by others.
>>>>
>>>> I strongly suspect this is the cause for more and more rebuild
>>>> errors of this kind:
>>>>
>>>> | make[1]: Leaving directory '/home/builder/u-boot/u-boot-v2018.09'
>>>> |    dh_clean -O--parallel
>>>> |  dpkg-source -I -b u-boot-v2018.09
>>>> | dpkg-source: warning: no source format specified in
>>>> debian/source/format, see dpkg-source(1) | dpkg-source: warning:
>>>> source directory 'u-boot-v2018.09' is not
>>>> <sourcepackage>-<upstreamversion> 'u-boot-2018.09' | dpkg-source:
>>>> info: using source format '1.0' | dpkg-source: info: building
>>>> u-boot in u-boot_2018.09.tar.gz | dpkg-source: error: cannot write
>>>> u-boot_2018.09.dsc: Permission denied | dpkg-source: info: building
>>>> u-boot in u-boot_2018.09.dsc | dpkg-buildpackage: error:
>>>> dpkg-source -I -b u-boot-v2018.09 gave error exit status 13 |
>>>> WARNING: exit code 13 from a shell command. | ERROR: Function
>>>> failed: do_build (log file is located
>>>> at /work/build/tmp/work/long-life-ebsy-armhf/u-boot-2018.09-r0/temp/log.do_build.15761)
>>>>
>>>> Are we missing some cleandirs in dpkg[-base].class?
>>>
>>> Does the file exist and can not be written by builder, or does it
>>> not exist and the dir must not receive new files. I am guessing the
>>> former but have not clue why.
>>> Maybe you can tell be how to reproduce this.
>>
>> The breakage comes from the UID and GID of builder inside the chroot.
>> They are not in sync with the IDs used on the host side, so we can
>> end up chown'ing to unknown user:group from host perspective.
> 
> I am not sure i get that. Before it was "root:root" so whatever the
> host (the thing where isar runs?) is doing must have been privileged
> and should be able to deal with any uids.

As the build was run as root, it didn't matter if IDs matched - they were 
overruled. Now they mismatch and there no power to paper over that anymore.

> 
> The user and group names are only used within the buildchroot(s).

Nope, there are also steps run outside of the chroot, in recipes.

> 
> What i see is a dpkg-source ... so my guess is we are talking about
> cross compile and the two chroots are not sync ... id-wise. Will the
> WORKDIR be mounted first in one chroot and later in another?
> 
>> Either ensure that the IDs are synchronized or revert this commit for
>> now.
> 
> I will send a patch once i have understood the problem. Still do not
> know how to reproduce ...

Cross-build (didn't test native, but I bet it will be similar) de0-nano-soc, 
e.g. Change some dpkg-based recipe to retrigger a build, and you will get. In my 
case, it was u-boot.

Jan

-- 
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux

  reply	other threads:[~2018-11-09  9:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-26 10:49 Henning Schild
2018-10-29 10:54 ` Baurzhan Ismagulov
2018-10-29 11:27   ` Henning Schild
2018-10-29 11:44     ` Baurzhan Ismagulov
2018-11-01 13:27 ` Maxim Yu. Osipov
2018-11-08 13:32 ` Jan Kiszka
2018-11-08 14:54   ` Henning Schild
2018-11-09  9:14     ` Jan Kiszka
2018-11-09  9:34       ` Henning Schild
2018-11-09  9:37         ` Jan Kiszka [this message]
2018-11-09 11:16           ` Jan Kiszka
2018-11-09 15:49             ` Baurzhan Ismagulov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3a22b503-1f3f-00ec-12c5-0d2360f8d84f@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=henning.schild@siemens.com \
    --cc=isar-users@googlegroups.com \
    --cc=mosipov@ilbers.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox