aboutsummaryrefslogtreecommitdiffstats
path: root/include/host-build.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-06-07 09:04:23 +0200
commitb059aaf039e8127bef74b180593bf940b6397f3b (patch)
treef25f8668cf777f65070e220f9cc8e8ea4e421af1 /include/host-build.mk
parent5db2d6d009019d9c8b30ff2321785812d1fb19b2 (diff)
downloadupstream-b059aaf039e8127bef74b180593bf940b6397f3b.tar.gz
upstream-b059aaf039e8127bef74b180593bf940b6397f3b.tar.bz2
upstream-b059aaf039e8127bef74b180593bf940b6397f3b.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> (cherry picked from commit f597f34f3afa7bba8a2606490617688f1cea5a44)
Diffstat (limited to 'include/host-build.mk')
-rw-r--r--include/host-build.mk1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/host-build.mk b/include/host-build.mk
index b7fb0a737f..7485f91e42 100644
--- a/include/host-build.mk
+++ b/include/host-build.mk
@@ -131,6 +131,7 @@ define Host/Exports/Default
$(1) : export STAGING_PREFIX=$$(HOST_BUILD_PREFIX)
$(1) : export PKG_CONFIG_PATH=$$(STAGING_DIR_HOST)/lib/pkgconfig:$$(HOST_BUILD_PREFIX)/lib/pkgconfig
$(1) : export PKG_CONFIG_LIBDIR=$$(HOST_BUILD_PREFIX)/lib/pkgconfig
+ $(1) : export GIT_CEILING_DIRECTORIES=$$(BUILD_DIR_HOST)
$(if $(HOST_CONFIG_SITE),$(1) : export CONFIG_SITE:=$(HOST_CONFIG_SITE))
$(if $(IS_PACKAGE_BUILD),$(1) : export PATH=$$(TARGET_PATH_PKG))
endef