Permalink
Browse files

osh --help now works when compiled with OPy.

Had to add symlinks to _tmp/osh-opy.
  • Loading branch information...
Andy Chu
Andy Chu committed Feb 24, 2018
1 parent 67a4e32 commit 37df248817468ac4b3630959f12e7a3295e9cd54
Showing with 43 additions and 6 deletions.
  1. +1 −1 opy/README.md
  2. +31 −2 opy/smoke.sh
  3. +11 −3 scripts/run.sh
View
@@ -11,7 +11,7 @@ Getting started / smoke test:
Compiling Oil:
./smoke.sh compile-osh-tree # makes _tmp/osh-opy and _tmp/osh-ccompile
./smoke.sh test-osh-tree # Run Oil unit tests
./smoke.sh test-unit # Run Oil unit tests
TODO:
View
@@ -73,12 +73,36 @@ compile-opy-tree() {
_compile-tree $src _tmp/opy-opy/ opy "${files[@]}"
}
make-links() {
local dir=${1:-_tmp/osh-opy}
local run=$PWD/../scripts/run.sh
pushd $dir
$run make-pyc-links
popd
#tree $dir
}
_fill-osh-tree() {
local dir=${1:-_tmp/osh-stdlib}
local dir=${1:-_tmp/osh-opy}
cp -v ../osh/{osh,types}.asdl $dir/osh
cp -v ../core/runtime.asdl $dir/core
cp -v ../asdl/arith.asdl $dir/asdl
ln -v -s -f $PWD/../{libc,fastlex}.so $dir
# Needed for help text.
ln -v -s -f --no-target-directory $PWD/../_build $dir/_build
make-links $dir
}
osh-opy() {
python _tmp/osh-opy/bin/osh "$@"
}
test-help() {
osh-opy --help
}
# Compile with both compile() and OPy.
@@ -124,7 +148,7 @@ zip-oil-tree() {
# TODO:
# - Run with oil.ovm{,-dbg}
test-osh-tree() {
test-unit() {
local dir=${1:-_tmp/osh-opy}
local vm=${2:-cpython} # byterun or cpython
@@ -145,6 +169,11 @@ test-osh-tree() {
popd
}
test-osh-smoke() {
local dir=${1:-_tmp/osh-opy}
local vm=${2:-cpython} # byterun or cpython
}
write-speed() {
cat >_tmp/speed.py <<EOF
def do_sum(n):
View
@@ -16,19 +16,27 @@ replace-print() {
#sed -i --regexp-extended -e 's/print (.*)/print(\1)/' {osh,core}/*.py
}
readonly LINKS='oil oilc osh sh wok boil true false'
make-bin-links() {
# bin/ is for running with the Python interpreter. _bin/ is for running with
# OVM app bundles.
links='oil oilc osh sh wok boil true false'
mkdir -p bin _bin
for link in $links ; do
for link in $LINKS; do
ln -s -f --verbose oil.py bin/$link
done
for link in $links; do
for link in $LINKS; do
ln -s -f --verbose oil.ovm _bin/$link
done
}
# For OPy, called by opy/smoke.sh
make-pyc-links() {
for link in $LINKS; do
ln -s -f --verbose oil.pyc bin/$link
done
}
"$@"

0 comments on commit 37df248

Please sign in to comment.