From: Masahiro Yamada <masahiroy@kernel.org>
To: linux-kbuild@vger.kernel.org
Cc: Ben Hutchings <ben@decadent.org.uk>,
Masahiro Yamada <masahiroy@kernel.org>,
Nathan Chancellor <nathan@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
Nicolas Schier <nicolas@fjasle.eu>,
linux-kernel@vger.kernel.org
Subject: [PATCH 1/3] kbuild: deb-pkg: do not query DEB_HOST_MULTIARCH
Date: Wed, 20 Dec 2023 03:19:55 +0900 [thread overview]
Message-ID: <20231219181957.1449958-1-masahiroy@kernel.org> (raw)
Since commit 491b146d4c13 ("kbuild: builddeb: Eliminate debian/arch
use"), the direct execution of debian/rules fails with:
dpkg-architecture: error: unknown option 'DEB_HOST_MULTIARCH'
I am not sure how important to support such a use case, but at least
the current code:
dpkg-architecture -a$DEB_HOST_ARCH -qDEB_HOST_MULTIARCH
... looks weird because:
- For this code to work correctly, DEB_HOST_ARCH must be defined.
In this case, DEB_HOST_MULTIARCH is likely defined, so there is no
need to query DEB_HOST_MULTIARCH in the first place. This is likely
the case where the package build was initiated by dpkg-buildpackage.
- If DEB_HOST_MULTIARCH is undefined, DEB_HOST_ARCH is likely undefined.
So, you cannot query DEB_HOST_MULTIARCH in this way. This is mostly
the case where debian/rules is directly executed.
If we want to run debian/rules directly, we can revert 491b146d4c13 or
add code to remember DEB_HOST_MULTIARCH, but I chose to remove the
useless code for now.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---
scripts/package/builddeb | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index 2fe51e6919da..2eb4910f0ef3 100755
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -171,9 +171,8 @@ install_libc_headers () {
# move asm headers to /usr/include/<libc-machine>/asm to match the structure
# used by Debian-based distros (to support multi-arch)
- host_arch=$(dpkg-architecture -a$DEB_HOST_ARCH -qDEB_HOST_MULTIARCH)
- mkdir $pdir/usr/include/$host_arch
- mv $pdir/usr/include/asm $pdir/usr/include/$host_arch/
+ mkdir "$pdir/usr/include/${DEB_HOST_MULTIARCH}"
+ mv "$pdir/usr/include/asm" "$pdir/usr/include/${DEB_HOST_MULTIARCH}"
}
rm -f debian/files
--
2.40.1
next reply other threads:[~2023-12-19 18:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-19 18:19 Masahiro Yamada [this message]
2023-12-19 18:19 ` [PATCH 2/3] kbuild: deb-pkg: hard-code Build-Depends Masahiro Yamada
2023-12-22 14:26 ` Nicolas Schier
2023-12-19 18:19 ` [PATCH 3/3] kbuild: deb-pkg: use more debhelper commands Masahiro Yamada
2023-12-22 14:27 ` Nicolas Schier
2023-12-22 14:30 ` [PATCH 1/3] kbuild: deb-pkg: do not query DEB_HOST_MULTIARCH Nicolas Schier
2023-12-26 5:34 ` Masahiro Yamada
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=20231219181957.1449958-1-masahiroy@kernel.org \
--to=masahiroy@kernel.org \
--cc=ben@decadent.org.uk \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=nicolas@fjasle.eu \
/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