package/flutter-engine: don't write into $HOME
PATCH 1/1 package/flutter-engine: don't write into $HOME
gclient.py tries to not only read from $HOME/.config, but actually create some directories/files in there. As $HOME can be inaccessible, let's override XDG_CONFIG_HOME to tell the depot-tools code to write its stuff into $(@D)/dl-tmp instead (which we already use as a scratch directory in this package).
Fixes:
Quoted 1 line
Quoted 1 line
Quoted 1 line
flutter-engine 3.29.2 Downloading
/home/thomas/buildroot/br/output-all/host/share/depot_tools/gclient.py:3367: SyntaxWarning: invalid escape sequence '\s'
dot_git_pattern = re.compile('^(\s*)url(\s*)=.*\.git$')/home/thomas/buildroot/br/output-all/host/share/depot_tools/gclient_scm.py:436: SyntaxWarning: invalid escape sequence '\.'
tokens = re.search('//(.+).googlesource.com/(.+?)(?:\.git)?$',
Traceback (most recent call last):
File "/home/thomas/buildroot/br/output-all/host/lib/python3.13/pathlib/_local.py", line 722, in mkdir
os.mkdir(self, mode)
~~~~~~~~^^^^^^^^^^^^FileNotFoundError: [Errno 2] No such file or directory: '/home/br-user/.config/depot_tools'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/thomas/buildroot/br/output-all/host/share/depot_tools/gclient.py", line 108, in <module>
import gclient_scm
File "/home/thomas/buildroot/br/output-all/host/share/depot_tools/gclient_scm.py", line 23, in <module>
import gerrit_util
File "/home/thomas/buildroot/br/output-all/host/share/depot_tools/gerrit_util.py", line 42, in <module>
import metrics
File "/home/thomas/buildroot/br/output-all/host/share/depot_tools/metrics.py", line 23, in <module>
CONFIG_FILE = utils.depot_tools_config_path('metrics.cfg')
File "/home/thomas/buildroot/br/output-all/host/share/depot_tools/utils.py", line 48, in depot_tools_config_path
pathlib.Path(config_dir).mkdir(parents=True, exist_ok=True)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/thomas/buildroot/br/output-all/host/lib/python3.13/pathlib/_local.py", line 726, in mkdir
self.parent.mkdir(parents=True, exist_ok=True)
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/thomas/buildroot/br/output-all/host/lib/python3.13/pathlib/_local.py", line 722, in mkdir
os.mkdir(self, mode)
~~~~~~~~^^^^^^^^^^^^PermissionError: [Errno 13] Permission denied: '/home/br-user/.config'
make[1]: *** [package/pkg-generic.mk:181: /home/thomas/buildroot/br/output-all/build/flutter-engine-3.29.2/.stamp_downloaded] Error 1
--- package/flutter-engine/flutter-engine.mk | 1 + 1 file changed, 1 insertion(+)
package/flutter-engine/flutter-engine.mk +1 -0
@@ -181,6 +181,7 @@ define FLUTTER_ENGINE_GENERATE_TARBALL PATH=$(HOST_DIR)/share/depot_tools:$(BR_PATH) \ PYTHONPATH=$(HOST_DIR)/lib/python$(PYTHON3_VERSION_MAJOR) \ PUB_CACHE=$(FLUTTER_SDK_BIN_PUB_CACHE) \ + XDG_CONFIG_HOME=$(@D)/dl-tmp \ $(FLUTTER_ENGINE_PKGDIR)/gen-tarball \ --dot-gclient $(TOPDIR)/$(FLUTTER_ENGINE_PKGDIR)/dot-gclient \ --jobs $(PARALLEL_JOBS) \
Signature · 6 lines
2.52.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Quoted 5 lines · Thomas Petazzoni via buildroot
gclient.pytries to not only read from $HOME/.config, but actually create some directories/files in there. As $HOME can be inaccessible, let's overrideXDG_CONFIG_HOMEto tell the depot-tools code to write its stuff into $(@D)/dl-tmp instead (which we already use as a scratch directory in this package).
Committed, thanks.
--
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Raphaël Mélotte via buildroot
AppliedIn reply of:
Quoted 39 lines
gclient.pytries to not only read from $HOME/.config, but actually create some directories/files in there. As $HOME can be inaccessible, let's overrideXDG_CONFIG_HOMEto tell the depot-tools code to write its stuff into $(@D)/dl-tmp instead (which we already use as a scratch directory in this package).Fixes:
Quoted 1 line
Quoted 1 line
Quoted 1 line
flutter-engine 3.29.2 Downloading
/home/thomas/buildroot/br/output-all/host/share/depot_tools/gclient.py:3367: SyntaxWarning: invalid escape sequence '\s'
dot_git_pattern= re.compile('^(\s*)url(\s*)=.*\.git$')/home/thomas/buildroot/br/output-all/host/share/depot_tools/gclient_scm.py:436: SyntaxWarning: invalid escape sequence '\.'
tokens = re.search('//(.+).googlesource.com/(.+?)(?:\.git)?$',
Traceback (most recent call last):
File "/home/thomas/buildroot/br/output-all/host/lib/python3.13/pathlib/_local.py", line 722, in mkdiros.mkdir(self, mode) ~~~~~~~~^^^^^^^^^^^^FileNotFoundError: [Errno 2] No such file or directory: '
/home/br-user/.config/depot_tools'During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/thomas/buildroot/br/output-all/host/share/depot_tools/gclient.py", line 108, in <module>
importgclient_scm
File "/home/thomas/buildroot/br/output-all/host/share/depot_tools/gclient_scm.py", line 23, in <module>
importgerrit_util
File "/home/thomas/buildroot/br/output-all/host/share/depot_tools/gerrit_util.py", line 42, in <module>
import metrics
File "/home/thomas/buildroot/br/output-all/host/share/depot_tools/metrics.py", line 23, in <module>
CONFIG_FILE=utils.depot_tools_config_path('metrics.cfg')
File "/home/thomas/buildroot/br/output-all/host/share/depot_tools/utils.py", line 48, indepot_tools_config_pathpathlib.Path(config_dir).mkdir(parents=True, exist_ok=True) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/thomas/buildroot/br/output-all/host/lib/python3.13/pathlib/_local.py", line 726, in mkdir self.parent.mkdir(parents=True, exist_ok=True) ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/thomas/buildroot/br/output-all/host/lib/python3.13/pathlib/_local.py", line 722, in mkdir os.mkdir(self, mode) ~~~~~~~~^^^^^^^^^^^^
Quoted 4 lines
PermissionError: [Errno 13] Permission denied: '
/home/br-user/.config'
make[1]: *** [package/pkg-generic.mk:181:/home/thomas/buildroot/br/output-all/build/flutter-engine-3.29.2/.stamp_downloaded] Error 1Signed-off-by Thomas Petazzoni <[email protected]>
Applied to 2025.02.x, 2026.08.x. Thanks
Quoted 9 lines
--- package/flutter-engine/flutter-engine.mk | 1 + 1 file changed, 1 insertion(+)package/flutter-engine/flutter-engine.mk +0
-0
package/flutter-engine/flutter-engine.mk define FLUTTER_ENGINE_GENERATE_TARBALL · line 187
Quoted 7 lines
package/flutter-engine/flutter-engine.mk +1
-0@@ -181,6 +181,7 @@ define FLUTTER_ENGINE_GENERATE_TARBALL PATH=$(HOST_DIR)/share/depot_tools:$(BR_PATH) \ PYTHONPATH=$(HOST_DIR)/lib/python$(PYTHON3_VERSION_MAJOR) \ PUB_CACHE=$(FLUTTER_SDK_BIN_PUB_CACHE) \ + XDG_CONFIG_HOME=$(@D)/dl-tmp \ $(FLUTTER_ENGINE_PKGDIR)/gen-tarball \ --dot-gclient $(TOPDIR)/$(FLUTTER_ENGINE_PKGDIR)/dot-gclient \ --jobs $(PARALLEL_JOBS) \
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot