Skip to contentSkip to conversation

squashfs-tools: always install prebuilt manpage

PATCH In review [email protected] 2 participants 5 messages May 16, 2022 – May 18, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 squashfs-tools: always install prebuilt manpage

From: Changqing Li <[email protected]>

When other feature enabled, and involve help2man into squashfs-tools's
recipe-sysroot-native, install-manpages.sh will run target binary on
build host, eg: mksquashfs --help, which will cause error.
Eg:
../squashfs-tools/mksquashfs: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by ../squashfs-tools/mksquashfs)

| help2man: can't get `--help' info from /tmp/tmp.pEG5R8COVb/mksquashfs.sh
| Try `--no-discard-stderr' if option outputs to stderr
| ./mksquashfs-manpage.sh: help2man returned error.  Aborting
| ../generate-manpages/install-manpages.sh: Failed to generate manpage.  Aborting

Fixed by always install prebuilt manpage, avoid running target binary on build host

---
 ...ools-always-install-prebuilt-manpage.patch | 48 +++++++++++++++++++
 .../squashfs-tools/squashfs-tools_git.bb      |  1 +
 2 files changed, 49 insertions(+)
 create mode 100644 meta/recipes-devtools/squashfs-tools/files/0001-squashfs-tools-always-install-prebuilt-manpage.patch
meta/recipes-devtools/squashfs-tools/files/0001-squashfs-tools-always-install-prebuilt-manpage.patch new file +48 -0
new file mode 100644
index 0000000000..2d0b350074
@@ -0,0 +1,48 @@
+From 9bf47880ebb0fafd36226ac7fd1c2e8dffc9bc64 Mon Sep 17 00:00:00 2001
+From: Changqing Li <[email protected]>
+Date: Mon, 16 May 2022 17:57:07 +0800
+Subject: [PATCH] squashfs-tools: always install prebuilt manpage
+
+Upstream-Status: Inappropriate [oe-specific]
+
+Signed-off-by: Changqing Li <[email protected]>
+---
+ generate-manpages/install-manpages.sh | 22 +++++-----------------
+ 1 file changed, 5 insertions(+), 17 deletions(-)
+
+diff --git a/generate-manpages/install-manpages.sh b/generate-manpages/install-manpages.sh
+index 6a43b89..770f15a 100755
+--- a/generate-manpages/install-manpages.sh
++++ b/generate-manpages/install-manpages.sh
+@@ -27,23 +27,11 @@ cd $1/generate-manpages
+ #
+ # If help2man doesn't exist, use the pre-built manpages.
+ 
+-if ! which help2man > /dev/null 2>&1; then
+-	echo "$0: ERROR - No help2man in PATH.  Cannot generate manpages." >&2
+-	echo "WARNING: Installing pre-built manpages." >&2
+-	echo "WARNING: These pages are built with the Makefile defaults, and all" >&2
+-	echo "WARNING: the compressors configured (except the deprecated lzma).  This may not" >&2
+-	echo "WARNING: match your build configuation." >&2
+-	source=../manpages
+-else
+-	for i in mksquashfs unsquashfs sqfstar sqfscat; do
+-		if ! ./$i-manpage.sh ../squashfs-tools ../squashfs-tools/$i.1; then
+-			echo "$0: Failed to generate manpage.  Aborting" >&2
+-			exit 1
+-		fi
+-	done
+-
+-	source=../squashfs-tools
+-fi
++echo "WARNING: Installing pre-built manpages." >&2
++echo "WARNING: These pages are built with the Makefile defaults, and all" >&2
++echo "WARNING: the compressors configured (except the deprecated lzma).  This may not" >&2
++echo "WARNING: match your build configuation." >&2
++source=../manpages
+ 
+ if ! mkdir -p $2; then
+ 	echo "$0: Creating manpage install directory failed.  Aborting" >&2
+-- 
+2.25.1
+
meta/recipes-devtools/squashfs-tools/squashfs-tools_git.bb +1 -0
index 4e009d2625..3726650e3c 100644
@@ -11,6 +11,7 @@ PV = "4.5.1"
 SRCREV = "afdd63fc386919b4aa40d573b0a6069414d14317"
 SRC_URI = "git://github.com/plougher/squashfs-tools.git;protocol=https;branch=master \
            file://0001-install-manpages.sh-do-not-write-original-timestamps.patch \
+           file://0001-squashfs-tools-always-install-prebuilt-manpage.patch \
            "
 UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>(\d+(\.\d+)+))"
 
Signature · 1 line
2.25.1
#1 lore raw
Quoted 12 lines · Changqing Li

From: Changqing Li <[email protected]>

When other feature enabled, and involve help2man into squashfs-tools's
recipe-sysroot-native, install-manpages.sh will run target binary on
build host, eg: mksquashfs --help, which will cause error.
Eg:
../squashfs-tools/mksquashfs: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by ../squashfs-tools/mksquashfs)

Quoted 4 lines

help2man: can't get --help' info from /tmp/tmp.pEG5R8COVb/mksquashfs.sh Try --no-discard-stderr' if option outputs to stderr ./mksquashfs-manpage.sh: help2man returned error. Aborting ../generate-manpages/install-manpages.sh: Failed to generate manpage. Aborting

Quoted 4 lines

Fixed by always install prebuilt manpage, avoid running target binary on build host

I'd much prefer not to carry a patch doing this. Which "other feature enabled" trigger this to happen?

We might want to talk to upstream about making this configurable rather than carrying a patch, or we make sure help2man is never accessible to this recipe in some other way.

Cheers,

Richard

#2 lore raw

________________________________
From: [email protected] <[email protected]>
Sent: Monday, May 16, 2022 6:54 PM
To: Li, Changqing <[email protected]>; [email protected] <[email protected]>
Subject: Re: [OE-core] [PATCH] squashfs-tools: always install prebuilt manpage

[Please note: This e-mail is from an EXTERNAL e-mail address]

Quoted 12 lines · Changqing Li

From: Changqing Li <[email protected]>

When other feature enabled, and involve help2man into squashfs-tools's
recipe-sysroot-native, install-manpages.sh will run target binary on
build host, eg: mksquashfs --help, which will cause error.
Eg:
../squashfs-tools/mksquashfs: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by ../squashfs-tools/mksquashfs)

Quoted 4 lines

help2man: can't get --help' info from /tmp/tmp.pEG5R8COVb/mksquashfs.sh Try --no-discard-stderr' if option outputs to stderr ./mksquashfs-manpage.sh: help2man returned error. Aborting ../generate-manpages/install-manpages.sh: Failed to generate manpage. Aborting

Quoted 4 lines

Fixed by always install prebuilt manpage, avoid running target binary on build host

I'd much prefer not to carry a patch doing this. Which "other feature enabled" trigger this to happen?

When meta-secure-core is involved, and DISTRO_FEATURES efi-secure-boot and ima is enabled, in meta-signing-key/classes/user-key-store.bbclass, it will add DEPENDS as following:

DEPENDS:append:class-target = " \
    ${@bb.utils.contains("DISTRO_FEATURES", "efi-secure-boot", "sbsigntool-native", "", d)} \
    ${@bb.utils.contains("DISTRO_FEATURES", "efi-secure-boot", "libsign-native", "", d)} \
    openssl-native \
    ${@bb.utils.contains("DISTRO_FEATURES", "efi-secure-boot", "efitools-native gnupg-native", "", d)} \

"

and efitools-native DEPENDS on help2man-native, so all target depends on help2man-native. efitools's manpage also don't configurable.

We might want to talk to upstream about making this configurable rather than carrying a patch, or we make sure help2man is never accessible to this recipe in some other way.

I will talk to upstream about this first.

Cheers,

Richard

#3 lore raw
Quoted 58 lines · Changqing

From: [email protected] <[email protected]>
Sent: Monday, May 16, 2022 6:54 PM
To: Li, Changqing <[email protected]>; [email protected] <[email protected]>
Subject: Re: [OE-core] [PATCH] squashfs-tools: always install prebuilt manpage
[Please note: This e-mail is from an EXTERNAL e-mail address]

Quoted 18 lines · Changqing Li

From: Changqing Li <[email protected]>

When other feature enabled, and involve help2man into squashfs- tools's
recipe-sysroot-native, install-manpages.sh will run target binary on
build host, eg: mksquashfs --help, which will cause error. Eg:
  ../squashfs-tools/mksquashfs: /lib/x86_64-linux-gnu/libc.so.6:
version `GLIBC_2.34' not found (required by ../squashfs- tools/mksquashfs)

Quoted 6 lines

help2man: can't get `--help' info from /tmp/tmp.pEG5R8COVb/mksquashfs.sh
Try `--no-discard-stderr' if option outputs to stderr ./mksquashfs-manpage.sh: help2man returned error.  Aborting ../generate-manpages/install-manpages.sh: Failed to generate manpage.  Aborting

Quoted 5 lines

Fixed by always install prebuilt manpage, avoid running target binary on
build host

I'd much prefer not to carry a patch doing this. Which "other feature enabled" trigger this to happen?

When  meta-secure-core  is involved,  and DISTRO_FEATURES efi-secure- boot and ima is enabled,
in meta-signing-key/classes/user-key-store.bbclass,  it will add DEPENDS as following:
DEPENDS:append:class-target = " \
    ${@bb.utils.contains("DISTRO_FEATURES", "efi-secure-boot", "sbsigntool-native", "", d)} \
    ${@bb.utils.contains("DISTRO_FEATURES", "efi-secure-boot", "libsign-native", "", d)} \
    openssl-native \
    ${@bb.utils.contains("DISTRO_FEATURES", "efi-secure-boot", "efitools-native gnupg-native", "", d)} \
"

and efitools-native  DEPENDS  on  help2man-native,  so all target depends on help2man-native.
efitools's manpage also don't configurable.

Quoted 7 lines

We might want to talk to upstream about making this configurable rather
than carrying a patch, or we make sure help2man is never accessible to
this recipe in some other way.

I will talk to upstream about this first.

What would also probably help is adding help2man-native to SSTATE_EXCLUDEDEPS_SYSROOT in layer.conf in OE-Core.

That runs the risk of triggering some build failures as it did when we added pkgconfig-native there but is probably the right thing to do. It would force recipes that want help2man-native to have an explicit DEPENDS so we'd have to test and fix any recipes that needed that adding.

Cheers,

Richard

#4 lore raw

________________________________
From: [email protected] <[email protected]>
Sent: Tuesday, May 17, 2022 3:32 PM
To: Li, Changqing <[email protected]>; [email protected] <[email protected]>
Subject: Re: [OE-core] [PATCH] squashfs-tools: always install prebuilt manpage

[Please note: This e-mail is from an EXTERNAL e-mail address]

Quoted 58 lines · Changqing

From: [email protected] <[email protected]>
Sent: Monday, May 16, 2022 6:54 PM
To: Li, Changqing <[email protected]>; [email protected] <[email protected]>
Subject: Re: [OE-core] [PATCH] squashfs-tools: always install prebuilt manpage
[Please note: This e-mail is from an EXTERNAL e-mail address]

Quoted 18 lines · Changqing Li

From: Changqing Li <[email protected]>

When other feature enabled, and involve help2man into squashfs- tools's
recipe-sysroot-native, install-manpages.sh will run target binary on
build host, eg: mksquashfs --help, which will cause error. Eg:
../squashfs-tools/mksquashfs: /lib/x86_64-linux-gnu/libc.so.6:
version `GLIBC_2.34' not found (required by ../squashfs- tools/mksquashfs)

Quoted 6 lines

help2man: can't get `--help' info from /tmp/tmp.pEG5R8COVb/mksquashfs.sh
Try `--no-discard-stderr' if option outputs to stderr ./mksquashfs-manpage.sh: help2man returned error. Aborting ../generate-manpages/install-manpages.sh: Failed to generate manpage. Aborting

Quoted 5 lines

Fixed by always install prebuilt manpage, avoid running target binary on
build host

I'd much prefer not to carry a patch doing this. Which "other feature enabled" trigger this to happen?

When meta-secure-core is involved, and DISTRO_FEATURES efi-secure- boot and ima is enabled,
in meta-signing-key/classes/user-key-store.bbclass, it will add DEPENDS as following:

DEPENDS:append:class-target = " \
    ${@bb.utils.contains("DISTRO_FEATURES", "efi-secure-boot",
"sbsigntool-native", "", d)} \
    ${@bb.utils.contains("DISTRO_FEATURES", "efi-secure-boot",
"libsign-native", "", d)} \
    openssl-native \
    ${@bb.utils.contains("DISTRO_FEATURES", "efi-secure-boot",

"efitools-native gnupg-native", "", d)} \
"

and efitools-native DEPENDS on help2man-native, so all target depends on help2man-native.
efitools's manpage also don't configurable.

Quoted 7 lines

We might want to talk to upstream about making this configurable rather
than carrying a patch, or we make sure help2man is never accessible to
this recipe in some other way.

I will talk to upstream about this first.

What would also probably help is adding help2man-native to SSTATE_EXCLUDEDEPS_SYSROOT in layer.conf in OE-Core.

That runs the risk of triggering some build failures as it did when we added pkgconfig-native there but is probably the right thing to do. It would force recipes that want help2man-native to have an explicit DEPENDS so we'd have to test and fix any recipes that needed that adding.

Thanks, I will send a V2 patch with this solution later.

Regrads,
Changqing

Cheers,

Richard