Skip to contentSkip to conversation

graph-depends: fix when $(O) is a relative path

PATCH New Arnout Vandecappelle (Essensium/Mind) 3 participants 11 messages Jun 18, 2014 – Jun 29, 2014 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 graph-depends: fix when $(O) is a relative path

The graph-depends commands cd into the CONFIG_DIR and run the script from there. However, this means that when $(O) is a relative path, it will no longer be correct. Therefore, use $(BASE_DIR) instead of $(O).

---
 Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Makefile +2 -2
index 5c82355..dd350b6 100644
@@ -676,8 +676,8 @@ graph-depends:
 	@$(INSTALL) -d $(O)/graphs
 	@cd "$(CONFIG_DIR)"; \
 	$(TOPDIR)/support/scripts/graph-depends $(BR2_GRAPH_DEPS_OPTS) \
-	|tee $(O)/graphs/$(@).dot \
-	|dot $(BR2_GRAPH_DOT_OPTS) -T$(BR_GRAPH_OUT) -o $(O)/graphs/$(@).$(BR_GRAPH_OUT)
+	|tee $(BASE_DIR)/graphs/$(@).dot \
+	|dot $(BR2_GRAPH_DOT_OPTS) -T$(BR_GRAPH_OUT) -o $(BASE_DIR)/graphs/$(@).$(BR_GRAPH_OUT)
 
 else # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
 
Signature · 1 line
2.0.0
#1 lore raw

PATCH 1/1 graph-depends: fix when $(O) is a relative path

Arnout, All,

On 2014-06-19 00:10 +0200, Arnout Vandecappelle (Essensium/Mind) spake thusly:

Quoted 5 lines

The graph-depends commands cd into the CONFIG_DIR and run the script from there. However, this means that when $(O) is a relative path, it will no longer be correct. Therefore, use $(BASE_DIR) instead of $(O).

Tested with this sequence:
cd buildroot
make manual-html
make O=../br.build-1 manual-html
cd ..
make -C buildroot O=../br.build-2 manual-html
make -C buildroot O=$(pwd)/br.build-3
mkdir br.build-4
cd br.build-4
make defconfig (to create the Makefile wrapper)
make manual-html

All generate the HTML manual, and a cursory look does not show any diference.

Regards,
Yann E. MORIN.

Quoted 26 lines
---
 Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Makefile +2 -2
index 5c82355..dd350b6 100644
@@ -676,8 +676,8 @@ graph-depends:
 	@$(INSTALL) -d $(O)/graphs
 	@cd "$(CONFIG_DIR)"; \
 	$(TOPDIR)/support/scripts/graph-depends $(BR2_GRAPH_DEPS_OPTS) \
-	|tee $(O)/graphs/$(@).dot \
-	|dot $(BR2_GRAPH_DOT_OPTS) -T$(BR_GRAPH_OUT) -o $(O)/graphs/$(@).$(BR_GRAPH_OUT)
+	|tee $(BASE_DIR)/graphs/$(@).dot \
+	|dot $(BR2_GRAPH_DOT_OPTS) -T$(BR_GRAPH_OUT) -o $(BASE_DIR)/graphs/$(@).$(BR_GRAPH_OUT)
 
 else # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
 
Signature · 6 lines
2.0.0

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
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.  |
'------------------------------^-------^------------------^--------------------'
#2 lore raw

PATCH 1/1 graph-depends: fix when $(O) is a relative path

Quoted 9 lines · Yann E. MORIN

Arnout, All,

On 2014-06-19 00:10 +0200, Arnout Vandecappelle (Essensium/Mind) spake thusly:

Quoted 5 lines

The graph-depends commands cd into the CONFIG_DIR and run the script from there. However, this means that when $(O) is a relative path, it will no longer be correct. Therefore, use $(BASE_DIR) instead of $(O).

Quoted 11 lines

Tested with this sequence:
cd buildroot
make manual-html
make O=../br.build-1 manual-html
cd ..
make -C buildroot O=../br.build-2 manual-html
make -C buildroot O=$(pwd)/br.build-3
mkdir br.build-4
cd br.build-4
make defconfig (to create the Makefile wrapper)
make manual-html

Call me stupid, but why is it relevant to test this patch with manual-html?

Regards,
Arnout

Quoted 37 lines

All generate the HTML manual, and a cursory look does not show any diference.

Regards,
Yann E. MORIN.

Quoted 26 lines
---
 Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Makefile +2 -2
index 5c82355..dd350b6 100644
@@ -676,8 +676,8 @@ graph-depends:
 	@$(INSTALL) -d $(O)/graphs
 	@cd "$(CONFIG_DIR)"; \
 	$(TOPDIR)/support/scripts/graph-depends $(BR2_GRAPH_DEPS_OPTS) \
-	|tee $(O)/graphs/$(@).dot \
-	|dot $(BR2_GRAPH_DOT_OPTS) -T$(BR_GRAPH_OUT) -o $(O)/graphs/$(@).$(BR_GRAPH_OUT)
+	|tee $(BASE_DIR)/graphs/$(@).dot \
+	|dot $(BR2_GRAPH_DOT_OPTS) -T$(BR_GRAPH_OUT) -o $(BASE_DIR)/graphs/$(@).$(BR_GRAPH_OUT)
 
 else # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
 
Signature · 6 lines
2.0.0

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#3 lore raw

PATCH 1/1 graph-depends: fix when $(O) is a relative path

Arnout, All,

On 2014-06-20 22:07 +0200, Arnout Vandecappelle spake thusly:

Quoted 22 lines · Yann E. MORIN
Quoted 9 lines

Arnout, All,

On 2014-06-19 00:10 +0200, Arnout Vandecappelle (Essensium/Mind) spake thusly:

Quoted 5 lines

The graph-depends commands cd into the CONFIG_DIR and run the script from there. However, this means that when $(O) is a relative path, it will no longer be correct. Therefore, use $(BASE_DIR) instead of $(O).

Quoted 11 lines

Tested with this sequence:
cd buildroot
make manual-html
make O=../br.build-1 manual-html
cd ..
make -C buildroot O=../br.build-2 manual-html
make -C buildroot O=$(pwd)/br.build-3
mkdir br.build-4
cd br.build-4
make defconfig (to create the Makefile wrapper)
make manual-html

Quoted 1 line

Call me stupid, but why is it relevant to test this patch with manual-html?

Err... Hmm... Well...

OK, back to the shell I am... ;-)

Sorry, sorry, sorry...

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.  |
'------------------------------^-------^------------------^--------------------'
#4 lore raw

PATCH 1/1 graph-depends: fix when $(O) is a relative path

In reply to Yann E. MORIN

Arnout, All,

On 2014-06-20 22:04 +0200, Yann E. MORIN spake thusly:

Quoted 9 lines

On 2014-06-19 00:10 +0200, Arnout Vandecappelle (Essensium/Mind) spake thusly:

Quoted 5 lines

The graph-depends commands cd into the CONFIG_DIR and run the script from there. However, this means that when $(O) is a relative path, it will no longer be correct. Therefore, use $(BASE_DIR) instead of $(O).

OK, these are still valid, but for other reasons!

Tested with the test-case by Arnout:
make O=my-output defconfig
make O=my-output graph-depends

plus another deviation from this test-case:
make -C buildroot O=my-output defconfig
make -C buildroot O=my-output graph-depends

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.  |
'------------------------------^-------^------------------^--------------------'
#5 lore raw

PATCH 1/1 graph-depends: fix when $(O) is a relative path

In reply to Arnout Vandecappelle (Essensium/Mind)

Arnout, All,

On 2014-06-19 00:10 +0200, Arnout Vandecappelle (Essensium/Mind) spake thusly:

Quoted 5 lines

The graph-depends commands cd into the CONFIG_DIR and run the script from there. However, this means that when $(O) is a relative path, it will no longer be correct. Therefore, use $(BASE_DIR) instead of $(O).

Suddenly I realised that something must be wrong with this patch. $(O) is always expected to be relative the buildroot tree, not the current directory:
http://nightly.buildroot.org/#_building_out_of_tree

---8<---
Note: the O path can be either an absolute or a relative path, but if it?s passed as a relative path, it is important to note that it is interpreted relative to the main Buildroot source directory, not the current working directory.
---8<---

So I fail to see what case this patch is supposed to fix.

I tried with thisscript, and did not notice any difference between the two runs, one with master, the second with the patch applied:

    #!/bin/sh
    set -e

    BR="${HOME}/cache/upstream/buildroot"
    rm -rf br*

    do_prep() {
        local dir="${1}"
        (
            git clone "${BR}" "${dir}"
            cd "${dir}"
            git pwam 361761   # Comment-out to use master
        )
    }

    echo '======== In-tree'
    do_prep br-1
    cd br-1
    make defconfig
    make graph-depends
    cd ..

    echo '======== Out-of-tree, called out of top-dir, relative'
    do_prep br-2
    mkdir br.build-2
    make -C br-2 O=../br.build-2 defconfig
    make -C br-2 O=../br.build-2 graph-depends

    echo '======== Out-of-tree, called from top-dir, relative'
    do_prep br-3
    mkdir br.build-3
    cd br-3
    make O=../br.build-3 defconfig
    make O=../br.build-3 graph-depends
    cd ..

    echo '======== Out-of-tree, called from O-dir, absolute'
    do_prep br-4
    mkdir br.build-4
    cd br.build-4
    make -C ../br-4 O=$(pwd) defconfig
    make graph-depends
    cd ..

    echo '======== Out-of-tree, called out of top-dir, absolute '
    do_prep br-5
    mkdir br.build-5
    make -C br-4 O=$(pwd)/br.build-5 defconfig
    make -C br-4 O=$(pwd)/br.build-5 graph-depends

    echo '======== Out-of-tree, called fromother dir, absolute-relative'
    do_prep br-6
    mkdir br.build-6.1
    mkdir br.build-6.2
    cd br.build-6.1
    make -C ../br-6 O=$(pwd)/../br.build-6.2 defconfig
    make -C ../br-6 O=$(pwd)/../br.build-6.2 graph-depends
    cd ..

In both cases (with or without the patch), cases 1, 3 and 4 succeed, while cases 2, 5 and 6 fail.

What case(s) did I miss?

Regards,
Yann E. MORIN.

Quoted 26 lines
---
 Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Makefile +2 -2
index 5c82355..dd350b6 100644
@@ -676,8 +676,8 @@ graph-depends:
 	@$(INSTALL) -d $(O)/graphs
 	@cd "$(CONFIG_DIR)"; \
 	$(TOPDIR)/support/scripts/graph-depends $(BR2_GRAPH_DEPS_OPTS) \
-	|tee $(O)/graphs/$(@).dot \
-	|dot $(BR2_GRAPH_DOT_OPTS) -T$(BR_GRAPH_OUT) -o $(O)/graphs/$(@).$(BR_GRAPH_OUT)
+	|tee $(BASE_DIR)/graphs/$(@).dot \
+	|dot $(BR2_GRAPH_DOT_OPTS) -T$(BR_GRAPH_OUT) -o $(BASE_DIR)/graphs/$(@).$(BR_GRAPH_OUT)
 
 else # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
 
Signature · 6 lines
2.0.0

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
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.  |
'------------------------------^-------^------------------^--------------------'
#6 lore raw

PATCH 1/1 graph-depends: fix when $(O) is a relative path

Quoted 85 lines · Yann E. MORIN

Arnout, All,

On 2014-06-19 00:10 +0200, Arnout Vandecappelle (Essensium/Mind) spake thusly:

Quoted 5 lines

The graph-depends commands cd into the CONFIG_DIR and run the script from there. However, this means that when $(O) is a relative path, it will no longer be correct. Therefore, use $(BASE_DIR) instead of $(O).

Suddenly I realised that something must be wrong with this patch. $(O) is always expected to be relative the buildroot tree, not the current directory:
http://nightly.buildroot.org/#_building_out_of_tree

---8<---
Note: the O path can be either an absolute or a relative path, but if it?s passed as a relative path, it is important to note that it is interpreted relative to the main Buildroot source directory, not the current working directory.
---8<---

So I fail to see what case this patch is supposed to fix.

I tried with thisscript, and did not notice any difference between the two runs, one with master, the second with the patch applied:

    #!/bin/sh
    set -e

    BR="${HOME}/cache/upstream/buildroot"
    rm -rf br*

    do_prep() {
        local dir="${1}"
        (
            git clone "${BR}" "${dir}"
            cd "${dir}"
            git pwam 361761   # Comment-out to use master
        )
    }

    echo '======== In-tree'
    do_prep br-1
    cd br-1
    make defconfig
    make graph-depends
    cd ..

    echo '======== Out-of-tree, called out of top-dir, relative'
    do_prep br-2
    mkdir br.build-2
    make -C br-2 O=../br.build-2 defconfig
    make -C br-2 O=../br.build-2 graph-depends

    echo '======== Out-of-tree, called from top-dir, relative'
    do_prep br-3
    mkdir br.build-3
    cd br-3
    make O=../br.build-3 defconfig
    make O=../br.build-3 graph-depends
    cd ..

    echo '======== Out-of-tree, called from O-dir, absolute'
    do_prep br-4
    mkdir br.build-4
    cd br.build-4
    make -C ../br-4 O=$(pwd) defconfig
    make graph-depends
    cd ..

    echo '======== Out-of-tree, called out of top-dir, absolute '
    do_prep br-5
    mkdir br.build-5
    make -C br-4 O=$(pwd)/br.build-5 defconfig
    make -C br-4 O=$(pwd)/br.build-5 graph-depends

    echo '======== Out-of-tree, called fromother dir, absolute-relative'
    do_prep br-6
    mkdir br.build-6.1
    mkdir br.build-6.2
    cd br.build-6.1
    make -C ../br-6 O=$(pwd)/../br.build-6.2 defconfig
    make -C ../br-6 O=$(pwd)/../br.build-6.2 graph-depends
    cd ..
Quoted 4 lines

In both cases (with or without the patch), cases 1, 3 and 4 succeed, while cases 2, 5 and 6 fail.

What case(s) did I miss?

First of all, for me all these cases succeed both with and without the patch.

Unfortunately, the example you took happens to work by accident:

$ make -n O=../br.build graph-depends
dot -? >/dev/null 2>&1 || \
        (echo "ERROR: The 'dot' program from Graphviz is needed for
graph-depends" >&2; exit 1)
/usr/bin/install -d ../br.build/graphs
cd "../br.build"; \
/home/arnout/src/buildroot/support/scripts/graph-depends  \
|tee ../br.build/graphs/graph-depends.dot \
|dot  -Tpdf -o ../br.build/graphs/graph-depends.pdf

Since we cd into ../br.build and then resolve $(O) as ../br.build, it just
happens to be the same directory. Using any other combination of . and .. a $(O) triggers the problem. So try

do_prep br-7
make -C br-7 O=./br.build-7 defconfig
make -C br-7 O=./br.build-7 graph-depends

The graph-depends will fail with:

tee: br.build-7/graphs/graph-depends.dot: No such file or directory Getting targets
Getting dependencies for ['host-binutils', 'host-gmp', 'host-mpc', 'host-mpfr', 'uclibc', 'host-fakeroot', 'host-gcc-final', 'host-makedevs', 'toolchain-buildroot', 'toolchain', 'busybox', 'rootfs-tar'] Getting dependencies for ['host-m4', 'linux-headers', 'host-gcc-initial'] br.build-7/graphs/graph-depends.pdf: No such file or directory Makefile:677: recipe for target 'graph-depends' failed
make: *** [graph-depends] Error 1

Regards,
Arnout

Quoted 31 lines

Regards,
Yann E. MORIN.

Quoted 26 lines
---
 Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Makefile +2 -2
index 5c82355..dd350b6 100644
@@ -676,8 +676,8 @@ graph-depends:
 	@$(INSTALL) -d $(O)/graphs
 	@cd "$(CONFIG_DIR)"; \
 	$(TOPDIR)/support/scripts/graph-depends $(BR2_GRAPH_DEPS_OPTS) \
-	|tee $(O)/graphs/$(@).dot \
-	|dot $(BR2_GRAPH_DOT_OPTS) -T$(BR_GRAPH_OUT) -o $(O)/graphs/$(@).$(BR_GRAPH_OUT)
+	|tee $(BASE_DIR)/graphs/$(@).dot \
+	|dot $(BR2_GRAPH_DOT_OPTS) -T$(BR_GRAPH_OUT) -o $(BASE_DIR)/graphs/$(@).$(BR_GRAPH_OUT)
 
 else # ifeq ($(BR2_HAVE_DOT_CONFIG),y)
 
Signature · 6 lines
2.0.0

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#7 lore raw

PATCH 1/1 graph-depends: fix when $(O) is a relative path

Arnout, All,

On 2014-06-23 07:28 +0200, Arnout Vandecappelle spake thusly:

Quoted 9 lines · Yann E. MORIN
Quoted 8 lines

On 2014-06-19 00:10 +0200, Arnout Vandecappelle (Essensium/Mind) spake thusly:

Quoted 5 lines

The graph-depends commands cd into the CONFIG_DIR and run the script from there. However, this means that when $(O) is a relative path, it will no longer be correct. Therefore, use $(BASE_DIR) instead of $(O).

I tried with thisscript, and did not notice any difference between the two runs, one with master, the second with the patch applied:

[--SNIP long script--]

Quoted 1 line

First of all, for me all these cases succeed both with and without the patch.

You mean all the 6 cases do work for you? Weird.

I don't see how it can work, since calling this
make -C buildroot O=somewhere goal

will not have the --no-print-directory option, and thus make would print its usual "Entering/Leaving directory blabla" which confuses graph-depends.py

There is not much we can do about that, since our out-of-tree Makefile wrapper is never called.

Even worse, if you do
make -C buildroot O=somewhere defconfig
make -C somewhere graph-depends

then even though we do use our Makefile wrapper in this case, the --no-print-directory option is not used! So make would still print its "Entering/Leaving directory blabla" (and thus graph-depends will get confused.)

Quoted 6 lines

Using any other combination of . and .. a $(O)
triggers the problem. So try

do_prep br-7
make -C br-7 O=./br.build-7 defconfig
make -C br-7 O=./br.build-7 graph-depends

OK, that's a use-case I was missing.

Quoted 11 lines

The graph-depends will fail with:

tee: br.build-7/graphs/graph-depends.dot: No such file or directory Getting targets
Getting dependencies for ['host-binutils', 'host-gmp', 'host-mpc', 'host-mpfr', 'uclibc', 'host-fakeroot', 'host-gcc-final', 'host-makedevs', 'toolchain-buildroot', 'toolchain', 'busybox', 'rootfs-tar'] Getting dependencies for ['host-m4', 'linux-headers', 'host-gcc-initial'] br.build-7/graphs/graph-depends.pdf: No such file or directory Makefile:677: recipe for target 'graph-depends' failed
make: *** [graph-depends] Error 1

OK, it fails here, too, but your patch does not change anything: it fails without your patch, and it fails with your patch applied.

I'm using make-3.81, if that shall be a differentiator.

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.  |
'------------------------------^-------^------------------^--------------------'
#8 lore raw

PATCH 1/1 graph-depends: fix when $(O) is a relative path

Quoted 15 lines · Yann E. MORIN

Arnout, All,

On 2014-06-23 07:28 +0200, Arnout Vandecappelle spake thusly:

Quoted 9 lines · Yann E. MORIN
Quoted 8 lines

On 2014-06-19 00:10 +0200, Arnout Vandecappelle (Essensium/Mind) spake thusly:

Quoted 5 lines

The graph-depends commands cd into the CONFIG_DIR and run the script from there. However, this means that when $(O) is a relative path, it will no longer be correct. Therefore, use $(BASE_DIR) instead of $(O).

I tried with thisscript, and did not notice any difference between the two runs, one with master, the second with the patch applied:

[--SNIP long script--]

Quoted 1 line

First of all, for me all these cases succeed both with and without the patch.

Quoted 8 lines

You mean all the 6 cases do work for you? Weird.

I don't see how it can work, since calling this
make -C buildroot O=somewhere goal

will not have the --no-print-directory option, and thus make would print its usual "Entering/Leaving directory blabla" which confuses graph-depends.py

Oh sorry, I didn't look at the output, just that it doesn't error out.

Quoted 4 lines

There is not much we can do about that, since our out-of-tree Makefile wrapper is never called.

Quoted 8 lines

Even worse, if you do
make -C buildroot O=somewhere defconfig
make -C somewhere graph-depends

then even though we do use our Makefile wrapper in this case, the --no-print-directory option is not used! So make would still print its "Entering/Leaving directory blabla" (and thus graph-depends will get confused.)

So why don't we just add --no-print-directory to the recursive make invocation
from the script? Patch follows...

Quoted 7 lines
Quoted 7 lines

Using any other combination of . and .. a $(O)
triggers the problem. So try

do_prep br-7
make -C br-7 O=./br.build-7 defconfig
make -C br-7 O=./br.build-7 graph-depends

This one I didn't actually run like this, but like:

make O=br.build-7 defconfig
make O=br.build-7 graph-depends

(from the buildroot directory). For that one, I checked that the PDF was OK, and then I just wrote it with -C in the mail. Stupid of me.

Regards,
Arnout

Quoted 23 lines

OK, that's a use-case I was missing.

Quoted 11 lines

The graph-depends will fail with:

tee: br.build-7/graphs/graph-depends.dot: No such file or directory Getting targets
Getting dependencies for ['host-binutils', 'host-gmp', 'host-mpc', 'host-mpfr', 'uclibc', 'host-fakeroot', 'host-gcc-final', 'host-makedevs', 'toolchain-buildroot', 'toolchain', 'busybox', 'rootfs-tar'] Getting dependencies for ['host-m4', 'linux-headers', 'host-gcc-initial'] br.build-7/graphs/graph-depends.pdf: No such file or directory Makefile:677: recipe for target 'graph-depends' failed
make: *** [graph-depends] Error 1

OK, it fails here, too, but your patch does not change anything: it fails without your patch, and it fails with your patch applied.

I'm using make-3.81, if that shall be a differentiator.

Regards,
Yann E. MORIN.

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#9 lore raw

PATCH 1/1 graph-depends: fix when $(O) is a relative path

Arnout, All,

On 2014-06-23 21:16 +0200, Arnout Vandecappelle spake thusly:

Quoted 16 lines · Yann E. MORIN
Quoted 15 lines

On 2014-06-23 07:28 +0200, Arnout Vandecappelle spake thusly:

Quoted 9 lines · Yann E. MORIN
Quoted 8 lines

On 2014-06-19 00:10 +0200, Arnout Vandecappelle (Essensium/Mind) spake thusly:

Quoted 5 lines

The graph-depends commands cd into the CONFIG_DIR and run the script from there. However, this means that when $(O) is a relative path, it will no longer be correct. Therefore, use $(BASE_DIR) instead of $(O).

I tried with thisscript, and did not notice any difference between the two runs, one with master, the second with the patch applied:

[--SNIP long script--]

Quoted 1 line

First of all, for me all these cases succeed both with and without the patch.

You mean all the 6 cases do work for you? Weird.

Quoted 8 lines
Quoted 6 lines

I don't see how it can work, since calling this
make -C buildroot O=somewhere goal

will not have the --no-print-directory option, and thus make would print its usual "Entering/Leaving directory blabla" which confuses graph-depends.py

Oh sorry, I didn't look at the output, just that it doesn't error out.

OK, no problem. ;-)

make does not error out, because of the pipe, which only returns the status of the last command in the pipe. We can't do much about this...

Quoted 7 lines
Quoted 7 lines

There is not much we can do about that, since our out-of-tree Makefile wrapper is never called.

Even worse, if you do
make -C buildroot O=somewhere defconfig
make -C somewhere graph-depends

Quoted 7 lines
Quoted 4 lines

then even though we do use our Makefile wrapper in this case, the --no-print-directory option is not used! So make would still print its "Entering/Leaving directory blabla" (and thus graph-depends will get confused.)

So why don't we just add --no-print-directory to the recursive make invocation
from the script? Patch follows...

Thanks! :-)

Quoted 7 lines
Quoted 6 lines
Quoted 6 lines

Using any other combination of . and .. a $(O)
triggers the problem. So try

do_prep br-7
make -C br-7 O=./br.build-7 defconfig
make -C br-7 O=./br.build-7 graph-depends

Quoted 7 lines

This one I didn't actually run like this, but like:

make O=br.build-7 defconfig
make O=br.build-7 graph-depends

(from the buildroot directory). For that one, I checked that the PDF was OK, and then I just wrote it with -C in the mail. Stupid of me.

Well, that's yet another test-case! :-)

OK, thanks for bearing with me all along! ;-)

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.  |
'------------------------------^-------^------------------^--------------------'
#10 lore raw

PATCH 1/1 graph-depends: fix when $(O) is a relative path

In reply to Arnout Vandecappelle (Essensium/Mind)

Dear Arnout Vandecappelle (Essensium/Mind),

Quoted 8 lines · Arnout Vandecappelle (Essensium/Mind)

The graph-depends commands cd into the CONFIG_DIR and run the script from there. However, this means that when $(O) is a relative path, it will no longer be correct. Therefore, use $(BASE_DIR) instead of $(O).

---
 Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Applied, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com