Skip to content

Commit

Permalink
Merge pull request EESSI#54 from EESSI/update_prefix
Browse files Browse the repository at this point in the history
Update bootstrap script and use latest snapshot
  • Loading branch information
boegel authored Oct 30, 2020
2 parents 3b63b90 + f0374f0 commit b479770
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 11 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ singularity exec docker://eessi/bootstrap-prefix:centos8-$(uname -m) ./bootstrap
Our version of the script allows you to pick a custom snapshot for the Portage tree. This can be done by setting `SNAPSHOT_URL` to
a URL that points to a directory, and setting `CUSTOM_SNAPSHOT` to the name of a snapshot file (must be a bzip2 archive). For instance:
```
env SNAPSHOT_URL="http://cvmfs-s0.eessi-hpc.org/snapshots" CUSTOM_SNAPSHOT="portage-20200909.tar.bz2" docker://eessi/bootstrap-prefix:centos8-$(uname -m)
env SNAPSHOT_URL="http://cvmfs-s0.eessi-hpc.org/snapshots" CUSTOM_SNAPSHOT="portage-20201028.tar.bz2" singularity run docker://eessi/bootstrap-prefix:centos8-$(uname -m)
```
If you want to limit the supported/installed Python version(s), you can set the environment variable `PYTHON_TARGETS` before starting the bootstrap script. By only including a Python 3 version, you can prevent Python 2 from being installed, e.g.:
```
env PYTHON_TARGETS="python3_7" SNAPSHOT_URL="http://cvmfs-s0.eessi-hpc.org/snapshots" CUSTOM_SNAPSHOT="portage-20200909.tar.bz2" docker://eessi/bootstrap-prefix:centos8-$(uname -m)
env PYTHON_TARGETS="python3_7" SNAPSHOT_URL="http://cvmfs-s0.eessi-hpc.org/snapshots" CUSTOM_SNAPSHOT="portage-20201028.tar.bz2" singularity run docker://eessi/bootstrap-prefix:centos8-$(uname -m)
```

After starting the bootstrap have a long coffee...
Expand Down
35 changes: 26 additions & 9 deletions bootstrap-prefix.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,21 @@ configure_toolchain() {
local ccvers="$( (unset CHOST; gcc --version 2>/dev/null) )"
local mycc=
case "${ccvers}" in
*"Apple clang version "*)
vers=${ccvers#*Apple clang version }
vers=${vers% (clang-*}
# this is Clang, recent enough to compile recent clang
mycc=clang
compiler_stage1+="
${llvm_deps}
sys-devel/llvm
sys-devel/clang
sys-libs/libcxxabi
sys-libs/libcxx"
CC=clang
CXX=clang++
linker=sys-devel/binutils-apple
;;
*"Apple LLVM version "*)
vers=${ccvers#*Apple LLVM version }
vers=${vers% (clang-*}
Expand Down Expand Up @@ -364,13 +379,6 @@ bootstrap_setup() {
echo "USE=\"\${USE} ${MAKE_CONF_ADDITIONAL_USE}\""
[[ ${OFFLINE_MODE} ]] && \
echo 'FETCHCOMMAND="bash -c \"echo I need \${FILE} from \${URI} in \${DISTDIR}; read\""'
if [[ ${compiler_type} == clang ]] ; then
local ptrgs=$(sed -n 's/^PYTHON_TARGETS="\([^"]\+\)".*$/\1/' \
"${PORTDIR}"/profiles/prefix/make.conf)
ptrgs=${ptrgs/-python2_7/}
echo "# python2 is required by sys-devel/clang-6"
echo "PYTHON_TARGETS=\"python2_7 ${ptrgs}\""
fi
} > "${ROOT}"/etc/portage/make.conf
fi

Expand Down Expand Up @@ -1343,6 +1351,8 @@ bootstrap_stage1() {
# best.

# See comments in do_tree().
local portroot=${PORTDIR%/*}
mkdir -p "${ROOT}"/tmp/${portroot#${ROOT}/}
for x in lib sbin bin; do
mkdir -p "${ROOT}"/tmp/usr/${x}
[[ -e ${ROOT}/tmp/${x} ]] || ( cd "${ROOT}"/tmp && ln -s usr/${x} )
Expand Down Expand Up @@ -2689,8 +2699,15 @@ EOF
EPREFIX=
continue
fi
if [[ $(stat -c '%U/%G' "${EPREFIX}"/.canihaswrite) != \
$(stat -c '%U/%G' "${EPREFIX}") ]] ;
# GNU and BSD variants of stat take different arguments (and
# format specifiers are not equivalent)
case "${CHOST}" in
*-darwin* | *-freebsd*) STAT='stat -f %u/%g' ;;
*) STAT='stat -c %U/%G' ;;
esac

if [[ $(${STAT} "${EPREFIX}"/.canihaswrite) != \
$(${STAT} "${EPREFIX}") ]] ;
then
echo
echo "The $EPREFIX directory has different ownership than expected."
Expand Down

0 comments on commit b479770

Please sign in to comment.