Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp4564917ybp; Mon, 14 Oct 2019 06:42:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqwafH/NjP0wDg5jDH/UKQdoyh4ZVxpnl+dnJisBR1QVMlhgZEiwxZe3qV96b3pokrfROOwa X-Received: by 2002:a50:b2c4:: with SMTP id p62mr27797704edd.128.1571060524463; Mon, 14 Oct 2019 06:42:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571060524; cv=none; d=google.com; s=arc-20160816; b=Aecrcb+6lQl+J4IDsEZw7BnxaeHhZO1G59sGai1hX4LFHdYyA1iWXp7FHHDVhX5ljf 1u0ok0Lyp8tNWkB1NObP2ZQT6T0AxMXlI2X6i8KAjkH/LZQwowtix5EY/koM4YWun21T uJqkZ9elDmTLQC5OvIHm5iVp84U5o+zDFsxIY2skRoyokGjA2KCzNmtKnswQIOUzBMgJ 9x9E9IMr8Y55vkqgxkqwQ6tD8wZuG76bSbS8ai3jg+PzubeR/qYQ38imGwi3gVTgBBLd dwSGrR+khLvIl1FXDs1dVKadF0+NJ6vp1OQb9BsAniTRffcB8BjoOozpkifoezWQ4GpH etXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=yz8motMdO8hwswIG17yGoW+Rc2pHrBN1ncSLiZFe/nk=; b=sD0Bb/7x9LmNJN9yWas8ZojTQYl4fZ/KaSK7DT48lYbkMgqdtCnd39uRPuAia8f9fE KMCnwtLWONEFJX7hmL6IPATPoeVfatRKvBsXxVrKSYEl3XbwT4niOxYDUa72dEx8PUXZ m8uVqsvS1Jz5ix1iAmNUIB0/wmUI/B4oUKlsR3W/ubuXURZZ4K8Ckz2nwsZSkqYsfg6V MDylsiGD8DEO0R7j83etNmHz3Wuctll6jBmYIbj3Pz4IrBEtri/mFzMhi2YT1E9se+F6 EK5LCcxmunlmUsnTPCsnI6rUEG3f3u1I0eg8alreNBC8SvJzcZAadiLw8o8dsv9Ppp7d 434w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=ROJPairY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w55si11721330eda.15.2019.10.14.06.41.41; Mon, 14 Oct 2019 06:42:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=ROJPairY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732133AbfJNNko (ORCPT + 99 others); Mon, 14 Oct 2019 09:40:44 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:40924 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727789AbfJNNkn (ORCPT ); Mon, 14 Oct 2019 09:40:43 -0400 Received: by mail-wr1-f68.google.com with SMTP id h4so19825883wrv.7 for ; Mon, 14 Oct 2019 06:40:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=yz8motMdO8hwswIG17yGoW+Rc2pHrBN1ncSLiZFe/nk=; b=ROJPairYywrNQCO5Qzmg/pPIHjvDbDqoWhVWqwXLbqk8IowzzIIP9GYi0BAFpPRevb k/01s9xjWqpDKjNYUOP6CRJk0TF3cEVHdRdZQBD4CGmm7a4bTLuJHNXI5IaNdctNCkLo 7XiIHLnAMEw89sNiHst8Rvdn3AvKUz+tjjGbveN550otzTyJGA/xTvC8tgYc8aO9My9C HKxIT+61L7tFNnWqpPKd1KcwELAb+wUFViRYXn01iRj4ZX1KkR2J1hekyaVuj0AhWmIo JcY4RKRsStoU6iDFGV8XJxFlFE7yl3ioK9ZIbjHOH1d1TK7xYF5tacr9SexgHvDWuoHj /iRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=yz8motMdO8hwswIG17yGoW+Rc2pHrBN1ncSLiZFe/nk=; b=QkK+Is4dfywUTajPpKwbdV3ABZ9XFmkjoXGY2gqq5znebD5J2kNeBXtwNQ1jCIzbp9 JDCwMBk4w9NufcOuR7Wdj+gLKNEDQwOUSizh6Y6M/cI5dJAh/aewgGBr1QqPjUESz4tZ /FIcCWPbDuHr9WmKVRJeAQKlShAczFVcg3z5yyFy1TdRYSmWdavCPv9VJ8FrGF1mU7VM D2GIHSQdFeklFVWZrMfOiB5cZ5OeNZD7J7jDfHpAvqsq3KS6BDd/IZXsp/hpgQ84K6+t 1vXGIljo9CkvILZ7H4bEdN+aBmo0FdX7bksQNeQhKmEoALg05GpC0ZTSV5Q4sA+gTmB/ B20w== X-Gm-Message-State: APjAAAUrupL7BGc9J72H3fF9m8+gdFNL/HM7IdBH5oMKU478rtmcgeS/ zS7omRJQAfVhS3pTofXkEcDu9A== X-Received: by 2002:a05:6000:1202:: with SMTP id e2mr11991170wrx.162.1571060441442; Mon, 14 Oct 2019 06:40:41 -0700 (PDT) Received: from google.com ([2a00:79e0:d:210:7687:11a4:4657:121d]) by smtp.gmail.com with ESMTPSA id a2sm30978110wrt.45.2019.10.14.06.40.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Oct 2019 06:40:40 -0700 (PDT) Date: Mon, 14 Oct 2019 14:40:37 +0100 From: Quentin Perret To: Dmitry Goldin Cc: Masahiro Yamada , Andreas Schwab , Greg KH , "linux-kernel\\\\\\\\@vger.kernel.org" , "joel\\\\\\\\@joelfernandes.org" , Ben Hutchings , adelva@google.com, natechancellor@gmail.com, maennich@google.com Subject: Re: [PATCH] kheaders: substituting --sort in archive creation Message-ID: <20191014134037.GA79684@google.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Dmitry, On Wednesday 09 Oct 2019 at 13:42:14 (+0000), Dmitry Goldin wrote: > From: Dmitry Goldin > > The option --sort=ORDER was only introduced in tar 1.28 (2014), which > is rather new and might not be available in some setups. > > This patch tries to replicate the previous behaviour as closely as possible > to fix the kheaders build for older environments. It does not produce identical > archives compared to the previous version due to minor sorting > differences but produces reproducible results itself in my tests. > > Signed-off-by: Dmitry Goldin > --- > kernel/gen_kheaders.sh | 11 +++++++---- > 1 file changed, 7 insertions(+), 4 deletions(-) > > diff --git a/kernel/gen_kheaders.sh b/kernel/gen_kheaders.sh > index aff79e461fc9..5a0fc0b0403a 100755 > --- a/kernel/gen_kheaders.sh > +++ b/kernel/gen_kheaders.sh > @@ -71,10 +71,13 @@ done | cpio --quiet -pd $cpio_dir >/dev/null 2>&1 > find $cpio_dir -type f -print0 | > xargs -0 -P8 -n1 perl -pi -e 'BEGIN {undef $/;}; s/\/\*((?!SPDX).)*?\*\///smg;' > > -# Create archive and try to normalize metadata for reproducibility > -tar "${KBUILD_BUILD_TIMESTAMP:+--mtime=$KBUILD_BUILD_TIMESTAMP}" \ > - --owner=0 --group=0 --sort=name --numeric-owner \ > - -Jcf $tarfile -C $cpio_dir/ . > /dev/null > +# Create archive and try to normalize metadata for reproducibility. > +# For compatibility with older versions of tar, files are fed to tar > +# pre-sorted, as --sort=name might not be available. > +find $cpio_dir -printf "./%P\n" | LC_ALL=C sort | \ > + tar "${KBUILD_BUILD_TIMESTAMP:+--mtime=$KBUILD_BUILD_TIMESTAMP}" \ > + --owner=0 --group=0 --numeric-owner --no-recursion \ > + -Jcf $tarfile -C $cpio_dir/ -T - > /dev/null > > echo "$src_files_md5" > kernel/kheaders.md5 > echo "$obj_files_md5" >> kernel/kheaders.md5 > -- > 2.23.0 FWIW: Tested-by: Quentin Perret It turns out this issue broke something in our CI, could this patch be queued as a -rc4 fix ? Thanks, Quentin