public inbox for gentoo-pms@lists.gentoo.org
 help / color / mirror / Atom feed
From: James Le Cuirot <chewi@gentoo.org>
To: gentoo-pms@lists.gentoo.org
Subject: Re: [gentoo-pms] [PATCH] Correct the definition of ESYSROOT as EPREFIX isn't always applicable
Date: Fri, 14 Jun 2019 23:23:27 +0100	[thread overview]
Message-ID: <024EBD18-1089-4E36-A251-E52135C80625@gentoo.org> (raw)
In-Reply-To: <w6g8su53zal.fsf@kph.uni-mainz.de>

[-- Attachment #1: Type: text/plain, Size: 3000 bytes --]

On 13 June 2019 23:17:54 BST, Ulrich Mueller <ulm@gentoo.org> wrote:
>
>EPREFIX will be embedded into any (CHOST) binaries being built, so we
>want it to be applied in the same way for both DEPEND and RDEPEND,
>right? Why would it be appended to ROOT then, but not to SYSROOT?
>
>Also I still don't understand why BROOT (which points to the CBUILD
>system) would be used as a prefix for CHOST things.

What do you think SYSROOT is actually used for? As things stand, I'm
aware of:

* cross-pkg-config uses it to source .pc files within SYSROOT and the
  results are adjusted using ${PKG_CONFIG_SYSROOT_DIR}.
* econf adds --with-sysroot="${ESYSROOT:-/}" when the package is built
  with libtool as that is the only component that uses it.
* A small handful of ebuilds.
* My pending Python eclass changes.

If you want to build against a different SYSROOT than the one the
toolchain defaults to then you also need to add --sysroot=${ESYSROOT}
to CC and friends. cross-boss does this for you. I didn't do this in my
earlier prefix example because I was focusing on pkg-config.

Most of the above relates to locating headers and libraries within
SYSROOT to be built against, usually with -I and -L flags. They may
have been built using a different prefix but so what? The SYSROOT
libraries are not the ones that will be used at runtime; those are
built and installed separately into ROOT to satisfy RDEPEND. There are
admittedly a few headers that hard code prefixed paths but these are
the exception.

Remember that the only case where we're potentially forcing the prefix
to be different is the distinct SYSROOT case where it has to be blank.
That case is primarily just for getting the OS headers and libc in
place. We're not stopping users from using the same prefix for BROOT and
EPREFIX if they want to. Conversely, we're not stopping them from using
different prefixes right now either and that's been true since prefix
was introduced. You've always been able to do this from a system with a
different (or blank) prefix:

ROOT=/myroot EPREFIX=/myprefix emerge foo

Without any additional measures in place, this would build against
the build system's libraries and headers, despite the different prefix.
All we're doing now is formalising it around the ESYSROOT variable.

If you think this is too confusing or prone to breakage then we could
add a restriction that forces SYSROOT's prefix to be EPREFIX but this
would be a largely artificial restriction. We would have to change
crossdev to install to /myprefix/usr/${CHOST}/myprefix rather than
just /myprefix/usr/${CHOST} and I fear that could get messy.

I don't personally use prefix so I don't really have a horse in this
race. We're also talking about fairly edgy edge cases here. I've never
heard of any prefix users using ROOT. I just want to make sure our
package manager is built on solid standards that make sense. I also
want to do right by the prefix guys.

Cheers,
Chewi

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2019-06-14 22:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-01 22:29 [gentoo-pms] [PATCH] Correct the definition of ESYSROOT as EPREFIX isn't always applicable James Le Cuirot
2019-06-02  6:10 ` Michał Górny
2019-06-12 22:05   ` James Le Cuirot
2019-06-02 12:28 ` Ulrich Mueller
2019-06-12 22:05   ` James Le Cuirot
2019-06-14  7:07     ` Ulrich Mueller
2019-06-13 20:09   ` James Le Cuirot
2019-06-13 22:17     ` Ulrich Mueller
2019-06-14 22:23       ` James Le Cuirot [this message]
2019-06-14 22:30         ` James Le Cuirot
2019-06-15  8:18         ` Ulrich Mueller

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=024EBD18-1089-4E36-A251-E52135C80625@gentoo.org \
    --to=chewi@gentoo.org \
    --cc=gentoo-pms@lists.gentoo.org \
    /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