Openembedded Core Discussions
 help / color / mirror / Atom feed
* question about -native and prefix
@ 2016-06-05 21:35 Nicolas Dechesne
  2016-06-05 22:02 ` Richard Purdie
  0 siblings, 1 reply; 2+ messages in thread
From: Nicolas Dechesne @ 2016-06-05 21:35 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

hi,

i was looking at log files and I noticed that when building a 'native'
recipe ${prefix} is set to the sysroot path, e.g.

export prefix="/home/nicolas.dechesne/work/oe-rpb/build-rpb/tmp-rpb-glibc/sysroots/x86_64-linux/usr"

as such during do_install() files are typically installed in
${DESTDIR}${prefix}, and as such we end up with a 'weird' path, such
as :

x86_64-linux-libtool: install: /usr/bin/install -c
.libs/libopkg.so.1.0.0
/home/nicolas.dechesne/work/oe-rpb/build-rpb/tmp-rpb-glibc/work/x86_64-linux/opkg-native/1_0.3.0-r0/image/home/nicolas.dechesne/work/oe-rpb/build-rpb/tmp-rpb-glibc/sysroots/x86_64-linux/usr/lib/libopkg.so.1.\

e.g. the 'full path' of the sysroot is recreated inside ${D}. It
doesn't seem to make anything bad, but i just noticed it, and it
surprised me. what's the rationale for that?

I would have expected to find the sysroot 'relative' path in ${D}. no
the the absolute path.

cheers
nico


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: question about -native and prefix
  2016-06-05 21:35 question about -native and prefix Nicolas Dechesne
@ 2016-06-05 22:02 ` Richard Purdie
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Purdie @ 2016-06-05 22:02 UTC (permalink / raw)
  To: Nicolas Dechesne, Patches and discussions about the oe-core layer

Hi,

On Sun, 2016-06-05 at 23:35 +0200, Nicolas Dechesne wrote:
> i was looking at log files and I noticed that when building a
> 'native'
> recipe ${prefix} is set to the sysroot path, e.g.
> 
> export prefix="/home/nicolas.dechesne/work/oe-rpb/build-rpb/tmp-rpb
> -glibc/sysroots/x86_64-linux/usr"
> 
> as such during do_install() files are typically installed in
> ${DESTDIR}${prefix}, and as such we end up with a 'weird' path, such
> as :
> 
> x86_64-linux-libtool: install: /usr/bin/install -c
> .libs/libopkg.so.1.0.0
> /home/nicolas.dechesne/work/oe-rpb/build-rpb/tmp-rpb
> -glibc/work/x86_64-linux/opkg-native/1_0.3.0
> -r0/image/home/nicolas.dechesne/work/oe-rpb/build-rpb/tmp-rpb
> -glibc/sysroots/x86_64-linux/usr/lib/libopkg.so.1.\
> 
> e.g. the 'full path' of the sysroot is recreated inside ${D}. It
> doesn't seem to make anything bad, but i just noticed it, and it
> surprised me. what's the rationale for that?
> 
> I would have expected to find the sysroot 'relative' path in ${D}. n
> the the absolute path.

Whilst this looks a bit ugly, it is actually doing the right thing.
Native binaries are designed to install and run in $prefix. When we
install them in do_install, there is a DESTDIR as you mention which is
within WORKDIR, then a $prefix beyond that.

If you try and do anything else you end up handcrafting do_install for
natives, or the sysroot or some other solution and you end up having to
hack things. With this approach, whilst the paths are long, "it just
works". So it is actually by design and in the big picture does make
sense when you step back and think about it.

Cheers,

Richard



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-06-05 22:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-05 21:35 question about -native and prefix Nicolas Dechesne
2016-06-05 22:02 ` Richard Purdie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox