public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
* [PATCH 0/2] autotools.bbclass: use relative path to run configure script
@ 2016-01-11  5:11 Robert Yang
  2016-01-11  5:11 ` [PATCH 1/2] glibc-initial.inc: use relative path to run configure Robert Yang
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Robert Yang @ 2016-01-11  5:11 UTC (permalink / raw)
  To: openembedded-core

Hi,

The 2 patches can reduce a lot of QA Issues for buildpaths.

// Robert

The following changes since commit 5661d8cb7849df62358368743134c0aaf523965e:

  image: Really remove lockfiles flag (2016-01-07 13:41:47 +0000)

are available in the git repository at:

  git://git.openembedded.org/openembedded-core-contrib rbt/relative
  http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=rbt/relative

Robert Yang (2):
  glibc-initial.inc: use relative path to run configure
  autotools.bbclass: use relative path to run configure script

 meta/classes/autotools.bbclass            |    4 +++-
 meta/recipes-core/glibc/glibc-initial.inc |    2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

-- 
1.7.9.5



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

* [PATCH 1/2] glibc-initial.inc: use relative path to run configure
  2016-01-11  5:11 [PATCH 0/2] autotools.bbclass: use relative path to run configure script Robert Yang
@ 2016-01-11  5:11 ` Robert Yang
  2016-01-11 14:55   ` Trevor Woerner
  2016-01-11  5:11 ` [PATCH 2/2] autotools.bbclass: use relative path to run configure script Robert Yang
  2016-01-12  2:04 ` [PATCH 0/2] " Robert Yang
  2 siblings, 1 reply; 8+ messages in thread
From: Robert Yang @ 2016-01-11  5:11 UTC (permalink / raw)
  To: openembedded-core

Avoid potential build path in output files.

[YOCTO #8894]

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
 meta/recipes-core/glibc/glibc-initial.inc |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-core/glibc/glibc-initial.inc b/meta/recipes-core/glibc/glibc-initial.inc
index 8e81f09..cb2f8dd 100644
--- a/meta/recipes-core/glibc/glibc-initial.inc
+++ b/meta/recipes-core/glibc/glibc-initial.inc
@@ -11,7 +11,7 @@ TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_TCBOOTSTRAP}"
 do_configure () {
 	(cd ${S} && gnu-configize) || die "failure in running gnu-configize"
 	find ${S} -name "configure" | xargs touch
-	${S}/configure --host=${TARGET_SYS} --build=${BUILD_SYS} \
+	../git/configure --host=${TARGET_SYS} --build=${BUILD_SYS} \
 		--prefix=/usr \
 		--without-cvs --disable-sanity-checks \
 		--with-headers=${STAGING_DIR_TARGET}${includedir} \
-- 
1.7.9.5



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

* [PATCH 2/2] autotools.bbclass: use relative path to run configure script
  2016-01-11  5:11 [PATCH 0/2] autotools.bbclass: use relative path to run configure script Robert Yang
  2016-01-11  5:11 ` [PATCH 1/2] glibc-initial.inc: use relative path to run configure Robert Yang
@ 2016-01-11  5:11 ` Robert Yang
  2016-01-12  2:04 ` [PATCH 0/2] " Robert Yang
  2 siblings, 0 replies; 8+ messages in thread
From: Robert Yang @ 2016-01-11  5:11 UTC (permalink / raw)
  To: openembedded-core

The absolute path (/path/to/configure) caused VPATH in Makefile to be an
absolute path, and then it will be in elf files, use relative path to
run configure can fix the problem.

This will reduce a lot of buildpaths QA issues in a world buld.

[YOCTO #8894]

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
 meta/classes/autotools.bbclass |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/meta/classes/autotools.bbclass b/meta/classes/autotools.bbclass
index d546a5c..44cb422 100644
--- a/meta/classes/autotools.bbclass
+++ b/meta/classes/autotools.bbclass
@@ -83,7 +83,9 @@ CONFIGURE_SCRIPT ?= "${AUTOTOOLS_SCRIPT_PATH}/configure"
 AUTOTOOLS_AUXDIR ?= "${AUTOTOOLS_SCRIPT_PATH}"
 
 oe_runconf () {
-	cfgscript="${CONFIGURE_SCRIPT}"
+	# Use relative path to avoid buildpaths in files
+	cfgscript_name="`basename ${CONFIGURE_SCRIPT}`"
+	cfgscript=`python -c "import os; print os.path.relpath(os.path.dirname('${CONFIGURE_SCRIPT}'), '.')"`/$cfgscript_name
 	if [ -x "$cfgscript" ] ; then
 		bbnote "Running $cfgscript ${CONFIGUREOPTS} ${EXTRA_OECONF} $@"
 		set +e
-- 
1.7.9.5



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

* Re: [PATCH 1/2] glibc-initial.inc: use relative path to run configure
  2016-01-11  5:11 ` [PATCH 1/2] glibc-initial.inc: use relative path to run configure Robert Yang
@ 2016-01-11 14:55   ` Trevor Woerner
  2016-01-11 15:06     ` Mark Hatle
  0 siblings, 1 reply; 8+ messages in thread
From: Trevor Woerner @ 2016-01-11 14:55 UTC (permalink / raw)
  To: Robert Yang, openembedded-core



On 01/11/16 00:11, Robert Yang wrote:
> Avoid potential build path in output files.
>
> [YOCTO #8894]
>
> Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
> ---
>  meta/recipes-core/glibc/glibc-initial.inc |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/meta/recipes-core/glibc/glibc-initial.inc b/meta/recipes-core/glibc/glibc-initial.inc
> index 8e81f09..cb2f8dd 100644
> --- a/meta/recipes-core/glibc/glibc-initial.inc
> +++ b/meta/recipes-core/glibc/glibc-initial.inc
> @@ -11,7 +11,7 @@ TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_TCBOOTSTRAP}"
>  do_configure () {
>  	(cd ${S} && gnu-configize) || die "failure in running gnu-configize"
>  	find ${S} -name "configure" | xargs touch
> -	${S}/configure --host=${TARGET_SYS} --build=${BUILD_SYS} \
> +	../git/configure --host=${TARGET_SYS} --build=${BUILD_SYS} \

Although I haven't tested it, this _looks_ like it might fail quite
readily. I'm sure there are some recipes that play tricks with ${S}, and
what about recipes that don't pull their sources from git?

Maybe something like: (cd ${S} && ./configure ...) would be better?

>  		--prefix=/usr \
>  		--without-cvs --disable-sanity-checks \
>  		--with-headers=${STAGING_DIR_TARGET}${includedir} \



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

* Re: [PATCH 1/2] glibc-initial.inc: use relative path to run configure
  2016-01-11 14:55   ` Trevor Woerner
@ 2016-01-11 15:06     ` Mark Hatle
  2016-01-11 16:18       ` Christopher Larson
  0 siblings, 1 reply; 8+ messages in thread
From: Mark Hatle @ 2016-01-11 15:06 UTC (permalink / raw)
  To: Trevor Woerner, Robert Yang, openembedded-core

On 1/11/16 8:55 AM, Trevor Woerner wrote:
> 
> 
> On 01/11/16 00:11, Robert Yang wrote:
>> Avoid potential build path in output files.
>>
>> [YOCTO #8894]
>>
>> Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
>> ---
>>  meta/recipes-core/glibc/glibc-initial.inc |    2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/meta/recipes-core/glibc/glibc-initial.inc b/meta/recipes-core/glibc/glibc-initial.inc
>> index 8e81f09..cb2f8dd 100644
>> --- a/meta/recipes-core/glibc/glibc-initial.inc
>> +++ b/meta/recipes-core/glibc/glibc-initial.inc
>> @@ -11,7 +11,7 @@ TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_TCBOOTSTRAP}"
>>  do_configure () {
>>  	(cd ${S} && gnu-configize) || die "failure in running gnu-configize"
>>  	find ${S} -name "configure" | xargs touch
>> -	${S}/configure --host=${TARGET_SYS} --build=${BUILD_SYS} \
>> +	../git/configure --host=${TARGET_SYS} --build=${BUILD_SYS} \
> 
> Although I haven't tested it, this _looks_ like it might fail quite
> readily. I'm sure there are some recipes that play tricks with ${S}, and
> what about recipes that don't pull their sources from git?
> 
> Maybe something like: (cd ${S} && ./configure ...) would be better?

That won't work since it'll run configure in the S directory.

IF we need to use relative paths here, we need to calculate the relative path
from B to S and use that.  It looks like patch 2/2 already does something like
this using the python..  we can probably do the same.  (I don't know any reason,
at least for glibc, that all of the items won't be in the same "WORKDIR".  So it
would be relative within the WORKDIR, which SHOULD be fine.)

>>  		--prefix=/usr \
>>  		--without-cvs --disable-sanity-checks \
>>  		--with-headers=${STAGING_DIR_TARGET}${includedir} \
> 



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

* Re: [PATCH 1/2] glibc-initial.inc: use relative path to run configure
  2016-01-11 15:06     ` Mark Hatle
@ 2016-01-11 16:18       ` Christopher Larson
  2016-01-11 16:25         ` Mark Hatle
  0 siblings, 1 reply; 8+ messages in thread
From: Christopher Larson @ 2016-01-11 16:18 UTC (permalink / raw)
  To: Mark Hatle; +Cc: Patches and discussions about the oe-core layer

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

On Mon, Jan 11, 2016 at 8:06 AM, Mark Hatle <mark.hatle@windriver.com>
wrote:

> On 1/11/16 8:55 AM, Trevor Woerner wrote:
> >
> >
> > On 01/11/16 00:11, Robert Yang wrote:
> >> Avoid potential build path in output files.
> >>
> >> [YOCTO #8894]
> >>
> >> Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
> >> ---
> >>  meta/recipes-core/glibc/glibc-initial.inc |    2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/meta/recipes-core/glibc/glibc-initial.inc
> b/meta/recipes-core/glibc/glibc-initial.inc
> >> index 8e81f09..cb2f8dd 100644
> >> --- a/meta/recipes-core/glibc/glibc-initial.inc
> >> +++ b/meta/recipes-core/glibc/glibc-initial.inc
> >> @@ -11,7 +11,7 @@ TOOLCHAIN_OPTIONS = "
> --sysroot=${STAGING_DIR_TCBOOTSTRAP}"
> >>  do_configure () {
> >>      (cd ${S} && gnu-configize) || die "failure in running
> gnu-configize"
> >>      find ${S} -name "configure" | xargs touch
> >> -    ${S}/configure --host=${TARGET_SYS} --build=${BUILD_SYS} \
> >> +    ../git/configure --host=${TARGET_SYS} --build=${BUILD_SYS} \
> >
> > Although I haven't tested it, this _looks_ like it might fail quite
> > readily. I'm sure there are some recipes that play tricks with ${S}, and
> > what about recipes that don't pull their sources from git?
> >
> > Maybe something like: (cd ${S} && ./configure ...) would be better?
>
> That won't work since it'll run configure in the S directory.
>
> IF we need to use relative paths here, we need to calculate the relative
> path
> from B to S and use that.  It looks like patch 2/2 already does something
> like
> this using the python..  we can probably do the same.  (I don't know any
> reason,
> at least for glibc, that all of the items won't be in the same "WORKDIR".
> So it
> would be relative within the WORKDIR, which SHOULD be fine.)


Unless we want to specifically not support externalsrc (and therefore,
devtool modify -x) for a particular recipe, we should probably not make the
assumption that S and B are relative to WORKDIR :)
-- 
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics

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

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

* Re: [PATCH 1/2] glibc-initial.inc: use relative path to run configure
  2016-01-11 16:18       ` Christopher Larson
@ 2016-01-11 16:25         ` Mark Hatle
  0 siblings, 0 replies; 8+ messages in thread
From: Mark Hatle @ 2016-01-11 16:25 UTC (permalink / raw)
  To: Christopher Larson; +Cc: Patches and discussions about the oe-core layer

On 1/11/16 10:18 AM, Christopher Larson wrote:
> 
> On Mon, Jan 11, 2016 at 8:06 AM, Mark Hatle <mark.hatle@windriver.com
> <mailto:mark.hatle@windriver.com>> wrote:
> 
>     On 1/11/16 8:55 AM, Trevor Woerner wrote:
>     >
>     >
>     > On 01/11/16 00:11, Robert Yang wrote:
>     >> Avoid potential build path in output files.
>     >>
>     >> [YOCTO #8894]
>     >>
>     >> Signed-off-by: Robert Yang <liezhi.yang@windriver.com <mailto:liezhi.yang@windriver.com>>
>     >> ---
>     >>  meta/recipes-core/glibc/glibc-initial.inc |    2 +-
>     >>  1 file changed, 1 insertion(+), 1 deletion(-)
>     >>
>     >> diff --git a/meta/recipes-core/glibc/glibc-initial.inc b/meta/recipes-core/glibc/glibc-initial.inc
>     >> index 8e81f09..cb2f8dd 100644
>     >> --- a/meta/recipes-core/glibc/glibc-initial.inc
>     >> +++ b/meta/recipes-core/glibc/glibc-initial.inc
>     >> @@ -11,7 +11,7 @@ TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_TCBOOTSTRAP}"
>     >>  do_configure () {
>     >>      (cd ${S} && gnu-configize) || die "failure in running gnu-configize"
>     >>      find ${S} -name "configure" | xargs touch
>     >> -    ${S}/configure --host=${TARGET_SYS} --build=${BUILD_SYS} \
>     >> +    ../git/configure --host=${TARGET_SYS} --build=${BUILD_SYS} \
>     >
>     > Although I haven't tested it, this _looks_ like it might fail quite
>     > readily. I'm sure there are some recipes that play tricks with ${S}, and
>     > what about recipes that don't pull their sources from git?
>     >
>     > Maybe something like: (cd ${S} && ./configure ...) would be better?
> 
>     That won't work since it'll run configure in the S directory.
> 
>     IF we need to use relative paths here, we need to calculate the relative path
>     from B to S and use that.  It looks like patch 2/2 already does something like
>     this using the python..  we can probably do the same.  (I don't know any reason,
>     at least for glibc, that all of the items won't be in the same "WORKDIR".  So it
>     would be relative within the WORKDIR, which SHOULD be fine.)
> 
> 
> Unless we want to specifically not support externalsrc (and therefore, devtool
> modify -x) for a particular recipe, we should probably not make the assumption
> that S and B are relative to WORKDIR :)

There ya go.  I didn't realize even with externalsrc and such that the code
wasn't copied or otherwise linked into the typical 'S' inside of WORKDIR.

So relative here is still potentially useful, but the problem being solved isn't
actually being solved in the end.  We're still ended up embedded specific paths
that are triggered QA errors because of the split S/B issue.

--Mark

> -- 
> Christopher Larson
> clarson at kergoth dot com
> Founder - BitBake, OpenEmbedded, OpenZaurus
> Maintainer - Tslib
> Senior Software Engineer, Mentor Graphics



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

* Re: [PATCH 0/2] autotools.bbclass: use relative path to run configure script
  2016-01-11  5:11 [PATCH 0/2] autotools.bbclass: use relative path to run configure script Robert Yang
  2016-01-11  5:11 ` [PATCH 1/2] glibc-initial.inc: use relative path to run configure Robert Yang
  2016-01-11  5:11 ` [PATCH 2/2] autotools.bbclass: use relative path to run configure script Robert Yang
@ 2016-01-12  2:04 ` Robert Yang
  2 siblings, 0 replies; 8+ messages in thread
From: Robert Yang @ 2016-01-12  2:04 UTC (permalink / raw)
  To: openembedded-core

Thanks all, I updated "glibc-initial.inc: use relative path to run configure",
now it should work for external source:

   git://git.openembedded.org/openembedded-core-contrib rbt/relative
 
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=rbt/relative

Robert Yang (2):
   glibc-initial.inc: use relative path to run configure
   autotools.bbclass: use relative path to run configure script

diff --git a/meta/recipes-core/glibc/glibc-initial.inc 
b/meta/recipes-core/glibc/glibc-initial.inc
index 8e81f09..7214f71 100644
--- a/meta/recipes-core/glibc/glibc-initial.inc
+++ b/meta/recipes-core/glibc/glibc-initial.inc
@@ -11,7 +11,8 @@ TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_TCBOOTSTRAP}"
  do_configure () {
         (cd ${S} && gnu-configize) || die "failure in running gnu-configize"
         find ${S} -name "configure" | xargs touch
-       ${S}/configure --host=${TARGET_SYS} --build=${BUILD_SYS} \
+       cfgscript=`python -c "import os; print os.path.relpath('${S}', 
'.')"`/configure
+       $cfgscript --host=${TARGET_SYS} --build=${BUILD_SYS} \
                 --prefix=/usr \
                 --without-cvs --disable-sanity-checks \
                 --with-headers=${STAGING_DIR_TARGET}${includedir} \

// Robert

On 01/11/2016 01:11 PM, Robert Yang wrote:
> Hi,
>
> The 2 patches can reduce a lot of QA Issues for buildpaths.
>
> // Robert
>
> The following changes since commit 5661d8cb7849df62358368743134c0aaf523965e:
>
>    image: Really remove lockfiles flag (2016-01-07 13:41:47 +0000)
>
> are available in the git repository at:
>
>    git://git.openembedded.org/openembedded-core-contrib rbt/relative
>    http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=rbt/relative
>
> Robert Yang (2):
>    glibc-initial.inc: use relative path to run configure
>    autotools.bbclass: use relative path to run configure script
>
>   meta/classes/autotools.bbclass            |    4 +++-
>   meta/recipes-core/glibc/glibc-initial.inc |    2 +-
>   2 files changed, 4 insertions(+), 2 deletions(-)
>


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

end of thread, other threads:[~2016-01-12  2:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-11  5:11 [PATCH 0/2] autotools.bbclass: use relative path to run configure script Robert Yang
2016-01-11  5:11 ` [PATCH 1/2] glibc-initial.inc: use relative path to run configure Robert Yang
2016-01-11 14:55   ` Trevor Woerner
2016-01-11 15:06     ` Mark Hatle
2016-01-11 16:18       ` Christopher Larson
2016-01-11 16:25         ` Mark Hatle
2016-01-11  5:11 ` [PATCH 2/2] autotools.bbclass: use relative path to run configure script Robert Yang
2016-01-12  2:04 ` [PATCH 0/2] " Robert Yang

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