Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] core/br2-external: fix use of relative paths
@ 2017-01-14 15:20 Yann E. MORIN
  2017-01-16 12:55 ` Peter Korsgaard
  0 siblings, 1 reply; 3+ messages in thread
From: Yann E. MORIN @ 2017-01-14 15:20 UTC (permalink / raw)
  To: buildroot

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
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
 support/scripts/br2-external | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/support/scripts/br2-external b/support/scripts/br2-external
index 84bc334..26bcac8 100755
--- a/support/scripts/br2-external
+++ b/support/scripts/br2-external
@@ -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}}\""
-- 
2.7.4

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

end of thread, other threads:[~2017-01-16 17:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-14 15:20 [Buildroot] [PATCH] core/br2-external: fix use of relative paths Yann E. MORIN
2017-01-16 12:55 ` Peter Korsgaard
2017-01-16 17:52   ` Yann E. MORIN

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