From 8d07ee5393a9cd599ac8fb008aba6afff2e81319 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Thu, 21 Jun 2018 10:13:46 +0200 Subject: [PATCH] build: Respect extensions when building an extension When building a runtime extension we still want to allow other extensions to be used. This fixes https://github.com/flatpak/flatpak-builder/issues/156 --- app/flatpak-builtins-build.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/app/flatpak-builtins-build.c b/app/flatpak-builtins-build.c index 47085fef..044de615 100644 --- a/app/flatpak-builtins-build.c +++ b/app/flatpak-builtins-build.c @@ -475,10 +475,7 @@ flatpak_builtin_build (int argc, char **argv, GCancellable *cancellable, GError "--tmpfs", extension_tmpfs_point, NULL); - if (extension_point) - flatpak_bwrap_add_args (bwrap, - "--bind", flatpak_file_get_path_cached (res_files), extension_point, - NULL); + /* We add the actual bind below so that we're not shadowed by other extensions or their tmpfs */ if (extension_point) dest = extension_point; @@ -516,10 +513,16 @@ flatpak_builtin_build (int argc, char **argv, GCancellable *cancellable, GError return FALSE; } - if (!custom_usr && !(is_extension && !is_app_extension) && + if (!custom_usr && !flatpak_run_add_extension_args (bwrap, runtime_metakey, runtime_ref, FALSE, &runtime_extensions, cancellable, error)) return FALSE; + /* Mount this after the above extensions so we always win */ + if (extension_point) + flatpak_bwrap_add_args (bwrap, + "--bind", flatpak_file_get_path_cached (res_files), extension_point, + NULL); + if (!flatpak_run_add_app_info_args (bwrap, app_files, NULL, app_extensions, runtime_files, runtime_deploy_data, runtime_extensions,