public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: "Moessbauer, Felix" <felix.moessbauer@siemens.com>
To: Baurzhan Ismagulov <ibr@radix50.net>,
	"isar-users@googlegroups.com" <isar-users@googlegroups.com>
Cc: "jan.kiszka@siemens.com" <jan.kiszka@siemens.com>
Subject: RE: [PATCH] sbuild: Fix low hit ratio for ccache on linux kernel rebuild
Date: Fri, 15 Jul 2022 14:48:30 +0000	[thread overview]
Message-ID: <AM9PR10MB4869DBB736F323B52772EA62898B9@AM9PR10MB4869.EURPRD10.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <YtFwl3QBLXdTqVtg@ilbers.de>

> -----Original Message-----
> From: isar-users@googlegroups.com <isar-users@googlegroups.com> On
> Behalf Of Baurzhan Ismagulov
> Sent: Friday, July 15, 2022 3:50 PM
> To: isar-users@googlegroups.com
> Subject: Re: [PATCH] sbuild: Fix low hit ratio for ccache on linux kernel rebuild
> 
> On Fri, Jul 15, 2022 at 04:44:29PM +0300, Uladzimir Bely wrote:
> > It can be moved to the kernel recipe, but you left me a bit confused.
> > Why changing of build directory from some random (from build to build)
> > path to some fixed one (the same hash on every rebuild) makes the
> > build less reproducible?
> 
> Debian wants to have identical binary package contents from different builds,
> see
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwiki.debi
> an.org%2FReproducibleBuilds&amp;data=05%7C01%7Cfelix.moessbauer%40sie
> mens.com%7C21efa7957915433beaaf08da6668f548%7C38ae3bcd95794fd4add
> ab42e1495d55a%7C1%7C0%7C637934898219710974%7CUnknown%7CTWFpb
> GZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6M
> n0%3D%7C3000%7C%7C%7C&amp;sdata=1AgsTG9AeVSOlofWSjrURw3%2BsNv
> zI1NcGcJcVZLClwE%3D&amp;reserved=0. I don't know by heart whether / how
> that works for debug info, though. Seems that at least absolute paths should be
> a no-go.

Exactly. We do not want to have any absolute paths in the binary.
By that, the build-dir shall not be relevant (neither for caching, nor for reproducibility).

Regarding relocatable debug info: the debhelpers normally handle that for you.
You can play around by running dpkg-buildflags with various settings (via DEB_BUILD_MAINT_OPTIONS, e.g. DEB_BUILD_MAINT_OPTIONS= reproducible=-timeless).

On bullseye, the -ffile-prefix-map=/tmp/foo=. -fdebug-prefix-map=/tmp/foo=. (building in /tmp/foo) flags are passed to CFLAGS, which strip the specified prefix from the data in the debug info.
However, this does not work for the kernel build, as the CFLAGS are ignored but only KCFLAGS are considered.
By that, we have to manually pass some flags to KCFLAGS.
The official Debian kernel build recipe also does that, but for our custom kernels this might be "too much".

Maybe we could use the dpkg-buildflags to generate some reasonable flags and also enable the reproducibility ones:
export DEB_BUILD_MAINT_OPTIONS="hardening=-all reproducible"
Then, we can pass the generated flags to KCFLAGS.

Felix

> 
> With kind regards,
> Baurzhan
> 
> --
> You received this message because you are subscribed to the Google Groups
> "isar-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email
> to isar-users+unsubscribe@googlegroups.com.
> To view this discussion on the web visit
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.g
> oogle.com%2Fd%2Fmsgid%2Fisar-
> users%2FYtFwl3QBLXdTqVtg%2540ilbers.de&amp;data=05%7C01%7Cfelix.moes
> sbauer%40siemens.com%7C21efa7957915433beaaf08da6668f548%7C38ae3bc
> d95794fd4addab42e1495d55a%7C1%7C0%7C637934898219710974%7CUnkno
> wn%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1ha
> WwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=%2Bvcc0A1dR%2FTIrs
> ojkkCeSEGTbBPBzZgdV%2BndWIMAUGw%3D&amp;reserved=0.

  reply	other threads:[~2022-07-15 14:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-15 11:27 Uladzimir Bely
2022-07-15 13:27 ` Moessbauer, Felix
2022-07-15 13:44   ` Uladzimir Bely
2022-07-15 13:50     ` Baurzhan Ismagulov
2022-07-15 14:48       ` Moessbauer, Felix [this message]
2022-07-15 13:47   ` Baurzhan Ismagulov
2022-07-17 18:53     ` Jan Kiszka

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=AM9PR10MB4869DBB736F323B52772EA62898B9@AM9PR10MB4869.EURPRD10.PROD.OUTLOOK.COM \
    --to=felix.moessbauer@siemens.com \
    --cc=ibr@radix50.net \
    --cc=isar-users@googlegroups.com \
    --cc=jan.kiszka@siemens.com \
    /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