ソースを参照

package/flutter-engine: don't pollute user's home directory

flutter-engine will forcibly create ~/.dart/ and ~/.flutter/ and store
stuff in there.

This is however quite dirty and pollutes the user's home, and will also
not work when the home is read-only (e.g. shared in a container).

Forcibly redirect flutter-engine to the same location where we
redirected host-flutter-sdk-bin, using the same trick of redefining
HOME as for host-flutter-sdk-bin.

Ideally, we'd like to have some way to share this with all flutter-based
packages, but we so far have only a few of them, so it is too early to
even think about some commonalities (even less so about a shared infra).
So we just duplicate the setting for now, this can be revisited later.

Signed-off-by: Adam Duskett <adam.duskett@amarulasolutions.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Adam Duskett 1 年間 前
コミット
439c9516e8
1 ファイル変更4 行追加0 行削除
  1. 4 0
      package/flutter-engine/flutter-engine.mk

+ 4 - 0
package/flutter-engine/flutter-engine.mk

@@ -185,11 +185,14 @@ define FLUTTER_ENGINE_EXTRACT_CMDS
 	| $(TAR) --strip-components=1 -C $(@D) $(TAR_OPTIONS) -
 endef
 
+# We must set the home directory to the sdk directory or else flutter will
+# place .dart, and .flutter in ~/.
 define FLUTTER_ENGINE_CONFIGURE_CMDS
 	cd $(@D) && \
 		rm -rf $(FLUTTER_ENGINE_BUILD_DIR) && \
 		PATH=$(HOST_DIR)/share/depot_tools:$(BR_PATH) \
 		PUB_CACHE=$(FLUTTER_SDK_BIN_PUB_CACHE) \
+		HOME=$(HOST_FLUTTER_SDK_BIN_SDK) \
 		./flutter/tools/gn \
 			$(FLUTTER_ENGINE_CONF_OPTS)
 endef
@@ -198,6 +201,7 @@ define FLUTTER_ENGINE_BUILD_CMDS
 	cd $(@D) && \
 		PATH=$(HOST_DIR)/share/depot_tools:$(BR_PATH) \
 		PUB_CACHE=$(FLUTTER_SDK_BIN_PUB_CACHE) \
+		HOME=$(HOST_FLUTTER_SDK_BIN_SDK) \
 		$(HOST_DIR)/bin/ninja \
 			-j $(PARALLEL_JOBS) \
 			-C $(FLUTTER_ENGINE_BUILD_DIR)