GNU bug report logs - #41498
sed fails to build on kernels with selinux

Previous Next

Package: guix;

Reported by: Chris Marusich <cmmarusich <at> gmail.com>

Date: Sun, 24 May 2020 08:15:02 UTC

Severity: normal

Done: Chris Marusich <cmmarusich <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 41498 in the body.
You can then email your comments to 41498 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#41498; Package guix. (Sun, 24 May 2020 08:15:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Chris Marusich <cmmarusich <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Sun, 24 May 2020 08:15:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Chris Marusich <cmmarusich <at> gmail.com>
To: bug-guix <at> gnu.org
Subject: sed fails to build on kernels with selinux
Date: Sun, 24 May 2020 01:14:48 -0700
[Message part 1 (text/plain, inline)]
Hi,

I noticed that sed fails to build on my Fedora machine, but it builds
successfully on Guix System.  The error is:

--8<---------------cut here---------------start------------->8---
ERROR: testsuite/inplace-selinux
================================

inplace-selinux.sh: set-up failure: CONFIG_HEADER not defined
ERROR testsuite/inplace-selinux.sh (exit status: 99)
--8<---------------cut here---------------end--------------->8---

It appears related to this issue:

https://lists.gnu.org/archive/html/bug-sed/2019-06/msg00022.html

"This error comes from 'init.cfg' in the 'require_selinux_' function.
It happens when the system supports SELinux (based on
/proc/filesystems), but during the './configure' step, somehow the
generated Makefile did not contain a 'CONFIG_HEADER = config.h'
statement (very strange)."

Indeed, /proc/filesystems within the Guix sandbox on my Fedora system
looks like this:

--8<---------------cut here---------------start------------->8---
nodev	sysfs
nodev	tmpfs
nodev	bdev
nodev	proc
nodev	cgroup
nodev	cgroup2
nodev	cpuset
nodev	devtmpfs
nodev	configfs
nodev	debugfs
nodev	tracefs
nodev	securityfs
nodev	sockfs
nodev	bpf
nodev	pipefs
nodev	ramfs
nodev	hugetlbfs
nodev	devpts
	ext3
	ext2
	ext4
nodev	autofs
nodev	mqueue
nodev	selinuxfs
nodev	pstore
	fuseblk
nodev	fuse
nodev	fusectl
nodev	rpc_pipefs
	iso9660
--8<---------------cut here---------------end--------------->8---

However, on a vanilla Guix System (gnu/system/examples/vm-image.tmpl) it
looks like this:

--8<---------------cut here---------------start------------->8---
nodev	sysfs
nodev	tmpfs
nodev	bdev
nodev	proc
nodev	cgroup
nodev	cgroup2
nodev	cpuset
nodev	devtmpfs
nodev	debugfs
nodev	tracefs
nodev	securityfs
nodev	sockfs
nodev	bpf
nodev	pipefs
nodev	ramfs
nodev	hugetlbfs
nodev	devpts
	ext3
	ext2
	ext4
	vfat
nodev	ecryptfs
nodev	mqueue
nodev	pstore
nodev	9p
--8<---------------cut here---------------end--------------->8---

Note that "selinuxfs" is present in the Fedora case, but missing in the
Guix System case.  It seems very likely that this is causing the
failure.  We probably need to modify something in the sed build logic to
make it succeed even when "selinuxfs" is present.

-- 
Chris
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#41498; Package guix. (Sat, 30 May 2020 08:07:01 GMT) Full text and rfc822 format available.

Message #8 received at 41498 <at> debbugs.gnu.org (full text, mbox):

From: Chris Marusich <cmmarusich <at> gmail.com>
To: 41498 <at> debbugs.gnu.org
Subject: Re: bug#41498: sed fails to build on kernels with selinux
Date: Sat, 30 May 2020 01:06:38 -0700
[Message part 1 (text/plain, inline)]
Chris Marusich <cmmarusich <at> gmail.com> writes:

> It appears related to this issue:
>
> https://lists.gnu.org/archive/html/bug-sed/2019-06/msg00022.html

There is actually a bug report for this here:

https://debbugs.gnu.org/cgi/bugreport.cgi?bug=36150

I have submitted a patch upstream to fix the issue.

-- 
Chris
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#41498; Package guix. (Wed, 10 Jun 2020 07:15:02 GMT) Full text and rfc822 format available.

Message #11 received at 41498 <at> debbugs.gnu.org (full text, mbox):

From: Chris Marusich <cmmarusich <at> gmail.com>
To: 41498 <at> debbugs.gnu.org
Subject: Re: bug#41498: sed fails to build on kernels with selinux
Date: Wed, 10 Jun 2020 00:14:09 -0700
[Message part 1 (text/plain, inline)]
Chris Marusich <cmmarusich <at> gmail.com> writes:

> There is actually a bug report for this here:
>
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=36150
>
> I have submitted a patch upstream to fix the issue.

Upstream hasn't replied yet, but it's only been a week and a few days.
In the meantime, here are some patches to pull the fix into Guix.  While
I was here, I also taught "guix lint" to correctly check the file name
of patches when they come from an origin record.  I'll commit the sed
change to core-updates, and the lint change to master, in the next
couple days if nobody has any other comments.

-- 
Chris
[0001-gnu-sed-Make-it-build-on-SELinux-enabled-kernels.patch (text/x-patch, attachment)]
[0002-guix-lint-Support-origins-in-check-patch-file-names.patch (text/x-patch, attachment)]
[signature.asc (application/pgp-signature, inline)]

Reply sent to Chris Marusich <cmmarusich <at> gmail.com>:
You have taken responsibility. (Fri, 12 Jun 2020 05:45:02 GMT) Full text and rfc822 format available.

Notification sent to Chris Marusich <cmmarusich <at> gmail.com>:
bug acknowledged by developer. (Fri, 12 Jun 2020 05:45:02 GMT) Full text and rfc822 format available.

Message #16 received at 41498-close <at> debbugs.gnu.org (full text, mbox):

From: Chris Marusich <cmmarusich <at> gmail.com>
To: 41498-close <at> debbugs.gnu.org
Cc: Timothy Sample <samplet <at> ngyro.com>
Subject: Re: bug#41498: sed fails to build on kernels with selinux
Date: Thu, 11 Jun 2020 22:43:43 -0700
[Message part 1 (text/plain, inline)]
Hi,

With the attached patch, sed builds on my Fedora machine.  Yay!  There
was a small mistake in my prior email to this bug report, so you can
ignore that patch.

Chris Marusich <cmmarusich <at> gmail.com> writes:

> diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
> index 279fe9e3d8..f075ee8f74 100644
> --- a/gnu/packages/base.scm
> +++ b/gnu/packages/base.scm
> @@ -15,6 +15,7 @@
>  ;;; Copyright © 2018 Tobias Geerinckx-Rice <me <at> tobias.gr>
>  ;;; Copyright © 2018, 2019 Ricardo Wurmus <rekado <at> elephly.net>
>  ;;; Copyright © 2020 Vitaliy Shatrov <D0dyBo0D0dyBo0 <at> protonmail.com>
> +;;; Copyright © 2020 Chris Marusich <cmmarusich <at> gmail.com>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -141,7 +142,21 @@ including, for example, recursive directory searching.")
>                                  ".tar.gz"))
>              (sha256
>               (base32
> -              "0alqagh0nliymz23kfjg6g9w3cr086k0sfni56gi8fhzqwa3xksk"))))
> +              "0alqagh0nliymz23kfjg6g9w3cr086k0sfni56gi8fhzqwa3xksk"))
> +            ;; Remove this patch once upstream releases a fixed version.
> +            (patches
> +             (list
> +              (origin
> +                (method url-fetch)
> +                (uri (string-append
> +                      "https://debbugs.gnu.org/cgi/bugreport.cgi?"
> +                      "att=1;msg=16;bug=36150;filename=0001-tests-"
> +                      "Export-CONFIG_HEADER-to-test-scripts.patch"))
> +                (file-name
> +                 "sed-Export-CONFIG_HEADER-to-test-scripts.patch")
> +                (sha256
> +                 (base32
> +                  "0q78qzc0mv4bmsf7wnqj9fjbrwb71xz18v07h0jz2cwnbbj1nwm9")))))))
>     (build-system gnu-build-system)
>     (synopsis "Stream editor")
>     (native-inputs
> -- 
> 2.26.2

Even though this patch is appropriate for the sed maintainers, it is not
appropriate for use in Guix's sed package definition.  This is because
the patch changes testsuite/local.mk, which is used only when creating
the release distribution of sed (via an include directive in
Makefile.am), and Guix builds sed from a release distribution tarball.
As a result, even if Guix modifies the file, it does not have the
desired effect, and the test still fails for the same reason as before.
One way to work around this is to modify the Makefile.in, which is
generated by Automake and included in the release distribution.

I have gone ahead and committed the sed patch to core-updates in
a48a3f0640d76cb5e5945557c9aae6dabce39d93.  I have committed the guix
lint improvement to master in 21887021b9acf60157b1b0a39c16f2ec6498021b.
I am closing this bug report.

-- 
Chris
[0001-gnu-sed-Make-it-build-on-SELinux-enabled-kernels.patch (text/x-patch, attachment)]
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#41498; Package guix. (Sat, 13 Jun 2020 20:14:01 GMT) Full text and rfc822 format available.

Message #19 received at 41498 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: 41498 <at> debbugs.gnu.org
Cc: cmmarusich <at> gmail.com
Subject: Re: bug#41498: sed fails to build on kernels with selinux
Date: Sat, 13 Jun 2020 22:13:43 +0200
Hi,

Chris Marusich <cmmarusich <at> gmail.com> skribis:

> From 24edab1ef4ecedd2d9971a96a516d800d6933201 Mon Sep 17 00:00:00 2001
> From: Chris Marusich <cmmarusich <at> gmail.com>
> Date: Tue, 9 Jun 2020 23:35:56 -0700
> Subject: [PATCH] gnu: sed: Make it build on SELinux-enabled kernels.
>
> Fixes: <https://bugs.gnu.org/41498>.
>
> * gnu/packages/base.scm (sed)[origin][snippet]: New field.  This adds a
> snippet, equivalent to the patch submitted upstream, which fixes an
> issue that prevents sed from building on SELinux-enabled kernels.

LGTM, you can push to ‘core-updates’.

Thank you!

Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 12 Jul 2020 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 260 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.