Build Linux binaries using Vagrant (#132)
Adds a Vagrantfile to provision a Debian VM, and recipes to build for linux on the VM.
This commit is contained in:
parent
da8108f19d
commit
6b9922fc2c
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,2 +1,2 @@
|
||||
/target
|
||||
/tmp
|
||||
/.vagrant
|
||||
|
18
Vagrantfile
vendored
Normal file
18
Vagrantfile
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
Vagrant.configure(2) do |config|
|
||||
config.vm.box = 'debian/jessie64'
|
||||
|
||||
config.vm.provision "shell", inline: <<-EOS
|
||||
apt-get -y update
|
||||
apt-get install -y clang git vim
|
||||
EOS
|
||||
|
||||
config.vm.provision "shell", privileged: false, inline: <<-EOS
|
||||
curl https://sh.rustup.rs -sSf > install-rustup
|
||||
chmod +x install-rustup
|
||||
./install-rustup -y
|
||||
source ~/.cargo/env
|
||||
rustup target add x86_64-unknown-linux-musl
|
||||
cargo install just
|
||||
git clone https://github.com/casey/just.git
|
||||
EOS
|
||||
end
|
24
justfile
24
justfile
@ -38,6 +38,17 @@ build-binary-mac VERSION:
|
||||
build-binary-linux VERSION:
|
||||
just build-binary {{VERSION}} x86_64-unknown-linux-musl
|
||||
|
||||
build-and-fetch-linux-binary VERSION:
|
||||
vagrant up
|
||||
vagrant ssh -- 'bash -lc "cd just && git checkout build-binaries && git pull && just build-binary-linux {{VERSION}}"'
|
||||
rm -rf tmp/linux
|
||||
mkdir tmp/linux
|
||||
scp \
|
||||
-P 2222 \
|
||||
-i .vagrant/machines/default/virtualbox/private_key \
|
||||
'vagrant@127.0.0.1:just/tmp/*-x86_64-unknown-linux-musl.tar.gz' \
|
||||
tmp/linux
|
||||
|
||||
build-binary VERSION TARGET:
|
||||
git diff --no-ext-diff --quiet --exit-code
|
||||
git checkout {{VERSION}}
|
||||
@ -49,12 +60,11 @@ build-binary VERSION TARGET:
|
||||
GRAMMAR.md \
|
||||
LICENSE.md \
|
||||
README.md \
|
||||
target/release/just \
|
||||
target/{{TARGET}}/release/just \
|
||||
tmp/just-{{VERSION}}-{{TARGET}}
|
||||
cd tmp && tar cvfz \
|
||||
just-{{VERSION}}-{{TARGET}}.tar.gz \
|
||||
just-{{VERSION}}-{{TARGET}}
|
||||
open tmp
|
||||
|
||||
# clean up feature branch BRANCH
|
||||
done BRANCH:
|
||||
@ -105,10 +115,11 @@ backtick-fail:
|
||||
echo {{`exit 1`}}
|
||||
|
||||
test-quine:
|
||||
cargo run -- quine clean
|
||||
cargo run -- quine
|
||||
|
||||
# make a quine, compile it, and verify it
|
||||
quine: create
|
||||
quine:
|
||||
@echo '{{quine-text}}' > tmp/gen0.c
|
||||
cc tmp/gen0.c -o tmp/gen0
|
||||
./tmp/gen0 > tmp/gen1.c
|
||||
cc tmp/gen1.c -o tmp/gen1
|
||||
@ -132,11 +143,6 @@ quine-text = '
|
||||
}
|
||||
'
|
||||
|
||||
# create our quine
|
||||
create:
|
||||
mkdir -p tmp
|
||||
@echo '{{quine-text}}' > tmp/gen0.c
|
||||
|
||||
# run all polyglot recipes
|
||||
polyglot: python js perl sh ruby
|
||||
|
||||
|
1
tmp/.gitignore
vendored
Normal file
1
tmp/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
*
|
Loading…
Reference in New Issue
Block a user