All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHv2] cmake: Avoid passing empty prefix to os.path.relpath
@ 2017-11-12 16:39 Mike Crowe
  2017-11-13 17:15 ` Otavio Salvador
  0 siblings, 1 reply; 7+ messages in thread
From: Mike Crowe @ 2017-11-12 16:39 UTC (permalink / raw)
  To: openembedded-core; +Cc: Mike Crowe

With meta-micro, ${prefix} is the empty string. This means that
CMAKE_INSTALL_BINDIR:PATH and friends end up containing paths starting with
many instances of "../", presumably due to os.path.relpath attempting to
find its way to the current directory.

Let's avoid this by ensuring that the root path always ends in a slash. If
it already ends in a slash then adding another one shouldn't cause any
problems.

Signed-off-by: Mike Crowe <mac@mcrowe.com>
---
 meta/classes/cmake.bbclass | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass
index ac2c1519b0..59797e121b 100644
--- a/meta/classes/cmake.bbclass
+++ b/meta/classes/cmake.bbclass
@@ -119,15 +119,15 @@ cmake_do_configure() {
 	  $oecmake_sitefile \
 	  ${OECMAKE_SOURCEPATH} \
 	  -DCMAKE_INSTALL_PREFIX:PATH=${prefix} \
-	  -DCMAKE_INSTALL_BINDIR:PATH=${@os.path.relpath(d.getVar('bindir'), d.getVar('prefix'))} \
-	  -DCMAKE_INSTALL_SBINDIR:PATH=${@os.path.relpath(d.getVar('sbindir'), d.getVar('prefix'))} \
-	  -DCMAKE_INSTALL_LIBEXECDIR:PATH=${@os.path.relpath(d.getVar('libexecdir'), d.getVar('prefix'))} \
+	  -DCMAKE_INSTALL_BINDIR:PATH=${@os.path.relpath(d.getVar('bindir'), d.getVar('prefix') + '/')} \
+	  -DCMAKE_INSTALL_SBINDIR:PATH=${@os.path.relpath(d.getVar('sbindir'), d.getVar('prefix') + '/')} \
+	  -DCMAKE_INSTALL_LIBEXECDIR:PATH=${@os.path.relpath(d.getVar('libexecdir'), d.getVar('prefix') + '/')} \
 	  -DCMAKE_INSTALL_SYSCONFDIR:PATH=${sysconfdir} \
-	  -DCMAKE_INSTALL_SHAREDSTATEDIR:PATH=${@os.path.relpath(d.getVar('sharedstatedir'), d.  getVar('prefix'))} \
+	  -DCMAKE_INSTALL_SHAREDSTATEDIR:PATH=${@os.path.relpath(d.getVar('sharedstatedir'), d.  getVar('prefix') + '/')} \
 	  -DCMAKE_INSTALL_LOCALSTATEDIR:PATH=${localstatedir} \
-	  -DCMAKE_INSTALL_LIBDIR:PATH=${@os.path.relpath(d.getVar('libdir'), d.getVar('prefix'))} \
-	  -DCMAKE_INSTALL_INCLUDEDIR:PATH=${@os.path.relpath(d.getVar('includedir'), d.getVar('prefix'))} \
-	  -DCMAKE_INSTALL_DATAROOTDIR:PATH=${@os.path.relpath(d.getVar('datadir'), d.getVar('prefix'))} \
+	  -DCMAKE_INSTALL_LIBDIR:PATH=${@os.path.relpath(d.getVar('libdir'), d.getVar('prefix') + '/')} \
+	  -DCMAKE_INSTALL_INCLUDEDIR:PATH=${@os.path.relpath(d.getVar('includedir'), d.getVar('prefix') + '/')} \
+	  -DCMAKE_INSTALL_DATAROOTDIR:PATH=${@os.path.relpath(d.getVar('datadir'), d.getVar('prefix') + '/')} \
 	  -DCMAKE_INSTALL_SO_NO_EXE=0 \
 	  -DCMAKE_TOOLCHAIN_FILE=${WORKDIR}/toolchain.cmake \
 	  -DCMAKE_VERBOSE_MAKEFILE=1 \
-- 
2.11.0



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

* Re: [PATCHv2] cmake: Avoid passing empty prefix to os.path.relpath
  2017-11-12 16:39 [PATCHv2] cmake: Avoid passing empty prefix to os.path.relpath Mike Crowe
@ 2017-11-13 17:15 ` Otavio Salvador
  2017-12-11  9:51   ` Mike Crowe
  0 siblings, 1 reply; 7+ messages in thread
From: Otavio Salvador @ 2017-11-13 17:15 UTC (permalink / raw)
  To: Mike Crowe; +Cc: Patches and discussions about the oe-core layer

On Sun, Nov 12, 2017 at 2:39 PM, Mike Crowe <mac@mcrowe.com> wrote:
> With meta-micro, ${prefix} is the empty string. This means that
> CMAKE_INSTALL_BINDIR:PATH and friends end up containing paths starting with
> many instances of "../", presumably due to os.path.relpath attempting to
> find its way to the current directory.
>
> Let's avoid this by ensuring that the root path always ends in a slash. If
> it already ends in a slash then adding another one shouldn't cause any
> problems.
>
> Signed-off-by: Mike Crowe <mac@mcrowe.com>

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>

-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750


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

* Re: [PATCHv2] cmake: Avoid passing empty prefix to os.path.relpath
  2017-11-13 17:15 ` Otavio Salvador
@ 2017-12-11  9:51   ` Mike Crowe
  2017-12-11 13:45     ` Burton, Ross
  0 siblings, 1 reply; 7+ messages in thread
From: Mike Crowe @ 2017-12-11  9:51 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer; +Cc: Otavio Salvador

On Monday 13 November 2017 at 15:15:35 -0200, Otavio Salvador wrote:
> On Sun, Nov 12, 2017 at 2:39 PM, Mike Crowe <mac@mcrowe.com> wrote:
> > With meta-micro, ${prefix} is the empty string. This means that
> > CMAKE_INSTALL_BINDIR:PATH and friends end up containing paths starting with
> > many instances of "../", presumably due to os.path.relpath attempting to
> > find its way to the current directory.
> >
> > Let's avoid this by ensuring that the root path always ends in a slash. If
> > it already ends in a slash then adding another one shouldn't cause any
> > problems.
> >
> > Signed-off-by: Mike Crowe <mac@mcrowe.com>
> 
> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>

Patch ID: 145709

It doesn't look like this change has landed, even on master-next. Has it
fallen through the cracks?

Thanks.

Mike.


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

* Re: [PATCHv2] cmake: Avoid passing empty prefix to os.path.relpath
  2017-12-11  9:51   ` Mike Crowe
@ 2017-12-11 13:45     ` Burton, Ross
  2017-12-20 10:28       ` Mike Crowe
  0 siblings, 1 reply; 7+ messages in thread
From: Burton, Ross @ 2017-12-11 13:45 UTC (permalink / raw)
  To: Mike Crowe
  Cc: Otavio Salvador, Patches and discussions about the oe-core layer

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

It was implicated in some build failures.  I'll re-add it and try again.

Ross

On 11 December 2017 at 09:51, Mike Crowe <mac@mcrowe.com> wrote:

> On Monday 13 November 2017 at 15:15:35 -0200, Otavio Salvador wrote:
> > On Sun, Nov 12, 2017 at 2:39 PM, Mike Crowe <mac@mcrowe.com> wrote:
> > > With meta-micro, ${prefix} is the empty string. This means that
> > > CMAKE_INSTALL_BINDIR:PATH and friends end up containing paths starting
> with
> > > many instances of "../", presumably due to os.path.relpath attempting
> to
> > > find its way to the current directory.
> > >
> > > Let's avoid this by ensuring that the root path always ends in a
> slash. If
> > > it already ends in a slash then adding another one shouldn't cause any
> > > problems.
> > >
> > > Signed-off-by: Mike Crowe <mac@mcrowe.com>
> >
> > Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
>
> Patch ID: 145709
>
> It doesn't look like this change has landed, even on master-next. Has it
> fallen through the cracks?
>
> Thanks.
>
> Mike.
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>

[-- Attachment #2: Type: text/html, Size: 2165 bytes --]

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

* Re: [PATCHv2] cmake: Avoid passing empty prefix to os.path.relpath
  2017-12-11 13:45     ` Burton, Ross
@ 2017-12-20 10:28       ` Mike Crowe
  2018-01-06 20:16         ` Mike Crowe
  0 siblings, 1 reply; 7+ messages in thread
From: Mike Crowe @ 2017-12-20 10:28 UTC (permalink / raw)
  To: Burton, Ross; +Cc: Patches and discussions about the oe-core layer

On Monday 11 December 2017 at 13:45:26 +0000, Burton, Ross wrote:
> It was implicated in some build failures.  I'll re-add it and try again.

Thanks. Are the new results in? I had a poke about on autobuilder.yocto.io
but couldn't work out how to tell which builds this commit was included in.
Build 719 did not appear to include it.

Thanks.

Mike.


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

* Re: [PATCHv2] cmake: Avoid passing empty prefix to os.path.relpath
  2017-12-20 10:28       ` Mike Crowe
@ 2018-01-06 20:16         ` Mike Crowe
  2019-06-11 13:58           ` Mike Crowe
  0 siblings, 1 reply; 7+ messages in thread
From: Mike Crowe @ 2018-01-06 20:16 UTC (permalink / raw)
  To: Burton, Ross; +Cc: Patches and discussions about the oe-core layer

https://patchwork.openembedded.org/patch/145709/

On Wednesday 20 December 2017 at 10:28:22 +0000, Mike Crowe wrote:
> On Monday 11 December 2017 at 13:45:26 +0000, Burton, Ross wrote:
> > It was implicated in some build failures.  I'll re-add it and try again.
> 
> Thanks. Are the new results in? I had a poke about on autobuilder.yocto.io
> but couldn't work out how to tell which builds this commit was included in.
> Build 719 did not appear to include it.

Any more news?

Thanks.

Mike.


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

* Re: [PATCHv2] cmake: Avoid passing empty prefix to os.path.relpath
  2018-01-06 20:16         ` Mike Crowe
@ 2019-06-11 13:58           ` Mike Crowe
  0 siblings, 0 replies; 7+ messages in thread
From: Mike Crowe @ 2019-06-11 13:58 UTC (permalink / raw)
  To: Burton, Ross; +Cc: Patches and discussions about the oe-core layer

On Saturday 06 January 2018 at 20:16:18 +0000, Mike Crowe wrote:
> https://patchwork.openembedded.org/patch/145709/
> 
> On Wednesday 20 December 2017 at 10:28:22 +0000, Mike Crowe wrote:
> > On Monday 11 December 2017 at 13:45:26 +0000, Burton, Ross wrote:
> > > It was implicated in some build failures.  I'll re-add it and try again.
> > 
> > Thanks. Are the new results in? I had a poke about on autobuilder.yocto.io
> > but couldn't work out how to tell which builds this commit was included in.
> > Build 719 did not appear to include it.
> 
> Any more news?
> 
> Thanks.

Hi Ross,

It looks like this patch never made it in. It still applies. Please can you
try adding it again?

Thanks.

Mike.

From c5b7a0584b6d37ecb28cd2aa3d9a9a80b0178e96 Mon Sep 17 00:00:00 2001
From: Mike Crowe <mac@mcrowe.com>
Date: Sun, 12 Nov 2017 14:16:20 +0000
Subject: [PATCHv2] cmake: Avoid passing empty prefix to os.path.relpath

With meta-micro, ${prefix} is the empty string. This means that
CMAKE_INSTALL_BINDIR:PATH and friends end up containing paths starting with
many instances of "../", presumably due to os.path.relpath attempting to
find its way to the current directory.

Let's avoid this by ensuring that the root path always ends in a slash. If
it already ends in a slash then adding another one shouldn't cause any
problems.

Signed-off-by: Mike Crowe <mac@mcrowe.com>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
 meta/classes/cmake.bbclass | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass
index a5cffedbc6..f80a7e2f1d 100644
--- a/meta/classes/cmake.bbclass
+++ b/meta/classes/cmake.bbclass
@@ -161,15 +161,15 @@ cmake_do_configure() {
 	  $oecmake_sitefile \
 	  ${OECMAKE_SOURCEPATH} \
 	  -DCMAKE_INSTALL_PREFIX:PATH=${prefix} \
-	  -DCMAKE_INSTALL_BINDIR:PATH=${@os.path.relpath(d.getVar('bindir'), d.getVar('prefix'))} \
-	  -DCMAKE_INSTALL_SBINDIR:PATH=${@os.path.relpath(d.getVar('sbindir'), d.getVar('prefix'))} \
-	  -DCMAKE_INSTALL_LIBEXECDIR:PATH=${@os.path.relpath(d.getVar('libexecdir'), d.getVar('prefix'))} \
+	  -DCMAKE_INSTALL_BINDIR:PATH=${@os.path.relpath(d.getVar('bindir'), d.getVar('prefix') + '/')} \
+	  -DCMAKE_INSTALL_SBINDIR:PATH=${@os.path.relpath(d.getVar('sbindir'), d.getVar('prefix') + '/')} \
+	  -DCMAKE_INSTALL_LIBEXECDIR:PATH=${@os.path.relpath(d.getVar('libexecdir'), d.getVar('prefix') + '/')} \
 	  -DCMAKE_INSTALL_SYSCONFDIR:PATH=${sysconfdir} \
-	  -DCMAKE_INSTALL_SHAREDSTATEDIR:PATH=${@os.path.relpath(d.getVar('sharedstatedir'), d.  getVar('prefix'))} \
+	  -DCMAKE_INSTALL_SHAREDSTATEDIR:PATH=${@os.path.relpath(d.getVar('sharedstatedir'), d.  getVar('prefix') + '/')} \
 	  -DCMAKE_INSTALL_LOCALSTATEDIR:PATH=${localstatedir} \
-	  -DCMAKE_INSTALL_LIBDIR:PATH=${@os.path.relpath(d.getVar('libdir'), d.getVar('prefix'))} \
-	  -DCMAKE_INSTALL_INCLUDEDIR:PATH=${@os.path.relpath(d.getVar('includedir'), d.getVar('prefix'))} \
-	  -DCMAKE_INSTALL_DATAROOTDIR:PATH=${@os.path.relpath(d.getVar('datadir'), d.getVar('prefix'))} \
+	  -DCMAKE_INSTALL_LIBDIR:PATH=${@os.path.relpath(d.getVar('libdir'), d.getVar('prefix') + '/')} \
+	  -DCMAKE_INSTALL_INCLUDEDIR:PATH=${@os.path.relpath(d.getVar('includedir'), d.getVar('prefix') + '/')} \
+	  -DCMAKE_INSTALL_DATAROOTDIR:PATH=${@os.path.relpath(d.getVar('datadir'), d.getVar('prefix') + '/')} \
 	  -DCMAKE_INSTALL_SO_NO_EXE=0 \
 	  -DCMAKE_TOOLCHAIN_FILE=${WORKDIR}/toolchain.cmake \
 	  -DCMAKE_NO_SYSTEM_FROM_IMPORTED=1 \
--
2.20.1


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

end of thread, other threads:[~2019-06-11 14:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-12 16:39 [PATCHv2] cmake: Avoid passing empty prefix to os.path.relpath Mike Crowe
2017-11-13 17:15 ` Otavio Salvador
2017-12-11  9:51   ` Mike Crowe
2017-12-11 13:45     ` Burton, Ross
2017-12-20 10:28       ` Mike Crowe
2018-01-06 20:16         ` Mike Crowe
2019-06-11 13:58           ` Mike Crowe

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.