Skip to contentSkip to conversation

build: fix tarball stubdom build

PATCH In review Wei Liu 5 participants 10 messages Aug 27, 2015 – Sep 4, 2015 Kbuild

lore
Share & tools
lore

Wei Liu

author
#0 lore raw

PATCH 1/1 build: fix tarball stubdom build

When we create a source code tarball, mini-os is extracted to extras/mini-os directory. When building a source code tarball, we shouldn't clone mini-os again.

Only clone mini-os when that directory doesn't exist. This fixes tarball build and doesn't affect non-tarball build.

Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>
---
 Makefile | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
Makefile +6 -4
index e8a75ff..ba0df70 100644
@@ -19,10 +19,12 @@ include Config.mk
 
 .PHONY: mini-os-dir
 mini-os-dir:
-	GIT=$(GIT) $(XEN_ROOT)/scripts/git-checkout.sh \
-		$(MINIOS_UPSTREAM_URL) \
-		$(MINIOS_UPSTREAM_REVISION) \
-		$(XEN_ROOT)/extras/mini-os
+	if [ ! -d $(XEN_ROOT)/extras/mini-os ]; then \
+		GIT=$(GIT) $(XEN_ROOT)/scripts/git-checkout.sh \
+			$(MINIOS_UPSTREAM_URL) \
+			$(MINIOS_UPSTREAM_REVISION) \
+			$(XEN_ROOT)/extras/mini-os ; \
+	fi
 
 .PHONY: mini-os-dir-force-update
 mini-os-dir-force-update: mini-os-dir
Signature · 1 line
2.1.4
#1 lore raw
Quoted 23 lines
Quoted 1 line
Quoted 1 line · On 27.08.15 at 17:54, <[email protected]> wrote:

When we create a source code tarball, mini-os is extracted to extras/mini-os directory. When building a source code tarball, we shouldn't clone mini-os again.

Only clone mini-os when that directory doesn't exist. This fixes tarball build and doesn't affect non-tarball build.

Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>
---
 Makefile | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
Makefile +0 -0
index e8a75ff..ba0df70 100644
@@ -19,10 +19,12 @@ include Config.mk
 
 .PHONY: mini-os-dir
 mini-os-dir:

Makefile include Config.mk · line 27

Quoted 10 lines
Makefile +6 -4
-	GIT=$(GIT) $(XEN_ROOT)/scripts/git-checkout.sh \
-		$(MINIOS_UPSTREAM_URL) \
-		$(MINIOS_UPSTREAM_REVISION) \
-		$(XEN_ROOT)/extras/mini-os
+	if [ ! -d $(XEN_ROOT)/extras/mini-os ]; then \
+		GIT=$(GIT) $(XEN_ROOT)/scripts/git-checkout.sh \
+			$(MINIOS_UPSTREAM_URL) \
+			$(MINIOS_UPSTREAM_REVISION) \
+			$(XEN_ROOT)/extras/mini-os ; \
+	fi

Wouldn't his better be done (avoiding the need for the shell conditional) by simply renaming the make target from mini-os-dir to extras/mini-os (and dropping the .PHONY)?

Jan

author
#2 lore raw
Quoted 21 lines · Jan Beulich
Quoted 21 lines
Quoted 1 line
Quoted 1 line · On 27.08.15 at 17:54, <[email protected]> wrote:

When we create a source code tarball, mini-os is extracted to extras/mini-os directory. When building a source code tarball, we shouldn't clone mini-os again.

Only clone mini-os when that directory doesn't exist. This fixes tarball build and doesn't affect non-tarball build.

Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>
---
 Makefile | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
Makefile +0 -0
index e8a75ff..ba0df70 100644
@@ -19,10 +19,12 @@ include Config.mk
 
Quoted 17 lines

Makefile include Config.mk · line 27

Quoted 12 lines
Makefile +6 -4
 .PHONY: mini-os-dir
 mini-os-dir:
-	GIT=$(GIT) $(XEN_ROOT)/scripts/git-checkout.sh \
-		$(MINIOS_UPSTREAM_URL) \
-		$(MINIOS_UPSTREAM_REVISION) \
-		$(XEN_ROOT)/extras/mini-os
+	if [ ! -d $(XEN_ROOT)/extras/mini-os ]; then \
+		GIT=$(GIT) $(XEN_ROOT)/scripts/git-checkout.sh \
+			$(MINIOS_UPSTREAM_URL) \
+			$(MINIOS_UPSTREAM_REVISION) \
+			$(XEN_ROOT)/extras/mini-os ; \
+	fi

Wouldn't his better be done (avoiding the need for the shell conditional) by simply renaming the make target from mini-os-dir to extras/mini-os (and dropping the .PHONY)?

All targets for external trees follow some conventions defined in tools/Makefile. Although I didn't strictly follow the same rules in mini-os's case, I don't want it to deviate from the original rules too much.

Wei.

Quoted 1 line

Jan

#3 lore raw
Quoted 40 lines
Quoted 1 line
Quoted 1 line · On 27.08.15 at 18:24, <[email protected]> wrote:
Quoted 21 lines · Jan Beulich
Quoted 21 lines
Quoted 1 line
Quoted 1 line · On 27.08.15 at 17:54, <[email protected]> wrote:

When we create a source code tarball, mini-os is extracted to extras/mini-os directory. When building a source code tarball, we shouldn't clone mini-os again.

Only clone mini-os when that directory doesn't exist. This fixes tarball build and doesn't affect non-tarball build.

Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>
---
 Makefile | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
Makefile +0 -0
index e8a75ff..ba0df70 100644
@@ -19,10 +19,12 @@ include Config.mk
 
Quoted 16 lines

Makefile include Config.mk · line 27

Quoted 12 lines
Makefile +6 -4
 .PHONY: mini-os-dir
 mini-os-dir:
-	GIT=$(GIT) $(XEN_ROOT)/scripts/git-checkout.sh \
-		$(MINIOS_UPSTREAM_URL) \
-		$(MINIOS_UPSTREAM_REVISION) \
-		$(XEN_ROOT)/extras/mini-os
+	if [ ! -d $(XEN_ROOT)/extras/mini-os ]; then \
+		GIT=$(GIT) $(XEN_ROOT)/scripts/git-checkout.sh \
+			$(MINIOS_UPSTREAM_URL) \
+			$(MINIOS_UPSTREAM_REVISION) \
+			$(XEN_ROOT)/extras/mini-os ; \
+	fi

Wouldn't his better be done (avoiding the need for the shell conditional) by simply renaming the make target from mini-os-dir to extras/mini-os (and dropping the .PHONY)?

Quoted 4 lines

All targets for external trees follow some conventions defined in tools/Makefile. Although I didn't strictly follow the same rules in mini-os's case, I don't want it to deviate from the original rules too much.

That's not true: ${target}-dir are actual directories (and hence not phony targets) in tools/Makefile (they might also be symlinks, but that's not of interest for the purposes here). Which is precisely what I'm asking to be done here too, just that I'd see the existing naming (extra/mini-os) preserved rather than changed to extra/mini-os-dir).

Jan

author
#4 lore raw
Quoted 45 lines · Jan Beulich
Quoted 40 lines
Quoted 1 line
Quoted 1 line · On 27.08.15 at 18:24, <[email protected]> wrote:
Quoted 21 lines · Jan Beulich
Quoted 21 lines
Quoted 1 line
Quoted 1 line · On 27.08.15 at 17:54, <[email protected]> wrote:

When we create a source code tarball, mini-os is extracted to extras/mini-os directory. When building a source code tarball, we shouldn't clone mini-os again.

Only clone mini-os when that directory doesn't exist. This fixes tarball build and doesn't affect non-tarball build.

Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>
---
 Makefile | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
Makefile +0 -0
index e8a75ff..ba0df70 100644
@@ -19,10 +19,12 @@ include Config.mk
 
Quoted 16 lines

Makefile include Config.mk · line 27

Quoted 12 lines
Makefile +6 -4
 .PHONY: mini-os-dir
 mini-os-dir:
-	GIT=$(GIT) $(XEN_ROOT)/scripts/git-checkout.sh \
-		$(MINIOS_UPSTREAM_URL) \
-		$(MINIOS_UPSTREAM_REVISION) \
-		$(XEN_ROOT)/extras/mini-os
+	if [ ! -d $(XEN_ROOT)/extras/mini-os ]; then \
+		GIT=$(GIT) $(XEN_ROOT)/scripts/git-checkout.sh \
+			$(MINIOS_UPSTREAM_URL) \
+			$(MINIOS_UPSTREAM_REVISION) \
+			$(XEN_ROOT)/extras/mini-os ; \
+	fi

Wouldn't his better be done (avoiding the need for the shell conditional) by simply renaming the make target from mini-os-dir to extras/mini-os (and dropping the .PHONY)?

Quoted 4 lines

All targets for external trees follow some conventions defined in tools/Makefile. Although I didn't strictly follow the same rules in mini-os's case, I don't want it to deviate from the original rules too much.

Quoted 7 lines

That's not true: ${target}-dir are actual directories (and hence not phony targets) in tools/Makefile (they might also be symlinks, but that's not of interest for the purposes here). Which is precisely what I'm asking to be done here too, just that I'd see the existing naming (extra/mini-os) preserved rather than changed to extra/mini-os-dir).

Yeah. That's why I said "I didn't strictly follow the same rules". To strictly follow rules, mini-os source code should have been in mini-os-dir (a symlink to mini-os-dir-remote or real directory containing source code). Target mini-os-dir should have been mini-os-dir-find. That would cause less confusion. But because stubdom build system is very fragile, I didn't want to touch its Makefile too much so the name mini-os is preserved. And because mini-os doesn't support out-of-tree build, mini-os-dir again was not necessary.

I can submit another patch to make mini-os-dir mini-os-dir-find? Other than that trying to wire up everything to consistently follow the rules is too much effort for too little gain.

Wei.

Quoted 1 line

Jan

#5 lore raw
Quoted 63 lines
Quoted 1 line
Quoted 1 line · On 28.08.15 at 10:47, <[email protected]> wrote:
Quoted 45 lines · Jan Beulich
Quoted 40 lines
Quoted 1 line
Quoted 1 line · On 27.08.15 at 18:24, <[email protected]> wrote:
Quoted 21 lines · Jan Beulich
Quoted 21 lines
Quoted 1 line
Quoted 1 line · On 27.08.15 at 17:54, <[email protected]> wrote:

When we create a source code tarball, mini-os is extracted to extras/mini-os directory. When building a source code tarball, we shouldn't clone mini-os again.

Only clone mini-os when that directory doesn't exist. This fixes tarball build and doesn't affect non-tarball build.

Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>
---
 Makefile | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
Makefile +0 -0
index e8a75ff..ba0df70 100644
@@ -19,10 +19,12 @@ include Config.mk
 
Quoted 16 lines

Makefile include Config.mk · line 27

Quoted 12 lines
Makefile +6 -4
 .PHONY: mini-os-dir
 mini-os-dir:
-	GIT=$(GIT) $(XEN_ROOT)/scripts/git-checkout.sh \
-		$(MINIOS_UPSTREAM_URL) \
-		$(MINIOS_UPSTREAM_REVISION) \
-		$(XEN_ROOT)/extras/mini-os
+	if [ ! -d $(XEN_ROOT)/extras/mini-os ]; then \
+		GIT=$(GIT) $(XEN_ROOT)/scripts/git-checkout.sh \
+			$(MINIOS_UPSTREAM_URL) \
+			$(MINIOS_UPSTREAM_REVISION) \
+			$(XEN_ROOT)/extras/mini-os ; \
+	fi

Wouldn't his better be done (avoiding the need for the shell conditional) by simply renaming the make target from mini-os-dir to extras/mini-os (and dropping the .PHONY)?

Quoted 4 lines

All targets for external trees follow some conventions defined in tools/Makefile. Although I didn't strictly follow the same rules in mini-os's case, I don't want it to deviate from the original rules too much.

Quoted 6 lines

That's not true: ${target}-dir are actual directories (and hence not phony targets) in tools/Makefile (they might also be symlinks, but that's not of interest for the purposes here). Which is precisely what I'm asking to be done here too, just that I'd see the existing naming (extra/mini-os) preserved rather than changed to extra/mini-os-dir).

Yeah. That's why I said "I didn't strictly follow the same rules". To strictly follow rules, mini-os source code should have been in mini-os-dir (a symlink to mini-os-dir-remote or real directory containing source code). Target mini-os-dir should have been mini-os-dir-find. That would cause less confusion. But because stubdom build system is very fragile, I didn't want to touch its Makefile too much so the name mini-os is preserved. And because mini-os doesn't support out-of-tree build, mini-os-dir again was not necessary.

Quoted 1 line

I can submit another patch to make mini-os-dir mini-os-dir-find?

Not sure that's worth it, or even consistent with the other cases.

Quoted 3 lines

Other
than that trying to wire up everything to consistently follow the rules is too much effort for too little gain.

I agree. But you don't really comment on the suggestion to make the build target a real one, allowing the shell conditional to be dropped (again, since Ian already applied your patch).

Jan

author
#6 lore raw
Quoted 67 lines · Jan Beulich
Quoted 63 lines
Quoted 1 line
Quoted 1 line · On 28.08.15 at 10:47, <[email protected]> wrote:
Quoted 45 lines · Jan Beulich
Quoted 40 lines
Quoted 1 line
Quoted 1 line · On 27.08.15 at 18:24, <[email protected]> wrote:
Quoted 21 lines · Jan Beulich
Quoted 21 lines
Quoted 1 line
Quoted 1 line · On 27.08.15 at 17:54, <[email protected]> wrote:

When we create a source code tarball, mini-os is extracted to extras/mini-os directory. When building a source code tarball, we shouldn't clone mini-os again.

Only clone mini-os when that directory doesn't exist. This fixes tarball build and doesn't affect non-tarball build.

Cc Ian Campbell <[email protected]>
Cc Ian Jackson <[email protected]>
---
 Makefile | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
Makefile +0 -0
index e8a75ff..ba0df70 100644
@@ -19,10 +19,12 @@ include Config.mk
 
Quoted 16 lines

Makefile include Config.mk · line 27

Quoted 12 lines
Makefile +6 -4
 .PHONY: mini-os-dir
 mini-os-dir:
-	GIT=$(GIT) $(XEN_ROOT)/scripts/git-checkout.sh \
-		$(MINIOS_UPSTREAM_URL) \
-		$(MINIOS_UPSTREAM_REVISION) \
-		$(XEN_ROOT)/extras/mini-os
+	if [ ! -d $(XEN_ROOT)/extras/mini-os ]; then \
+		GIT=$(GIT) $(XEN_ROOT)/scripts/git-checkout.sh \
+			$(MINIOS_UPSTREAM_URL) \
+			$(MINIOS_UPSTREAM_REVISION) \
+			$(XEN_ROOT)/extras/mini-os ; \
+	fi

Wouldn't his better be done (avoiding the need for the shell conditional) by simply renaming the make target from mini-os-dir to extras/mini-os (and dropping the .PHONY)?

Quoted 4 lines

All targets for external trees follow some conventions defined in tools/Makefile. Although I didn't strictly follow the same rules in mini-os's case, I don't want it to deviate from the original rules too much.

Quoted 6 lines

That's not true: ${target}-dir are actual directories (and hence not phony targets) in tools/Makefile (they might also be symlinks, but that's not of interest for the purposes here). Which is precisely what I'm asking to be done here too, just that I'd see the existing naming (extra/mini-os) preserved rather than changed to extra/mini-os-dir).

Yeah. That's why I said "I didn't strictly follow the same rules". To strictly follow rules, mini-os source code should have been in mini-os-dir (a symlink to mini-os-dir-remote or real directory containing source code). Target mini-os-dir should have been mini-os-dir-find. That would cause less confusion. But because stubdom build system is very fragile, I didn't want to touch its Makefile too much so the name mini-os is preserved. And because mini-os doesn't support out-of-tree build, mini-os-dir again was not necessary.

Quoted 1 line

I can submit another patch to make mini-os-dir mini-os-dir-find?

Not sure that's worth it, or even consistent with the other cases.

Quoted 8 lines
Quoted 3 lines

Other
than that trying to wire up everything to consistently follow the rules is too much effort for too little gain.

I agree. But you don't really comment on the suggestion to make the build target a real one, allowing the shell conditional to be dropped (again, since Ian already applied your patch).

Didn't mean to ignore that.

Yes. Using real target is one way of doing it. Feel free to submit patch to change to that after 4.7 window opens. I've also added that to my list but its priority is very low.

Wei.

Quoted 1 line

Jan

Acked-by on v1 1/1
#7 lore raw
In reply to Wei Liu

Wei Liu writes ("[PATCH for 4.6] build: fix tarball stubdom build"):

Quoted 6 lines

When we create a source code tarball, mini-os is extracted to extras/mini-os directory. When building a source code tarball, we shouldn't clone mini-os again.

Only clone mini-os when that directory doesn't exist. This fixes tarball build and doesn't affect non-tarball build.

I am about to commit this.

Thanks,
Ian.

#8 lore raw
Quoted 8 lines · Ian Jackson

Wei Liu writes ("[PATCH for 4.6] build: fix tarball stubdom build"):

Quoted 6 lines

When we create a source code tarball, mini-os is extracted to extras/mini-os directory. When building a source code tarball, we shouldn't clone mini-os again.

Only clone mini-os when that directory doesn't exist. This fixes tarball build and doesn't affect non-tarball build.

Quoted 6 lines

I am about to commit this.

Thanks,
Ian.

Ping. Do we want this to land for 4.6? Since all its doing is documenting the Makefile targets in the actual 4.6 Makefile I would think its safe.

Signature · 1 line
Doug Goldstein

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#9 lore raw
Quoted 10 lines · Doug Goldstein
Quoted 9 lines · Ian Jackson

Wei Liu writes ("[PATCH for 4.6] build: fix tarball stubdom build"):

Quoted 7 lines

When we create a source code tarball, mini-os is extracted to extras/mini-os directory. When building a source code tarball, we shouldn't clone mini-os again.

Only clone mini-os when that directory doesn't exist. This fixes tarball
build and doesn't affect non-tarball build.

Quoted 8 lines
Quoted 6 lines

I am about to commit this.

Thanks,
Ian.

Ping. Do we want this to land for 4.6?

It is:

commit 0cc73e9870a96e18fc076618c0b419919794ae06

Author: Wei Liu <[email protected]>
Date:   Thu Aug 27 16:54:01 2015 +0100

build: fix tarball stubdom build

Quoted 3 lines

Since all its doing is
documenting the Makefile targets in the actual 4.6 Makefile I would think its safe.

But that makes me think you hit rpely on the wrong email.

If you meant "build: update top-level make help" then that is mentioned in
http://lists.xen.org/archives/html/xen-devel/2015-09/msg00533.html (and I've not read Wei's reply yet)

Ian.