aboutsummaryrefslogtreecommitdiffstats
path: root/include/package.mk
diff options
context:
space:
mode:
authorJeffery To <jeffery.to@gmail.com>2023-05-31 21:58:34 +0800
committerPetr Štetiar <ynezz@true.cz>2023-05-31 19:33:00 +0200
commitf597f34f3afa7bba8a2606490617688f1cea5a44 (patch)
tree935979e2fd545de562b0e1c02e216865e1495a8f /include/package.mk
parent95dde523297c652072ee96ac32d22912a43ef761 (diff)
downloadupstream-f597f34f3afa7bba8a2606490617688f1cea5a44.tar.gz
upstream-f597f34f3afa7bba8a2606490617688f1cea5a44.tar.bz2
upstream-f597f34f3afa7bba8a2606490617688f1cea5a44.zip
build: export GIT_CEILING_DIRECTORIES for package builds
A package may run git as part of its build process, and if the package source code is not from a git checkout, then git may traverse up the directory tree to find buildroot's repository directory (.git). For instance, Poetry Core, a Python build backend, will read the contents of .gitignore for paths to exclude when creating a Python package. If it finds buildroot's .gitignore file, then Poetry Core will exclude all of the package's files[1]. This exports GIT_CEILING_DIRECTORIES for both package and host builds so that git will not traverse beyond $(BUILD_DIR)/$(BUILD_DIR_HOST). [1]: https://github.com/python-poetry/poetry/issues/5547 Signed-off-by: Jeffery To <jeffery.to@gmail.com>
Diffstat (limited to 'include/package.mk')
-rw-r--r--include/package.mk1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/package.mk b/include/package.mk
index f03cb15f05d..c391d320aa2 100644
--- a/include/package.mk
+++ b/include/package.mk
@@ -194,6 +194,7 @@ define Build/Exports/Default
$(1) : export CONFIG_SITE:=$$(CONFIG_SITE)
$(1) : export PKG_CONFIG_PATH:=$$(PKG_CONFIG_PATH)
$(1) : export PKG_CONFIG_LIBDIR:=$$(PKG_CONFIG_PATH)
+ $(1) : export GIT_CEILING_DIRECTORIES:=$$(BUILD_DIR)
endef
Build/Exports=$(Build/Exports/Default)