Skip to contentSkip to conversation

build: avoid Paths.mk in hypervisor build

PATCH In review Jan Beulich 2 participants 3 messages Jan 14 – Feb 4

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 build: avoid Paths.mk in hypervisor build

Its inclusion placed where it is, it affects the hypervisor build as well. The hypervisor build, in its _install rule, uses $(DEBUG_DIR), first in

	[ -d "$(D)$(DEBUG_DIR)" ] || $(INSTALL_DIR) $(D)$(DEBUG_DIR)

$(D) is an absolute directory (shorthand for $(DESTDIR)). $(DEBUG_DIR) as set by Paths.mk is, too. Both point into the build tree. The two simply shouldn't be glued together.

Note that the earlier

	[ -d $(D)$(BOOT_DIR) ] || $(INSTALL_DIR) $(D)$(BOOT_DIR)

continues to be working fine, as BOOT_DIR continues to be controlled by config/StdGNU.mk. Its DEBUG_DIR isn't taking effect anymore, when for the hypervisor build it should.

And of course behavior now differs between building xen/ in a tree where tools/ was built before vs in an otherwise clean tree.

Fixes 82b9cc04a7c7 ("build: add make macro for making file from file.in")

---
This is clumsy, but I can't think of anything better. Suggestions anyone?

Config.mk +2 -0
@@ -162,7 +162,9 @@ endef
 PATH_FILES := Paths.mk
 INC_FILES = $(foreach f, $(PATH_FILES), $(XEN_ROOT)/config/$(f))
 
+ifndef XEN_FULLVERSION
 -include $(INC_FILES)
+endif
 
 BUILD_MAKE_VARS = $(foreach f, $(PATH_FILES), $(shell awk '$$2 == ":=" { print $$1; }' $(XEN_ROOT)/config/$(f).in))
 
Acked-by on v1 1/1
#1 lore raw

Hi Jan,

Quoted 13 lines · Jan Beulich

Its inclusion placed where it is, it affects the hypervisor build as well. The hypervisor build, in its _install rule, uses $(DEBUG_DIR), first in

[ -d "$(D)$(DEBUG_DIR)" ] || $(INSTALL_DIR) $(D)$(DEBUG_DIR)

$(D) is an absolute directory (shorthand for $(DESTDIR)). $(DEBUG_DIR) as set by Paths.mk is, too. Both point into the build tree. The two simply shouldn't be glued together.

Note that the earlier

Quoted 9 lines

[ -d $(D)$(BOOT_DIR) ] || $(INSTALL_DIR) $(D)$(BOOT_DIR)

continues to be working fine, as BOOT_DIR continues to be controlled by config/StdGNU.mk. Its DEBUG_DIR isn't taking effect anymore, when for the hypervisor build it should.

And of course behavior now differs between building xen/ in a tree where tools/ was built before vs in an otherwise clean tree.

I cannot fully validate this but it seems to make sense so

Quoted 2 lines
Fixes 82b9cc04a7c7 ("build: add make macro for making file from file.in")

Cheers
Bertrand

Quoted 16 lines

---
This is clumsy, but I can't think of anything better. Suggestions anyone?

Config.mk +0 -0
@@ -162,7 +162,9 @@ endef

PATH_FILES := Paths.mk
INC_FILES = $(foreach f, $(PATH_FILES), $(XEN_ROOT)/config/$(f))

Config.mk +2 -1
+ifndef XEN_FULLVERSION
-include $(INC_FILES)
+endif

BUILD_MAKE_VARS = $(foreach f, $(PATH_FILES), $(shell awk '$$2 == ":=" { print $$1; }' $(XEN_ROOT)/config/$(f).in))

Reviewed-by on v1 1/1
#2 lore raw
In reply to Jan Beulich

Hi Jan,

Quoted 19 lines · Jan Beulich

Its inclusion placed where it is, it affects the hypervisor build as well. The hypervisor build, in its _install rule, uses $(DEBUG_DIR), first in

[ -d "$(D)$(DEBUG_DIR)" ] || $(INSTALL_DIR) $(D)$(DEBUG_DIR)

$(D) is an absolute directory (shorthand for $(DESTDIR)). $(DEBUG_DIR) as set by Paths.mk is, too. Both point into the build tree. The two simply shouldn't be glued together.

Note that the earlier

[ -d $(D)$(BOOT_DIR) ] || $(INSTALL_DIR) $(D)$(BOOT_DIR)

continues to be working fine, as BOOT_DIR continues to be controlled by config/StdGNU.mk. Its DEBUG_DIR isn't taking effect anymore, when for the hypervisor build it should.

Quoted 5 lines

And of course behavior now differs between building xen/ in a tree where tools/ was built before vs in an otherwise clean tree.

Fixes 82b9cc04a7c7 ("build: add make macro for making file from file.in")

I did a bit more testing and checking and as far as i can tell this works. As I am confident the cases i did not cover during my testing will be covered by CI:

Cheers
Bertrand