Skip to content

Commit

Permalink
convert tasks.py to justfile (#36)
Browse files Browse the repository at this point in the history
* convert tasks.py to justfile

* install just in pipelines

* remove virtualenv traces

* move just install
  • Loading branch information
Zaechus authored and iwillspeak committed Sep 29, 2019
1 parent 3e10083 commit 754060f
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 71 deletions.
2 changes: 1 addition & 1 deletion .ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RUN apt-get update && \
COPY llvm.list /etc/apt/sources.list.d/
RUN apt-get update && \
apt-get install -y sudo && \
apt-get install -y python3 python3-pip && \
apt-get install -y python3 && \
apt-get install -y clang binutils && \
apt-get install -y llvm-8-dev && \
apt-get install -y zlib1g-dev
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@ target/
docs/build/
# Binaries for spec tests
specbin/
a.out
# Python virtual env for `invoke`
venv/
a.out
3 changes: 0 additions & 3 deletions .vscode/settings.json

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ You can also mess around with constant strings:
## Building and Testing

The main build is performed by `cargo`. For running the functional
tests and benchmarks you'll need Python. The suggested process is to
tests and benchmarks you'll need Python and to `cargo install just`. The suggested process is to
use the `build.sh` script:

* `$ ./build.sh` will build the compiler `target/release/ullage`.
Expand Down
8 changes: 3 additions & 5 deletions azure-pipelines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
export PATH=/usr/local/bin:$PATH # Local bin (brew)
source ~/.cargo/env
export LLVM_SYS_80_PREFIX=/usr/local/opt/llvm
pip3 install virtualenv
cargo install just
./build.sh test
displayName: './build.sh test'
- job: Linux
Expand All @@ -27,16 +27,14 @@ jobs:
steps:
- script: |
python3 --version
pip3 --version
pip3 install virtualenv
export PATH=${PATH}:~/.local/bin/
virtualenv --version
displayName: Virtualenv Install
displayName: Python
- script: "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -o rustup.sh && sh rustup.sh -y"
displayName: Rustup
- script: |
source ~/.cargo/env
export PATH=${PATH}:~/.local/bin/
export LLVM_SYS_80_PREFIX=/usr/lib/llvm-8
cargo install just
./build.sh test
displayName: './build.sh test'
13 changes: 1 addition & 12 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,5 @@ function check_for()
}

check_for python3
check_for pip3
check_for virtualenv

if [ ! -d ${DIR}/venv ]
then
# make sure to use a Python3 interpreter
virtualenv -p python3 venv
fi

source ${DIR}/venv/bin/activate
pip3 install -r ${DIR}/requirements.txt

invoke "$@"
just "$@"
1 change: 1 addition & 0 deletions docs/00-getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
This is only known to work on my machine at the moment. I'm running macOS and stable Rust If you'd still like to give it a go then make sure you have:

* Rust - to compile the compiler
* Just - to run help commands
* Python - to run the functional tests
* Clang - Used to link the output to create the final executables.

Expand Down
35 changes: 35 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
build:
cargo build --release

test: build
cargo test
python3 specs.py

clean:
rm -f a.out
rm -rf specbin/
cargo clean

docs:
cd docs/; docket

clippy:
cargo clippy

bench opt_level="3": build
#!/usr/bin/env python3
import os
import glob
import subprocess
for bench in glob.glob("spec/bench/*.ulg"):
output = bench.lstrip('spec/').rstrip('.ulg')
output = os.path.join("specbin", "bench", output)
try:
os.makedirs(os.path.dirname(output))
except OSError:
pass
print("bench={0}, output={1}, opt={2}".format(bench, output, {{opt_level}}))
subprocess.call("target/release/ullage {0} -O{1} -o {2}"
.format(bench, {{opt_level}}, output))
subprocess.call("time {0}".format(output))
1 change: 0 additions & 1 deletion requirements.txt

This file was deleted.

45 changes: 0 additions & 45 deletions tasks.py

This file was deleted.

0 comments on commit 754060f

Please sign in to comment.