Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/freebsd/poudriere.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan Drewery <bryan@shatow.net>2018-03-22 20:04:47 +0300
committerBryan Drewery <bryan@shatow.net>2018-03-22 20:04:51 +0300
commit75f1e639432e50a06286d44dd7fb0225390ab2dc (patch)
tree82b5e318b7c5cfae5b9d39ba6a4d33fbc364a728
parent7cd09e2eea48a26088355715b4ebdb35607c3c0a (diff)
CCACHE_STATIC_PREFIX: Add CCACHE_JAIL_PREFIX for overriding /ccache in jail
-rwxr-xr-xsrc/share/poudriere/common.sh21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/share/poudriere/common.sh b/src/share/poudriere/common.sh
index 6d7fc365..3f69feef 100755
--- a/src/share/poudriere/common.sh
+++ b/src/share/poudriere/common.sh
@@ -2168,7 +2168,6 @@ lock_jail() {
setup_ccache() {
[ $# -eq 1 ] || eargs setup_ccache tomnt
local tomnt="$1"
- local ccacheprefix
if [ -d "${CCACHE_DIR:-/nonexistent}" ]; then
cat >> "${tomnt}/etc/make.conf" <<-EOF
@@ -2182,34 +2181,33 @@ setup_ccache() {
file "${CCACHE_STATIC_PREFIX}/bin/ccache" | \
grep -q "statically linked" || \
err 1 "CCACHE_STATIC_PREFIX used but ${CCACHE_STATIC_PREFIX}/bin/ccache is not static."
- ccacheprefix=/ccache
- mkdir -p "${tomnt}${ccacheprefix}/libexec/ccache/world" \
- "${tomnt}${ccacheprefix}/bin"
+ mkdir -p "${tomnt}${CCACHE_JAIL_PREFIX}/libexec/ccache/world" \
+ "${tomnt}${CCACHE_JAIL_PREFIX}/bin"
msg "Copying host static ccache from ${CCACHE_STATIC_PREFIX}/bin/ccache"
cp -f "${CCACHE_STATIC_PREFIX}/bin/ccache" \
"${CCACHE_STATIC_PREFIX}/bin/ccache-update-links" \
- "${tomnt}${ccacheprefix}/bin/"
+ "${tomnt}${CCACHE_JAIL_PREFIX}/bin/"
cp -f "${CCACHE_STATIC_PREFIX}/libexec/ccache/world/ccache" \
- "${tomnt}${ccacheprefix}/libexec/ccache/world/ccache"
+ "${tomnt}${CCACHE_JAIL_PREFIX}/libexec/ccache/world/ccache"
# Tell the ports framework that we don't need it to add
# a BUILD_DEPENDS on everything for ccache.
# Also set it up to look in our ccacheprefix location for the
# wrappers.
cat >> "${tomnt}/etc/make.conf" <<-EOF
NO_CCACHE_DEPEND=1
- CCACHE_WRAPPER_PATH= ${ccacheprefix}/libexec/ccache
+ CCACHE_WRAPPER_PATH= ${CCACHE_JAIL_PREFIX}/libexec/ccache
EOF
# Link the wrapper update script to /sbin so that
# any package trying to update the links will find it
# rather than an actual ccache package in the jail.
- ln -fs "../${ccacheprefix}/bin/ccache-update-links" \
+ ln -fs "../${CCACHE_JAIL_PREFIX}/bin/ccache-update-links" \
"${tomnt}/sbin/ccache-update-links"
# Fix the wrapper update script to always make the links
# in the new prefix.
- sed -i '' -e "s,^\(PREFIX\)=.*,\1=\"${ccacheprefix}\"," \
- "${tomnt}${ccacheprefix}/bin/ccache-update-links"
+ sed -i '' -e "s,^\(PREFIX\)=.*,\1=\"${CCACHE_JAIL_PREFIX}\"," \
+ "${tomnt}${CCACHE_JAIL_PREFIX}/bin/ccache-update-links"
# Create base compiler links
- injail "${ccacheprefix}/bin/ccache-update-links"
+ injail "${CCACHE_JAIL_PREFIX}/bin/ccache-update-links"
fi
}
@@ -7521,6 +7519,7 @@ if [ -n "${CCACHE_DIR}" ] && [ "${CCACHE_DIR_NON_ROOT_SAFE}" = "no" ]; then
# Default off with CCACHE_DIR.
: ${BUILD_AS_NON_ROOT:=no}
fi
+: ${CCACHE_JAIL_PREFIX:=/ccache}
# Default on otherwise.
: ${BUILD_AS_NON_ROOT:=yes}
: ${DISTFILES_CACHE:=/nonexistent}