Check-in [3055f3c0d7]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:MFT: Mount CCACHE_DIR in /root/.ccache as not all ports pass MAKE_ENV into the build.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | 3.0.x
Files: files | file ages | folders
SHA1: 3055f3c0d7d54791caf5bd3fca28670fd20829d8
User & Date: bdrewery 2013-05-29 15:33:19
Context
2013-05-29
15:33
MFT: jail: Fix cleanup and -d when using USE_TMPFS=all check-in: b439fec055 user: bdrewery tags: 3.0.x
15:33
MFT: Mount CCACHE_DIR in /root/.ccache as not all ports pass MAKE_ENV into the build. check-in: 3055f3c0d7 user: bdrewery tags: 3.0.x
15:31
MFT: Injail pkg invocations related to cachedir. This makes it possible to build pkgng packages from a host without pkg installed. Also, this makes possible to use custom LOCALBASE (/usr/sbin/pkg from the host was using the LOCALBASE environment variable which led to interesting problems when LOCALBASE of the host was different from LOCALBASE in the jails) check-in: 3467f55f29 user: bdrewery tags: 3.0.x
Changes

Changes to src/share/poudriere/common.sh.

586
587
588
589
590
591
592

593
594
595
596
597
598
599
...
601
602
603
604
605
606
607

608
609
610
611
612
613
614
...
617
618
619
620
621
622
623

624
625
626
627
628
629
630
...
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
...
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
...
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
		zfs snapshot ${fs}@${name}
	fi

	[ $domtree -eq 0 ] && return 0
	mkdir -p ${mnt}/poudriere/
	if [ "${name}" = "prepkg" ]; then
		cat > ${mnt}/poudriere/mtree.${name}exclude << EOF

./dev/*
./poudriere/*
./compat/linux/proc
./wrkdirs/*
./packages/*
./new_packages/*
./usr/ports/*
................................................................................
./ccache/*
./var/db/ports/*
./proc/*
./usr/src
EOF
	elif [ "${name}" = "prebuild" ]; then
		cat > ${mnt}/poudriere/mtree.${name}exclude << EOF

./dev/*
./poudriere/*
./compat/linux/proc
./wrkdirs/*
./packages/*
./new_packages/*
./usr/ports/*
................................................................................
./var/db/ports/*
./proc/*
./usr/src
./tmp/*
EOF
	elif [ "${name}" = "preinst" ]; then
		cat >  ${mnt}/poudriere/mtree.${name}exclude << EOF

./dev/*
./poudriere/*
./var/db/pkg/*
./var/run/*
./wrkdirs/*
./packages/*
./new_packages/*
................................................................................
		mkdir -p ${mnt}/compat/linux/proc
		mkdir -p ${mnt}/usr/ports
		mkdir -p ${mnt}/wrkdirs
		mkdir -p ${mnt}/${LOCALBASE:-/usr/local}
		mkdir -p ${mnt}/distfiles
		mkdir -p ${mnt}/packages
		mkdir -p ${mnt}/new_packages
		mkdir -p ${mnt}/ccache
		mkdir -p ${mnt}/var/db/ports
	fi

	# ref jail only needs devfs
	mount -t devfs devfs ${mnt}/dev
	devfs -m ${mnt}/dev rule apply hide
	for p in ${devfspath} ; do
................................................................................

	[ "$(realpath ${DISTFILES_CACHE})" != \
		"$(realpath -q ${portsdir}/distfiles)" ] || err 1 \
		"DISTFILES_CACHE cannot be in the portsdir as the portsdir will be mounted read-only"

	mkdir -p ${POUDRIERE_DATA}/packages/${MASTERNAME}/All
	[ -d "${CCACHE_DIR:-/nonexistent}" ] &&
		mount -t nullfs ${CCACHE_DIR} ${mnt}/ccache
	[ -n "${MFSSIZE}" ] && mdmfs -M -S -o async -s ${MFSSIZE} md ${mnt}/wrkdirs
	[ ${TMPFS_WRKDIR} -eq 1 ] && mount -t tmpfs tmpfs ${mnt}/wrkdirs
	# Only show mounting messages once, not for every builder
	if [ ${mnt##*/} = "ref" ]; then
		[ -d "${CCACHE_DIR:-/nonexistent}" ] &&
			msg "Mounting ccache from: ${CCACHE_DIR}"
		msg "Mounting packages from: ${POUDRIERE_DATA}/packages/${MASTERNAME}"
................................................................................

	if [ -n "${POUDRIERE_BUILD_TYPE}" ]; then
		show_log_info
	fi

	if [ -d "${CCACHE_DIR:-/nonexistent}" ]; then
		echo "WITH_CCACHE_BUILD=yes" >> ${tomnt}/etc/make.conf
		echo "CCACHE_DIR=/ccache" >> ${tomnt}/etc/make.conf
	fi
	echo "PACKAGES=/packages" >> ${tomnt}/etc/make.conf
	echo "DISTDIR=/distfiles" >> ${tomnt}/etc/make.conf

	setup_makeconf ${tomnt}/etc/make.conf ${name} ${ptname} ${setname}

	test -n "${RESOLV_CONF}" && cp -v "${RESOLV_CONF}" "${tomnt}/etc/"







>







 







>







 







>







 







|







 







|







 







|







586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
...
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
...
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
...
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
...
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
...
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
		zfs snapshot ${fs}@${name}
	fi

	[ $domtree -eq 0 ] && return 0
	mkdir -p ${mnt}/poudriere/
	if [ "${name}" = "prepkg" ]; then
		cat > ${mnt}/poudriere/mtree.${name}exclude << EOF
.${HOME}/.ccache/*
./dev/*
./poudriere/*
./compat/linux/proc
./wrkdirs/*
./packages/*
./new_packages/*
./usr/ports/*
................................................................................
./ccache/*
./var/db/ports/*
./proc/*
./usr/src
EOF
	elif [ "${name}" = "prebuild" ]; then
		cat > ${mnt}/poudriere/mtree.${name}exclude << EOF
.${HOME}/.ccache/*
./dev/*
./poudriere/*
./compat/linux/proc
./wrkdirs/*
./packages/*
./new_packages/*
./usr/ports/*
................................................................................
./var/db/ports/*
./proc/*
./usr/src
./tmp/*
EOF
	elif [ "${name}" = "preinst" ]; then
		cat >  ${mnt}/poudriere/mtree.${name}exclude << EOF
.${HOME}/.ccache/*
./dev/*
./poudriere/*
./var/db/pkg/*
./var/run/*
./wrkdirs/*
./packages/*
./new_packages/*
................................................................................
		mkdir -p ${mnt}/compat/linux/proc
		mkdir -p ${mnt}/usr/ports
		mkdir -p ${mnt}/wrkdirs
		mkdir -p ${mnt}/${LOCALBASE:-/usr/local}
		mkdir -p ${mnt}/distfiles
		mkdir -p ${mnt}/packages
		mkdir -p ${mnt}/new_packages
		mkdir -p ${mnt}${HOME}/.ccache
		mkdir -p ${mnt}/var/db/ports
	fi

	# ref jail only needs devfs
	mount -t devfs devfs ${mnt}/dev
	devfs -m ${mnt}/dev rule apply hide
	for p in ${devfspath} ; do
................................................................................

	[ "$(realpath ${DISTFILES_CACHE})" != \
		"$(realpath -q ${portsdir}/distfiles)" ] || err 1 \
		"DISTFILES_CACHE cannot be in the portsdir as the portsdir will be mounted read-only"

	mkdir -p ${POUDRIERE_DATA}/packages/${MASTERNAME}/All
	[ -d "${CCACHE_DIR:-/nonexistent}" ] &&
		mount -t nullfs ${CCACHE_DIR} ${mnt}${HOME}/.ccache
	[ -n "${MFSSIZE}" ] && mdmfs -M -S -o async -s ${MFSSIZE} md ${mnt}/wrkdirs
	[ ${TMPFS_WRKDIR} -eq 1 ] && mount -t tmpfs tmpfs ${mnt}/wrkdirs
	# Only show mounting messages once, not for every builder
	if [ ${mnt##*/} = "ref" ]; then
		[ -d "${CCACHE_DIR:-/nonexistent}" ] &&
			msg "Mounting ccache from: ${CCACHE_DIR}"
		msg "Mounting packages from: ${POUDRIERE_DATA}/packages/${MASTERNAME}"
................................................................................

	if [ -n "${POUDRIERE_BUILD_TYPE}" ]; then
		show_log_info
	fi

	if [ -d "${CCACHE_DIR:-/nonexistent}" ]; then
		echo "WITH_CCACHE_BUILD=yes" >> ${tomnt}/etc/make.conf
		echo "CCACHE_DIR=${HOME}/.ccache" >> ${tomnt}/etc/make.conf
	fi
	echo "PACKAGES=/packages" >> ${tomnt}/etc/make.conf
	echo "DISTDIR=/distfiles" >> ${tomnt}/etc/make.conf

	setup_makeconf ${tomnt}/etc/make.conf ${name} ${ptname} ${setname}

	test -n "${RESOLV_CONF}" && cp -v "${RESOLV_CONF}" "${tomnt}/etc/"