From ca0d60087b1fb430b611d64d87f22893963a269b Mon Sep 17 00:00:00 2001 From: stuartmorgan Date: Thu, 28 May 2020 12:14:57 -0700 Subject: [PATCH] Start from a clean slate when bundling Linux build (#58174) BundleUtilities apparently doesn't do build-system-style timestamp analysis when deciding what to copy, and instead just doesn't copy things that are already present. This cleans that bundle directory on each build, so that it includes the up-to-date library versions. Since this is just copying from build artifacts, this is very fast; the build steps themselves are not affected. Fixes https://github.com/flutter/flutter/issues/58049 --- .../templates/app/linux.tmpl/CMakeLists.txt.tmpl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/flutter_tools/templates/app/linux.tmpl/CMakeLists.txt.tmpl b/packages/flutter_tools/templates/app/linux.tmpl/CMakeLists.txt.tmpl index c0f6e596eaa..a1811586a3d 100644 --- a/packages/flutter_tools/templates/app/linux.tmpl/CMakeLists.txt.tmpl +++ b/packages/flutter_tools/templates/app/linux.tmpl/CMakeLists.txt.tmpl @@ -46,10 +46,17 @@ include(flutter/generated_plugins.cmake) # === Installation === # By default, "installing" just makes a relocatable bundle in the build # directory. +set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle") if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) - set(CMAKE_INSTALL_PREFIX "${PROJECT_BINARY_DIR}/bundle" CACHE PATH "..." FORCE) + set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) endif() +# BundleUtilities doesn't re-copy changed files, so start with a clean build +# bundle directory every time. +INSTALL(CODE " + file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\") + " COMPONENT Runtime) + set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib")