FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo Development

 
 
LinkBack Thread Tools
 
Old 11-04-2011, 01:46 PM
Mike Gilbert
 
Default linux-info.eclass: check_extra_config requires a configured kernel

On 11/4/2011 8:59 AM, "Paweł Hajdan, Jr." wrote:
> Thoughts?
>

Shouldn't chromium be dealing with this at run-time where it actually
matters? This would be better than doing it in the ebuild where we can
only do it at build and/or install-time.

It is good that we warn users about this when they install the package,
but I don't think the ebuild should die.
 
Old 11-04-2011, 02:11 PM
Fabio Erculiani
 
Default linux-info.eclass: check_extra_config requires a configured kernel

On Fri, Nov 4, 2011 at 3:46 PM, Mike Gilbert <floppym@gentoo.org> wrote:
>
> It is good that we warn users about this when they install the package,
> but I don't think the ebuild should die.

I've always found ebuilds dying at kernel config checks really annoying.
Checking kernel features at build time (if we die) is broken and
should be banned IMO:

1) in case of packages not needing kernel headers for building (but
just checking for a feature)
a) this breaks the compilation inside chroots on build servers where
the goal is to just build the package (hint: binpkgs)
b) it is anyway unable to reliably check if the feature is actually
available or not (/proc/config.gz might be unavailable, as well as
kernel sources or headers)

2) in case of packages needing kernel headers (or sources) for building
a) doing the check in pkg_setup() breaks binpkgs support (the check
becomes part of a build time task, and not install time)

I'm sure there are other reasons as well...

--
Fabio Erculiani
http://lxnay.com
 
Old 11-04-2011, 02:29 PM
Ian Stakenvicius
 
Default linux-info.eclass: check_extra_config requires a configured kernel

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 04/11/11 11:11 AM, Fabio Erculiani wrote:
> On Fri, Nov 4, 2011 at 3:46 PM, Mike Gilbert <floppym@gentoo.org> wrote:
>>
>> It is good that we warn users about this when they install the package,
>> but I don't think the ebuild should die.
>
> I've always found ebuilds dying at kernel config checks really annoying.
> Checking kernel features at build time (if we die) is broken and
> should be banned IMO:
>
> 1) in case of packages not needing kernel headers for building (but
> just checking for a feature)
> a) this breaks the compilation inside chroots on build servers where
> the goal is to just build the package (hint: binpkgs)
> b) it is anyway unable to reliably check if the feature is actually
> available or not (/proc/config.gz might be unavailable, as well as
> kernel sources or headers)

As i think has already been mentioned, when building binpkgs or building
for other systems, since the idea here is to ensure build-time
requirements are met, things should be OK as long as you have a
configured kernel for the target in place as well. And you probably
should; if you're building packages for target systems you might as well
configure and/or build their kernels too.

Also as was mentioned, /proc/config.gz would never be appropriate in
these cases since the running kernel probably has nothing to do with the
target system's kernel.

>
> 2) in case of packages needing kernel headers (or sources) for building
> a) doing the check in pkg_setup() breaks binpkgs support (the check
> becomes part of a build time task, and not install time)

.. so you're recommending the check be moved to pkg_preinst() ? Or
perhaps duplicated into both pkg_setup/pkg_pretend and pkg_preinst ?
That would be doable, wouldn't it?

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (GNU/Linux)

iF4EAREIAAYFAk60BMQACgkQAJxUfCtlWe17qwEAhh2udNzptI JZHeEyh8DJhTj3
HLbC/ZpIJUQTbpHueOEBAITcA3DasGAQIdSWGvn7E2xwYMFTS+U0UyD WJCesv5xR
=U+gT
-----END PGP SIGNATURE-----
 
Old 11-04-2011, 02:54 PM
Fabio Erculiani
 
Default linux-info.eclass: check_extra_config requires a configured kernel

pkg_setup() is shared between binpkgs and srcpkgs, and often it ends
up containing stuff that should be rather placed into
src_{prepare,configure,whatever}.

--
Fabio Erculiani
http://lxnay.com
 
Old 11-04-2011, 08:16 PM
"Robin H. Johnson"
 
Default linux-info.eclass: check_extra_config requires a configured kernel

On Fri, Nov 04, 2011 at 01:59:14PM +0100, "Paweł Hajdan, Jr." wrote:
> check_extra_config requires a configured kernel
> (/usr/src/linux/.config), while I think it should also be satisfied by
> /proc/config.gz (i.e. just a way to verify the config, not necessarily
> kernel built locally).
>
> An example use case is www-client/chromium, which makes sure the kernel
> will support its sandbox. It's generally a bad idea to run without full
> sandboxing support (it can work without kernel support, just doesn't
> prevent a compromised renderer from connecting to network or sending
> signals to processes).
chromium is using CONFIG_CHECK wrongly.
It should be CONFIG_CHECK="~PID_NS ~NET_NS"

- Does the package _build_ kernel modules?
Yes: .config is required.
No: .config is NOT required. All options must have '~' prefix.
- Does the package use the options specified _during_ src_configure,
src_compile, src_test process?
(eg there's a testsuite that uses namespaces).
Yes: .config/config.gz may not be available, devise an actual test
that tries to use the option.
No: Just keep the ~ prefix on the option.

> # In the case where we don't require a .config, we can now bail out
> # if the user has no .config as there is nothing to do. Otherwise
> # code later will cause a failure due to missing .config.
> if ! linux_config_exists; then
[snip]
> fi
This will cause out-of-kernel module building to fail much later instead
of correctly failing early when there is no .config.

--
Robin Hugh Johnson
Gentoo Linux: Developer, Trustee & Infrastructure Lead
E-Mail : robbat2@gentoo.org
GnuPG FP : 11AC BA4F 4778 E3F6 E4ED F38E B27B 944E 3488 4E85
 
Old 11-04-2011, 08:18 PM
"Robin H. Johnson"
 
Default linux-info.eclass: check_extra_config requires a configured kernel

On Fri, Nov 04, 2011 at 04:11:42PM +0100, Fabio Erculiani wrote:
> On Fri, Nov 4, 2011 at 3:46 PM, Mike Gilbert <floppym@gentoo.org> wrote:
> >
> > It is good that we warn users about this when they install the package,
> > but I don't think the ebuild should die.
>
> I've always found ebuilds dying at kernel config checks really annoying.
> Checking kernel features at build time (if we die) is broken and
> should be banned IMO:
You're going off on a tangent.

The ONLY time that kernel config checks are fatal is when you're
building kernel modules, and the module will fail to compile unless
there is a .config and suitable options set.

chromium is using the fatal mode of CONFIG_CHECK wrongly.

--
Robin Hugh Johnson
Gentoo Linux: Developer, Trustee & Infrastructure Lead
E-Mail : robbat2@gentoo.org
GnuPG FP : 11AC BA4F 4778 E3F6 E4ED F38E B27B 944E 3488 4E85
 
Old 11-04-2011, 09:02 PM
Fabio Erculiani
 
Default linux-info.eclass: check_extra_config requires a configured kernel

On Fri, Nov 4, 2011 at 10:18 PM, Robin H. Johnson <robbat2@gentoo.org> wrote:
> On Fri, Nov 04, 2011 at 04:11:42PM +0100, Fabio Erculiani wrote:
>> On Fri, Nov 4, 2011 at 3:46 PM, Mike Gilbert <floppym@gentoo.org> wrote:
>> >
>> > It is good that we warn users about this when they install the package,
>> > but I don't think the ebuild should die.
>>
>> I've always found ebuilds dying at kernel config checks really annoying.
>> Checking kernel features at build time (if we die) is broken and
>> should be banned IMO:
> You're going off on a tangent.
>
> The ONLY time that kernel config checks are fatal is when you're
> building kernel modules, and the module will fail to compile unless
> there is a .config and suitable options set.

And that is bad anyway, because it doesn't work as expected when the
package is merged from tbz2, there are no kernel sources installed and
multiple kernels are on the same system (and perhaps you are using a
package manager that properly supports multiple installed kernel
module packages).

>
> chromium is using the fatal mode of CONFIG_CHECK wrongly.
>
> --
> Robin Hugh Johnson
> Gentoo Linux: Developer, Trustee & Infrastructure Lead
> E-Mail * * : robbat2@gentoo.org
> GnuPG FP * : 11AC BA4F 4778 E3F6 E4ED *F38E B27B 944E 3488 4E85
>
>



--
Fabio Erculiani
http://lxnay.com
 
Old 11-04-2011, 09:12 PM
"Robin H. Johnson"
 
Default linux-info.eclass: check_extra_config requires a configured kernel

On Fri, Nov 04, 2011 at 11:02:18PM +0100, Fabio Erculiani wrote:
> > The ONLY time that kernel config checks are fatal is when you're
> > building kernel modules, and the module will fail to compile unless
> > there is a .config and suitable options set.
> And that is bad anyway, because it doesn't work as expected when the
> package is merged from tbz2, there are no kernel sources installed and
> multiple kernels are on the same system (and perhaps you are using a
> package manager that properly supports multiple installed kernel
> module packages).
I said when you're building. When you're merging from binpkg, you're not
building...

--
Robin Hugh Johnson
Gentoo Linux: Developer, Trustee & Infrastructure Lead
E-Mail : robbat2@gentoo.org
GnuPG FP : 11AC BA4F 4778 E3F6 E4ED F38E B27B 944E 3488 4E85
 
Old 11-04-2011, 09:16 PM
Fabio Erculiani
 
Default linux-info.eclass: check_extra_config requires a configured kernel

On Fri, Nov 4, 2011 at 11:12 PM, Robin H. Johnson <robbat2@gentoo.org> wrote:
> On Fri, Nov 04, 2011 at 11:02:18PM +0100, Fabio Erculiani wrote:
>> > The ONLY time that kernel config checks are fatal is when you're
>> > building kernel modules, and the module will fail to compile unless
>> > there is a .config and suitable options set.
>> And that is bad anyway, because it doesn't work as expected when the
>> package is merged from tbz2, there are no kernel sources installed and
>> multiple kernels are on the same system (and perhaps you are using a
>> package manager that properly supports multiple installed kernel
>> module packages).
> I said when you're building. When you're merging from binpkg, you're not
> building...

Correct :-)

>
> --
> Robin Hugh Johnson
> Gentoo Linux: Developer, Trustee & Infrastructure Lead
> E-Mail * * : robbat2@gentoo.org
> GnuPG FP * : 11AC BA4F 4778 E3F6 E4ED *F38E B27B 944E 3488 4E85
>
>



--
Fabio Erculiani
http://lxnay.com
 
Old 11-05-2011, 10:14 PM
"Robin H. Johnson"
 
Default linux-info.eclass: check_extra_config requires a configured kernel

On Fri, Nov 04, 2011 at 09:16:13PM +0000, Robin H. Johnson wrote:
> - Does the package _build_ kernel modules?
> Yes: .config is required.
> No: .config is NOT required. All options must have '~' prefix.
> - Does the package use the options specified _during_ src_configure,
> src_compile, src_test process?
> (eg there's a testsuite that uses namespaces).
> Yes: .config/config.gz may not be available, devise an actual test
> that tries to use the option.
> No: Just keep the ~ prefix on the option.
I've just checked _every_ ebuild in the tree that:
(used CONFIG_CHECK with non-~ arguments)
AND
(did not inherit linux-mod).
I've fixed almost all of them.

Testcase was building on a system with no /usr/src, no /proc/config*.

I fixed one or more ebuilds in each of the following packages:
app-emulation/spice-vdagent
gnome-extra/nautilus-dropbox
net-misc/iodine
net-wireless/madwimax
sys-block/open-iscsi

I did NOT fix:
www-client/chromium-16.0.912.15 (failed to build for unrelated reasons).

TODO:
- Look for ebuilds that call the check functions manually.
- Check all ebuilds inheriting linux-mod, with USE=-modules.

--
Robin Hugh Johnson
Gentoo Linux: Developer, Trustee & Infrastructure Lead
E-Mail : robbat2@gentoo.org
GnuPG FP : 11AC BA4F 4778 E3F6 E4ED F38E B27B 944E 3488 4E85
 

Thread Tools




All times are GMT. The time now is 10:08 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org