Skip to contentSkip to conversation

core/br2-external: fix use of relative paths

PATCH New Yann E. MORIN 2 participants 3 messages Jan 14, 2017 – Jan 16, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 core/br2-external: fix use of relative paths

When the path to a br2-external tree is relative, make enters an endless recursive loop (paths elided for brevity):

    $ make BR2_EXTERNAL=.. foo_defconfig
    make[1]: stat: ../configs/../configs/../configs[...]/toto_defconfig: Filename too long
    make[1]: *** No rule to make target '../configs/../configs/../configs[...]/toto_defconfig',
    needed by '../configs/../configs/../configs[...]/toto_defconfig'.  Stop.
    Makefile:79: recipe for target '_all' failed
    make: *** [_all] Error 2

It is a bit complex to understand the actual technical reason for this never-ending expansion; it seems it happens in the code generated by the percent_defconfig macro. Not sure why, though...

But the root cause is the relative path.

Just use absolute, canonical paths to br2-external trees. Always.

Reported-by outtierbert at gmail.com
---
 support/scripts/br2-external | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
support/scripts/br2-external +2 -1
index 84bc334..26bcac8 100755
@@ -106,7 +106,8 @@ do_validate_one() {
         error "'%s/Config.in': no such file or directory\n" "${br2_ext}"
     fi
 
-    # Register this br2-external tree
+    # Register this br2-external tree, use an absolute canonical path
+    br2_ext="$( cd "${br2_ext}"; pwd )"
     BR2_EXT_NAMES+=( "${br2_name}" )
     eval BR2_EXT_PATHS_${br2_name}="\"\${br2_ext}\""
     eval BR2_EXT_DESCS_${br2_name}="\"\${br2_desc:-\${br2_name}}\""
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/1 core/br2-external: fix use of relative paths

Quoted 16 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Yann" == Yann E MORIN <[email protected]> writes:

When the path to a br2-external tree is relative, make enters an endless recursive loop (paths elided for brevity):

    $ make BR2_EXTERNAL=.. foo_defconfig
    make[1]: stat: ../configs/../configs/../configs[...]/toto_defconfig: Filename too long
    make[1]: *** No rule to make target '../configs/../configs/../configs[...]/toto_defconfig',
    needed by '../configs/../configs/../configs[...]/toto_defconfig'.  Stop.
    Makefile:79: recipe for target '_all' failed
    make: *** [_all] Error 2

It is a bit complex to understand the actual technical reason for this never-ending expansion; it seems it happens in the code generated by the percent_defconfig macro. Not sure why, though...

Quoted 6 lines

But the root cause is the relative path.

Just use absolute, canonical paths to br2-external trees. Always.

Reported-by outtierbert at gmail.com

Committed after adding to the commit message that this fixes #9576

Signature · 1 line
Bye, Peter Korsgaard
#2 lore raw

PATCH 1/1 core/br2-external: fix use of relative paths

Peter, All,

On 2017-01-16 13:55 +0100, Peter Korsgaard spake thusly:

Quoted 16 lines
Quoted 15 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Yann" == Yann E MORIN <[email protected]> writes:

When the path to a br2-external tree is relative, make enters an endless recursive loop (paths elided for brevity):

    $ make BR2_EXTERNAL=.. foo_defconfig
    make[1]: stat: ../configs/../configs/../configs[...]/toto_defconfig: Filename too long
    make[1]: *** No rule to make target '../configs/../configs/../configs[...]/toto_defconfig',
    needed by '../configs/../configs/../configs[...]/toto_defconfig'.  Stop.
    Makefile:79: recipe for target '_all' failed
    make: *** [_all] Error 2

It is a bit complex to understand the actual technical reason for this never-ending expansion; it seems it happens in the code generated by the percent_defconfig macro. Not sure why, though...

Quoted 8 lines
Quoted 6 lines

But the root cause is the relative path.

Just use absolute, canonical paths to br2-external trees. Always.

Reported-by outtierbert at gmail.com

Committed after adding to the commit message that this fixes #9576

Damn, right. Thanks! :-)

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  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.  |
'------------------------------^-------^------------------^--------------------'