Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 358999 - Remove old-style virtual/os-headers
Summary: Remove old-style virtual/os-headers
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 350792
  Show dependency tree
 
Reported: 2011-03-15 11:17 UTC by Ulrich Müller
Modified: 2011-04-14 06:14 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
os-headers-0.ebuild for review (os-headers-0.ebuild,626 bytes, text/plain)
2011-04-07 15:15 UTC, Ulrich Müller
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ulrich Müller gentoo-dev 2011-03-15 11:17:48 UTC
See tracker bug 350792.

virtual/os-headers
   packages:
      sys-freebsd/freebsd-lib
      sys-kernel/linux-headers

Please convert to a new-style virtual.

Notes:
- Keywords for the packages are mutually exclusive, so I think that neither
  blockers, nor USE_EXPAND logic (like "kernel_foo? ( some-cat/foo-headers )")
  are needed here.
- Not sure what needs to be done for prefix. Maybe prefix profiles could simply
  add the new-style virtual to package.provided?
Comment 1 Ulrich Müller gentoo-dev 2011-04-05 22:30:19 UTC
(In reply to comment #0)
> - Not sure what needs to be done for prefix. Maybe prefix profiles could
>   simply add the new-style virtual to package.provided?

Or, even simpler, the virtual could depend on:

RDEPEND="!prefix? (
        || ( sys-kernel/linux-headers
            sys-freebsd/freebsd-lib )
    )"

Unless I'm missing something, there would be no need for package.provided.
Comment 2 SpanKY gentoo-dev 2011-04-06 22:36:42 UTC
i dont think works.  look at the prefix profiles ... they have many things encoded in there for virtual/os-headers.
Comment 3 Ulrich Müller gentoo-dev 2011-04-06 23:12:06 UTC
(In reply to comment #2)
> i dont think works.  look at the prefix profiles ... they have many things
> encoded in there for virtual/os-headers.

Right. The typical scheme is (e.g. in profiles/prefix/darwin) that they have a line like:
  virtual/os-headers   sys-darwin/libsystem
in their virtuals file. But sys-darwin/libsystem isn't a real package and occurs only in the profile's package.provided file.

@Prefix team: Could you please comment? Would such trickery still be needed with a new-style virtual (which could honour the "prefix" USE flag)?
Comment 4 Fabian Groffen gentoo-dev 2011-04-07 08:05:28 UTC
as far as I remember, at some time in the past, portage required virtual/os-headers and virtual/libc to exist

This makes sense in a real Gentoo Linux world, but doesn't in the Gentoo Prefix case where one is running on top of another OS.  We simply used package.provided to "satisfy" the requirement for both virtuals.

Nowadays, Portage itself doesn't barf any more when both are missing.  virtual/libc is rarely used in the tree any more, which is good for us, since that means no missing dependency.  I don't think I've encountered virtual/os-headers in the tree, ever, so I guess it can go as well.
Comment 5 Fabian Groffen gentoo-dev 2011-04-07 08:09:41 UTC
(In reply to comment #3)
> @Prefix team: Could you please comment? Would such trickery still be needed
> with a new-style virtual (which could honour the "prefix" USE flag)?

We don't need any specifics, by the way.  As long as the virtual is satisfied (a generic package (host-libc, host-osheaders) if necessary is enough.  There is no such logic that depends on the names and versions that are encoded in package.provided.
Comment 6 Ulrich Müller gentoo-dev 2011-04-07 10:46:59 UTC
(In reply to comment #5)
> We don't need any specifics, by the way.  As long as the virtual is satisfied
> (a generic package (host-libc, host-osheaders) if necessary is enough.

You mean, change the RDEPEND in comment #1 to something like:

RDEPEND="!prefix? (
        || ( sys-kernel/linux-headers
             sys-freebsd/freebsd-lib )
    )
    prefix? (
        || ( sys-foo/foo-headers
             sys-bar/bar-headers
             ... )"

with sys-foo/foo-headers etc. in package.provided?

I still don't see for what the "prefix? ( )" part would be needed, because it doesn't pull in any real packages. Am I missing something?
Comment 7 Fabian Groffen gentoo-dev 2011-04-07 10:53:08 UTC
I'd rather omit the prefix? ( ... ) bit as well, like comment #1
Comment 8 Michael Haubenwallner (RETIRED) gentoo-dev 2011-04-07 11:58:05 UTC
Didn't follow the whole discussion, just to note I do have this in some package here:

RDEPEND="
  kerberos? (
    || (
      app-crypt/mit-krb5
      sys-winnt/libc
    )
  )
"

On Windows it uses GSSAPI (IIRC), while mit-krb5 (no winnt keyword) elsewhere.

How would I write that without creating another virtual/kerberos?

While disliking negations, the only thing I can imagine for now is:
RDEPEND="
  kerberos? (
    || (
      !elibc_Winnt? (
        app-crypt/mit-krb5
      )
    )
  )
"
Comment 9 Ulrich Müller gentoo-dev 2011-04-07 15:15:27 UTC
Created attachment 268863 [details]
os-headers-0.ebuild for review

(In reply to comment #7)
> I'd rather omit the prefix? ( ... ) bit as well, like comment #1

Let's go with that, then.

Please review attached ebuild. KEYWORDS are derived from reverse dependencies of virtual/os-headers in gentoo-x86 and prefix trees.
Comment 10 Fabian Groffen gentoo-dev 2011-04-07 15:19:27 UTC
looks good to me, thanks for your work
Comment 11 Ulrich Müller gentoo-dev 2011-04-07 15:38:16 UTC
(In reply to comment #8)
> Didn't follow the whole discussion, just to note I do have this in some
> package here:
> 
> RDEPEND="
>   kerberos? (
>     || (
>       app-crypt/mit-krb5
>       sys-winnt/libc
>     )
>   )
> "

That's only loosely related to this bug. The new virtual/os-headers wouldn't need sys-winnt/libc (and its friends in other profiles) any more, but this doesn't necessarily imply that these packages should be removed from package.provided.

> While disliking negations, the only thing I can imagine for now is:
> RDEPEND="
>   kerberos? (
>     || (
>       !elibc_Winnt? (
>         app-crypt/mit-krb5
>       )
>     )
>   )
> "

Hm, if elibc_Winnt evaluates to true, then you end up with an empty || ( ) group. Better rewrite the above as follows:

    kerberos? (
        !elibc_Winnt? ( app-crypt/mit-krb5 )
    )

Otherwise, I don't see anything wrong with it.
Comment 12 Michael Haubenwallner (RETIRED) gentoo-dev 2011-04-07 15:51:07 UTC
(In reply to comment #9)
> Please review attached ebuild. KEYWORDS are derived from reverse dependencies
> of virtual/os-headers in gentoo-x86 and prefix trees.

Shouldn't it contain /any/ keyword found in arch.list?
(stable for archs doing stable keywords, unstable otherways)

(In reply to comment #11)
>     kerberos? (
>         !elibc_Winnt? ( app-crypt/mit-krb5 )
>     )
> 
> Otherwise, I don't see anything wrong with it.

fine.
Comment 13 Ulrich Müller gentoo-dev 2011-04-07 16:08:43 UTC
(In reply to comment #12)
> > KEYWORDS are derived from reverse dependencies of virtual/os-headers in
> > gentoo-x86 and prefix trees.
> 
> Shouldn't it contain /any/ keyword found in arch.list?

Not sure. The keywords derived from reverse dependencies turned out to be the same ones as in virtual/editor. I took this as an indication that it must be right. ;)

The missing(?) keywords are:

   ~x86-cygwin
   ~sparc64-freebsd
   ~mips-irix
   ~arm-linux
   ~x86-netbsd
   ~ppc-openbsd
   ~x64-openbsd
   ~x86-openbsd
   ~x86-winnt

Prefix team, please decide if some or all of them should be added.
Comment 14 Fabian Groffen gentoo-dev 2011-04-07 16:29:16 UTC
They should be missing, IMO, as there are no ebuilds keyworded with those keywords (and there is no intention to do so in the forseeable future).
Comment 15 Ulrich Müller gentoo-dev 2011-04-07 16:47:34 UTC
I just see that kernel-2.eclass does the following for linux-headers:

        if [[ ${CTARGET} = ${CHOST} ]]; then
                DEPEND="!virtual/os-headers"
                PROVIDE="virtual/os-headers"
                SLOT="0"
        else
                SLOT="${CTARGET}"
        fi

(Which breaks the metadata cache, BTW.)

Should the virtual depend on sys-kernel/linux-headers:0 to be on the safe side? This would imply EAPI=1.
Comment 16 Ulrich Müller gentoo-dev 2011-04-14 06:14:58 UTC
New virtual committed, profiles and ebuilds updated.