diff mbox series

[3/3] core/pkg-generic: apply post-prepare hooks before monitoring directories

Message ID 13e59bc22d9299b2f829d541c1ecdd995f583f95.1641663315.git.yann.morin.1998@free.fr
State Changes Requested
Headers show
Series core: fixup PPD paths (branch yem/ppd-fixup-paths) | expand

Commit Message

Yann E. MORIN Jan. 8, 2022, 5:35 p.m. UTC
Monitoring the target/ and host/ directories and so on, will serve to
generate lists of files installed by the packages. Those lists are then
used to generate graphs of the size those package take on the target
for example.

With PPD, we will also want to use those lists to only copy those files
actually installed by each dependencies of a package, recursively.

Currently, those lists are not entirely reliable, as the starting points
are established before we apply PPD fixup hooks. As such, at the end of
a package installation, fixed up files will be found to belong to the
current package, while they were in fact provided by one of its
dependency.

While this does no big harm, if at all, for the size graphs, it will
trigger overwrite detection when we eventually gather packages together
to aggregate a PPD or te final host and target. So, we better have the
lists of files be reliable.

So, we only start monitoring the directories after we apply the PPD
fixups (or seen the other way around for a smaller diff: we apply the
PPD fixups before we start monitoring the directories).

Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: Herve Codina <herve.codina@bootlin.com>
---
 package/pkg-generic.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Herve Codina Jan. 9, 2022, 12:11 p.m. UTC | #1
On Sat,  8 Jan 2022 18:35:42 +0100
"Yann E. MORIN" <yann.morin.1998@free.fr> wrote:

> Monitoring the target/ and host/ directories and so on, will serve to
> generate lists of files installed by the packages. Those lists are then
> used to generate graphs of the size those package take on the target
> for example.
> 
> With PPD, we will also want to use those lists to only copy those files
> actually installed by each dependencies of a package, recursively.
> 
> Currently, those lists are not entirely reliable, as the starting points
> are established before we apply PPD fixup hooks. As such, at the end of
> a package installation, fixed up files will be found to belong to the
> current package, while they were in fact provided by one of its
> dependency.
> 
> While this does no big harm, if at all, for the size graphs, it will
> trigger overwrite detection when we eventually gather packages together
> to aggregate a PPD or te final host and target. So, we better have the
> lists of files be reliable.
> 
> So, we only start monitoring the directories after we apply the PPD
> fixups (or seen the other way around for a smaller diff: we apply the
> PPD fixups before we start monitoring the directories).
> 
> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> Cc: Herve Codina <herve.codina@bootlin.com>
> ---
>  package/pkg-generic.mk | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
> index 1022062bcf..b1f4d219bb 100644
> --- a/package/pkg-generic.mk
> +++ b/package/pkg-generic.mk
> @@ -273,11 +273,11 @@ $(BUILD_DIR)/%/.stamp_configured:
>  	@$(call MESSAGE,"Configuring")
>  	$(Q)mkdir -p $(HOST_DIR) $(TARGET_DIR) $(STAGING_DIR) $(BINARIES_DIR)
>  	$(call prepare-per-package-directory,$($(PKG)_FINAL_DEPENDENCIES))
> +	$(foreach hook,$($(PKG)_POST_PREPARE_HOOKS),$(call $(hook))$(sep))
>  	@$(call pkg_size_before,$(TARGET_DIR))
>  	@$(call pkg_size_before,$(STAGING_DIR),-staging)
>  	@$(call pkg_size_before,$(BINARIES_DIR),-images)
>  	@$(call pkg_size_before,$(HOST_DIR),-host)
> -	$(foreach hook,$($(PKG)_POST_PREPARE_HOOKS),$(call $(hook))$(sep))
>  	$(foreach hook,$($(PKG)_PRE_CONFIGURE_HOOKS),$(call $(hook))$(sep))
>  	$($(PKG)_CONFIGURE_CMDS)
>  	$(foreach hook,$($(PKG)_POST_CONFIGURE_HOOKS),$(call $(hook))$(sep))

Acked-by: Herve Codina <herve.codina@bootlin.com>

Best regards,
Hervé
diff mbox series

Patch

diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk
index 1022062bcf..b1f4d219bb 100644
--- a/package/pkg-generic.mk
+++ b/package/pkg-generic.mk
@@ -273,11 +273,11 @@  $(BUILD_DIR)/%/.stamp_configured:
 	@$(call MESSAGE,"Configuring")
 	$(Q)mkdir -p $(HOST_DIR) $(TARGET_DIR) $(STAGING_DIR) $(BINARIES_DIR)
 	$(call prepare-per-package-directory,$($(PKG)_FINAL_DEPENDENCIES))
+	$(foreach hook,$($(PKG)_POST_PREPARE_HOOKS),$(call $(hook))$(sep))
 	@$(call pkg_size_before,$(TARGET_DIR))
 	@$(call pkg_size_before,$(STAGING_DIR),-staging)
 	@$(call pkg_size_before,$(BINARIES_DIR),-images)
 	@$(call pkg_size_before,$(HOST_DIR),-host)
-	$(foreach hook,$($(PKG)_POST_PREPARE_HOOKS),$(call $(hook))$(sep))
 	$(foreach hook,$($(PKG)_PRE_CONFIGURE_HOOKS),$(call $(hook))$(sep))
 	$($(PKG)_CONFIGURE_CMDS)
 	$(foreach hook,$($(PKG)_POST_CONFIGURE_HOOKS),$(call $(hook))$(sep))