All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v7 3/8] core: implement per-package SDK and target
Date: Mon, 31 Dec 2018 15:45:34 +0100	[thread overview]
Message-ID: <20181231144534.GB21682@scaer> (raw)
In-Reply-To: <20181231153101.387c7d57@windsurf>

Thomas, All,

On 2018-12-31 15:31 +0100, Thomas Petazzoni spake thusly:
> On Sun, 30 Dec 2018 22:52:12 +0100, Yann E. MORIN wrote:
> > > There are two main benefits:
> > >  - Packages will no longer discover dependencies that they do not
> > >    explicitly indicate in their <pkg>_DEPENDENCIES variable.  
> > Note that non-expressed dependencies may still be gathered, if they are
> > transitive dependencies.
> Yes, of course, but what can we do about this ?

What I mean is, if

  - A needs B and C, but has a dependency only on B,
  - B depends on C,

then the dependency of A to C is fullfilled, even though it is missing
in the dependencies. I.e, it is a _hidden_ dependency. It is not
"explicitly indicate[d] in A_DEPENDENCIES" but still gathered.

And no, there is nothing we can do about it.

> It's pretty logical and
> obvious that transitive dependencies will be copied, no ?

Not as you wrote it.

So, you could rephrase as:

    Packages will now see only the dependencies they explicitly list in
    their <pkg>_DEPENDENCIES variable, and the recursive dependencies
    thereof.

> > > +PER_PACKAGE_DIR := $(BASE_DIR)/per-package  
> > 
> > Why don't you simply export this variable, like HOST_DIR and TARGET_DIR?
> > This would simplify calls to fix-rpath:
> 
> Because I generally don't like those global exports. It pollutes the
> namespace with some random variable that is really internal to
> Buildroot. There is no reason for the build system of all packages to
> even see this variable. In fact, I am personally not a big fan of
> exporting TARGET_DIR, STAGING_DIR, etc. since they become visible in
> packages, and people tend to use them in their package build system,
> which is very wrong.
> 
> Of course, if the overall consensus is that PER_PACKAGE_DIR should be
> exported, I'll do so because I don't want to hold this series just for
> this detail.

Oh, I would tend to agree with you.

I'm just pointing a discrepancy in the way those variables are handled,
and I think it is good to have some consistency, especially in this
difficult topic, even though said consistency's not very nice...

[--SNIP--]
> > > @@ -77,6 +93,7 @@ check_elf_has_rpath() {
> > >              dir="$( sed -r -e 's:/+:/:g; s:/$::;' <<<"${dir}" )"
> > >              [ "${dir}" = "${hostdir}/lib" ] && return 0
> > >              [ "${dir}" = "\$ORIGIN/../lib" ] && return 0
> > > +            [[ ${dir} =~ ${perpackagedir}/[^/]*/host/lib ]] && return 0  
> >                                             ^^^^^^^
> > That would also match the string '//' so maybe we want:
> > 
> >     ${perpackagedir}/([^/]+/)?host/lib
> 
> I'm not sure to understand the ? in ([^/]+/)?. We definitely want one
> path component between $(PER_PACKAGE_DIR) and host/lib. So what about:
> 
> 	${perpackagedir}/[^/]+/host/lib

Yes, that is it (and is what I eventually suggested in my review of
patch 5 (about fixing libtool.la files).

> > > +        if test "${rpath}" != "${changed_rpath}" ; then
> > > +            ${PATCHELF} --set-rpath ${changed_rpath} "${file}"  
> > 
> > Can't you do that unconditioanlly? If it's changed, we need to set it;
> > if it's not changed, that set it to the initial value anyway...
> 
> There is a reason to do it conditionally: patchelf is slow, you don't
> want to run patchelf when you don't need to, and here it's trivial to
> know whether it is useful or not to run it. For example, this condition
> ensures that people not using per-package directory don't pay the cost
> of running all those additional patchelf invocations.

OK.

Thanks! :-)

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

  reply	other threads:[~2018-12-31 14:45 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-28 10:43 [Buildroot] [PATCH v7 0/8] Top-level parallel build support Thomas Petazzoni
2018-12-28 10:43 ` [Buildroot] [PATCH v7 1/8] support/scripts/check-host-rpath: document existing functions Thomas Petazzoni
2018-12-28 12:47   ` Yann E. MORIN
2019-01-17 21:33   ` Peter Korsgaard
2018-12-28 10:43 ` [Buildroot] [PATCH v7 2/8] Makefile: move definition of TARGET_DIR inside .config condition Thomas Petazzoni
2018-12-28 12:49   ` Yann E. MORIN
2019-01-17 21:35   ` Peter Korsgaard
2018-12-28 10:43 ` [Buildroot] [PATCH v7 3/8] core: implement per-package SDK and target Thomas Petazzoni
2018-12-30 21:52   ` Yann E. MORIN
2018-12-31 14:31     ` Thomas Petazzoni
2018-12-31 14:45       ` Yann E. MORIN [this message]
2019-01-08 18:02   ` Jan Kundrát
2019-11-05 16:38     ` Thomas Petazzoni
2019-11-05 19:05       ` Carlos Santos
2019-11-06  7:57         ` Thomas Petazzoni
2019-11-06  8:13           ` Jan Kundrát
2018-12-28 10:43 ` [Buildroot] [PATCH v7 4/8] Makefile: allow top-level parallel build with BR2_PER_PACKAGE_DIRECTORIES=y Thomas Petazzoni
2018-12-28 12:51   ` Yann E. MORIN
2018-12-28 10:43 ` [Buildroot] [PATCH v7 5/8] package/pkg-generic: make libtool .la files compatible with per-package directories Thomas Petazzoni
2018-12-31  8:44   ` Yann E. MORIN
2018-12-28 10:43 ` [Buildroot] [PATCH v7 6/8] package/pkg-kconfig: handle KCONFIG_DEPENDENCIES " Thomas Petazzoni
2018-12-28 10:43 ` [Buildroot] [PATCH v7 7/8] docs/manual: add details about top-level parallel build support Thomas Petazzoni
2018-12-28 13:03   ` Yann E. MORIN
2018-12-28 13:08     ` Thomas Petazzoni
2018-12-31  8:46       ` Yann E. MORIN
2018-12-28 10:43 ` [Buildroot] [PATCH v7 8/8] docs/manual: document the effect of per-package directory on variables Thomas Petazzoni
2018-12-28 17:21 ` [Buildroot] [PATCH v7 0/8] Top-level parallel build support Thomas Petazzoni
2019-02-22 16:18   ` Andreas Naumann
2019-02-22 18:07     ` Vadim Kochan
2019-02-22 20:29       ` Thomas Petazzoni
2019-02-25  1:10         ` Vadim Kochan
2019-02-25  8:05           ` Thomas Petazzoni
2019-02-25  8:33             ` Vadim Kochan
2019-03-01 14:50             ` Vadym Kochan
2019-03-01 17:18               ` Yann E. MORIN
2019-03-04  7:24                 ` Arnout Vandecappelle
2019-03-04 10:22                   ` Thomas Petazzoni

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=20181231144534.GB21682@scaer \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@busybox.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.