Permalink
Browse files
Working toward an Oil release (on a machine without root privileges).
- Update the spec test version text for hermetic shell binaries.
- Make copies of the binaries, not symlinks
- build/dev.sh: a shell function to install R packages to ~/R
- Define $R_PATH in test/common.sh and use it whenever we invoke R.
Loading branch information...
Showing
8 changed files
with
65 additions
and
22 deletions .
+1
−1
benchmarks/report.sh
+15
−0
build/dev.sh
+9
−5
scripts/release.sh
+2
−0
test/common.sh
+0
−1
test/report.R
+7
−6
test/spec-bin.sh
+30
−8
test/spec.sh
+1
−1
test/unit.sh
@@ -23,7 +23,7 @@ stage2() {
local out=$base_dir /stage2
mkdir -p $out
benchmarks/report.R $action $base_dir /stage1 $out
R_LIBS_USER= $R_PATH benchmarks/report.R $action $base_dir /stage1 $out
tree $out
}
@@ -14,6 +14,8 @@ set -o nounset
set -o pipefail
set -o errexit
source test/common.sh # R_PATH
ubuntu-deps () {
# python-dev: for pylibc
# gawk: used by spec-runner.sh for the special match() function.
@@ -22,6 +24,19 @@ ubuntu-deps() {
sudo apt-get install python-dev gawk time libreadline-dev
test/spec.sh install-shells
# TODO: For the release to run test/report.R, you need r-base-core too.
}
r-packages () {
# Install to a directory that doesn't require root. This requires setting
# R_LIBS_USER. Or library(dplyr, lib.loc = "~/R", but the former is preferable.
mkdir -p ~ /R
INSTALL_DEST=$R_PATH Rscript -e ' install.packages(c("dplyr"), lib=Sys.getenv("INSTALL_DEST"), repos="http://cran.us.r-project.org")'
}
test-r-packages () {
R_LIBS_USER=$R_PATH Rscript -e ' library(dplyr)'
}
# Produces _devbuild/gen/osh_help.py
@@ -129,21 +129,25 @@ _release-build() {
# oil.ovm
}
readonly HAVE_ROOT=' '
_test-release-build () {
# NOTE: Need test/alpine.sh download;extract;setup-dns,add-oil-build-deps,
# etc.
# TODO: Factor out test/alpine.sh to test/chroot.sh
test/alpine.sh copy-tar ' ' oil
test/alpine.sh test -tar ' ' oil
test/spec.sh link-busybox-ash # in case we deleted _tmp
if test -n " $HAVE_ROOT " ; then
# TODO: Factor out test/alpine.sh to test/chroot.sh
test/alpine.sh copy -tar ' ' oil
test/alpine.sh test-tar ' ' oil
fi
test/spec.sh smoke # Initial smoke test, slightly redundant.
test/osh2oil.sh run-for-release
test/gold.sh run-for-release
# TODO: Assert that this was done with hermetic binaries?
# spec-tests-with-tar-build
OSH_OVM=$OSH_RELEASE_BINARY test/spec.sh all
}
@@ -15,6 +15,8 @@ readonly OSH=${OSH:-bin/osh}
# For xargs -P in spec-runner.sh, wild-runner.sh.
readonly JOBS=$(( $(nproc) - 1 ))
readonly R_PATH=~ /R # Like PYTHONPATH, but for running R scripts
log () {
echo " $@ " 1>&2
}
@@ -3,7 +3,6 @@
# report.R
library(dplyr )
library(ggplot2 )
options(stringsAsFactors = F )
@@ -77,18 +77,19 @@ build-all() {
popd
}
link -all () {
copy -all () {
pushd $DIR
ln -s -f -v bash-4.3/bash .
ln -s -f -v dash-0.5.8/src/dash .
ln -s -f -v mksh-R52c/mksh .
ln -s -f -v busybox-1.22.0/busybox ./ash
cp -f -v bash-4.3/bash .
cp -f -v dash-0.5.8/src/dash .
cp -f -v mksh-R52c/mksh .
cp -f -v busybox-1.22.0/busybox .
ln -s -f -v busybox ash
# In its own tree
# ln -s -f -v zsh-out/bin/zsh .
# Static binary
ln -s -f -v zsh-5.1.1/Src/zsh .
cp -f -v zsh-5.1.1/Src/zsh .
popd
}
@@ -123,29 +123,51 @@ version-text() {
echo
for bin in $OSH ; do
echo ---
echo " \$ $bin --version"
$bin --version
echo
done
python --version 2>&1
echo
echo ---
$BASH --version | head -n 1
ls -l $BASH
echo
echo ---
$ZSH --version | head -n 1
ls -l $ZSH
echo
# These don't have versions
dpkg -s dash | egrep ' ^Package|Version'
# No -v or -V or --version. TODO: Only use hermetic version on release.
echo ---
local my_dash=_tmp/spec-bin/dash
if test -f $my_dash ; then
ls -l $my_dash
else
dpkg -s dash | egrep ' ^Package|Version'
fi
echo
dpkg -s mksh | egrep ' ^Package|Version'
echo ---
local my_mksh=_tmp/spec-bin/mksh
if test -f $my_mksh ; then
ls -l $my_mksh
else
dpkg -s mksh | egrep ' ^Package|Version'
fi
echo
# Need || true because of pipefail
{ busybox || true ; } | head -n 1
echo ---
local my_busybox=_tmp/spec-bin/busybox-1.22.0/busybox
if test -f $my_busybox ; then
{ $my_busybox || true ; } | head -n 1
ls -l $my_busybox
else
# Need || true because of pipefail
{ busybox || true ; } | head -n 1
fi
echo
maybe-show /etc/debian_version
@@ -186,7 +186,7 @@ EOF
write-report () {
local out=_tmp/unit/index.html
test/report.R unit _tmp/unit _tmp/unit
R_LIBS_USER= $R_PATH test/report.R unit _tmp/unit _tmp/unit
print-report > $out
echo " Wrote $out "
}
Toggle all file notes
0 comments on commit
106f216