All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH next v5 6/9] package/pkg-generic: adjust config scripts tweaks for per-package folders
Date: Fri, 23 Nov 2018 13:46:53 +0100	[thread overview]
Message-ID: <20181123134653.2097fa9b@windsurf> (raw)
In-Reply-To: <20181120205357.GK2601@scaer>

Hello Yann,

On Tue, 20 Nov 2018 21:53:57 +0100, Yann E. MORIN wrote:

> > diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
> > index 309fd8cd48..9b4db845b6 100644
> > --- a/package/pkg-generic.mk
> > +++ b/package/pkg-generic.mk
> > @@ -275,12 +275,13 @@ $(BUILD_DIR)/%/.stamp_staging_installed:
> >  	$(foreach hook,$($(PKG)_POST_INSTALL_STAGING_HOOKS),$(call $(hook))$(sep))
> >  	$(Q)if test -n "$($(PKG)_CONFIG_SCRIPTS)" ; then \
> >  		$(call MESSAGE,"Fixing package configuration files") ;\
> > -			$(SED)  "s,$(BASE_DIR), at BASE_DIR@,g" \
> > -				-e "s,$(STAGING_DIR), at STAGING_DIR@,g" \
> > +			$(SED)  "s,$(HOST_DIR), at HOST_DIR@,g" \
> > +				-e "s,$(BASE_DIR), at BASE_DIR@,g" \  
> 
> Previously, BASE_DIR was the very first thing replaced, but now it no
> longer is.

Correct.

> I'm not sure if I follow it all, but is the reason for that inversion
> hidden behhinde notes [0] and [1], being the need to create relative
> symlinks?

We're not creating symlinks here, we replacing absolute paths with
relative paths using the $(dirname $0) trick. But I guess that's what
you meant.

> As far as I understand, if BASE_DIR is kept as the first replacement,
> then we lose HOST_DIR as it (usually) is a subdir of BASE_DIR, so we end
> up with just @BASE_DIR@/host and thus can't easily replace it with
> relative paths anymore.

Exactly: if we replace $(BASE_DIR) by @BASE_DIR@, we can't easily
replace $(HOST_DIR) by @HOST_DIR@ anymore and then do the necessary
fixup.

The reason why the $(BASE_DIR) -> @BASE_DIR@ and then @BASE_DIR@ ->
$(BASE_DIR) replacement was added in commit
7701fc53d19be7cab8bddba72046a39e8421fd9e was to support the case where
build takes place in /usr.

The problem was that:

	s,-L/usr,-L at STAGING_DIR@/usr,g

would continuously re-add @STAGING_DIR@ if the build happens in a
sub-dir of /usr, because -L/usr will always match, even if the path has
already been fixed up.

The replacement of $(HOST_DIR) to @HOST_DIR@ before the $(BASE_DIR) to
@BASE_DIR@ replacement doesn't break this logic. If the path is in
$(HOST_DIR), it will have been replaced by @HOST_DIR@ and will not
match -L/usr, and then if the path is somewhere else in $(BASE_DIR), it
will be replaced by @BASE_DIR@, and the existing logic will continue to
work.

> Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

So, I'll take your Reviewed-by, but let me know if you're still
unconvinced for some reason.

Thanks!

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

  reply	other threads:[~2018-11-23 12:46 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-20 16:35 [Buildroot] [PATCH next v5 0/9] Per-package host/target directory support Thomas Petazzoni
2018-11-20 16:35 ` [Buildroot] [PATCH next v5 1/9] Makefile: evaluate CCACHE and HOST{CC, CXX} at time of use Thomas Petazzoni
2018-11-20 16:35 ` [Buildroot] [PATCH next v5 2/9] support/scripts/check-host-rpath: split condition on two statements Thomas Petazzoni
2018-11-20 16:35 ` [Buildroot] [PATCH next v5 3/9] Makefile: rework main directory creation logic Thomas Petazzoni
2018-11-20 16:35 ` [Buildroot] [PATCH next v5 4/9] Makefile: move .NOTPARALLEL statement after including .config file Thomas Petazzoni
2018-11-20 20:18   ` Yann E. MORIN
2018-11-21 13:44     ` Thomas Petazzoni
2018-11-20 16:35 ` [Buildroot] [PATCH next v5 5/9] Makefile: define TARGET_DIR_WARNING_FILE relative to TARGET_DIR Thomas Petazzoni
2018-11-20 20:32   ` Yann E. MORIN
2018-11-20 16:35 ` [Buildroot] [PATCH next v5 6/9] package/pkg-generic: adjust config scripts tweaks for per-package folders Thomas Petazzoni
2018-11-20 20:53   ` Yann E. MORIN
2018-11-23 12:46     ` Thomas Petazzoni [this message]
2018-11-20 16:35 ` [Buildroot] [PATCH next v5 7/9] core: implement per-package SDK and target Thomas Petazzoni
2018-11-20 21:36   ` Yann E. MORIN
2018-11-20 23:32     ` Arnout Vandecappelle
2018-11-23 13:25       ` Thomas Petazzoni
2018-11-23 15:44         ` Arnout Vandecappelle
2018-11-23 13:14     ` Thomas Petazzoni
2018-11-20 16:35 ` [Buildroot] [PATCH next v5 8/9] package/pkg-generic: make libtool .la files compatible with per-package folders Thomas Petazzoni
2018-11-20 16:35 ` [Buildroot] [PATCH next v5 9/9] package/pkg-kconfig: handle KCONFIG_DEPENDENCIES " 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=20181123134653.2097fa9b@windsurf \
    --to=thomas.petazzoni@bootlin.com \
    --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.