Skip to content

Commit

Permalink
Do /tmp hack only on Travis CI
Browse files Browse the repository at this point in the history
  • Loading branch information
mame committed Sep 1, 2018
1 parent 327723b commit d773c93
Show file tree
Hide file tree
Showing 6 changed files with 170 additions and 20 deletions.
137 changes: 137 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,140 @@ env:
secure: NGDakAqRZgGJwEJTlXenhoXcq9ulf0X0fjnC+oF+ktTXCRpdbQd8+faxIW5DR26qF5OMWPqsLtUv8HtQyv5P5gVNs41hXygmNU1R9TOMpw64FjXtkD1HNf0D4jE2STuUU2xB+sCifeb9z6SvMpcy6ZswBlhAVnV+5dboNZL0Ww0=
dummy: |
dummy" > /dev/null
mkdir spoiler
sudo docker cp qr:/usr/local/share/quine-relay/QR.rb spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.rs spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.scala spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.scm spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.sci spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.sed spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.spl spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.sl spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.st spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.nut spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.sml spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.sq spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.tcl spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.tcsh spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.t spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.ts spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.unl spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.vala spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.mid spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.v spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.vim spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.vb spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.ws spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.xslt spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.yab spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.yorick spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.azm spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.zsh spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.+ spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/qr.adb spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.als spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.aheui spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.a68 spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.ante spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.cc spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.aj spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.asy spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.dats spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.awk spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.bash spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.bc spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.bsh spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.bef spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.Blc spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.bf spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.c spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.cpp spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.cs spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.chef spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.clj spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.cmake spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.cob spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.coffee spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.lisp spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.curry spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.d spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.dfy spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.dc spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.ec spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.exs spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.el spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.erl spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.fsx spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.false spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.fl spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.fish spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.fs spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.f spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.f90 spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.g spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.gdb spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.gel spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.gsl spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.plt spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.go spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.gs spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.gpt spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.grass spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.gri spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.groovy spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.gz spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.hs spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.hx spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.icn spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.i spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.j spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.java spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.js spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.jq spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.jsfuck spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.ksh spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.lazy spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/qr.li spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.ls spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.ll spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.lol spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.lua spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.m4 spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.mk spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.mac spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.mzn spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.il spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.mustache spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.asm spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.neko spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.5c spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.nim spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.m spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.ml spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.octave spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.ook spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.gp spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.p spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.pas spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.pl spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.pl6 spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.php spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.png spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.pike spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.ps spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.ppt spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.prolog spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.pr spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.py spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.R spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.ratfor spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.rc spoiler/
sudo docker cp qr:/usr/local/share/quine-relay/QR.rexx spoiler/
cd spoiler
git init --quiet
git config user.name 'Yusuke Endoh'
git config user.email '[email protected]'
git add .
git commit -m spoiler --quiet
git push --force --quiet "https://${GH_TOKEN}@github.com/mame/quine-relay" master:spoiler
echo The intermediate sources are available: https://github.com/mame/quine-relay/tree/spoiler
10 changes: 4 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -880,11 +880,9 @@ QR.mzn: QR.mac
@echo "## 100: Maxima -> MiniZinc ##"
@echo "###############################"
@echo
mv /tmp /tmp.bak
ln -s /dev/shm /tmp
@if [ $TRAVIS = "true" ]; then mv /tmp /tmp.bak && ln -s /dev/shm /tmp; fi
maxima -q --init-mac=QR.mac > QR.mzn
rm /tmp
mv /tmp.bak /tmp
@if [ $TRAVIS = "true" ]; then rm /tmp && mv /tmp.bak /tmp; fi

QR.il: QR.mzn
@echo
Expand Down Expand Up @@ -971,9 +969,9 @@ QR.ook: QR.octave
@echo "## 110: Octave -> Ook! ##"
@echo "###########################"
@echo
mv QR.m QR.m.bak
@mv QR.m QR.m.bak
octave -qf QR.octave > QR.ook
mv QR.m.bak QR.m
@mv QR.m.bak QR.m

QR.gp: QR.ook
@echo
Expand Down
19 changes: 9 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,7 @@ Then, build the bundled interpreters.
$ lua5.3 QR.lua > QR.m4
$ m4 QR.m4 > QR.mk
$ make -f QR.mk > QR.mac
$ mv /tmp /tmp.bak && ln -s /dev/shm /tmp && maxima -q --init-mac=QR.mac > QR.mzn &&
rm /tmp && mv /tmp.bak /tmp
$ maxima -q --init-mac=QR.mac > QR.mzn
$ mzn2fzn QR.mzn && fzn-gecode QR.fzn | solns2out --soln-sep '' QR.ozn > QR.il
$ ilasm QR.il && mono QR.exe > QR.mustache
$ mustache QR.mustache QR.mustache > QR.asm
Expand All @@ -165,7 +164,7 @@ Then, build the bundled interpreters.
$ nim c QR.nim && ./QR > QR.m
$ gcc -o QR QR.m && ./QR > QR.ml
$ ocaml QR.ml > QR.octave
$ mv QR.m QR.m.bak && octave -qf QR.octave > QR.ook && mv QR.m.bak QR.m
$ octave -qf QR.octave > QR.ook
$ ruby vendor/ook-to-bf.rb QR.ook QR.ook.bf && bf -c500000 QR.ook.bf > QR.gp
$ gp -f -q QR.gp > QR.p
$ parser3 QR.p > QR.pas
Expand Down Expand Up @@ -215,9 +214,9 @@ I used the following Ubuntu deb packages to test this program.
\# |language |ubuntu package |version
----|---------------------------|-----------------------------|---------------------------
1 |Ruby |ruby |1:2.5.1
2 |Rust |rustc |1.24.1+dfsg1+llvm-0ubuntu2
2 |Rust |rustc |1.25.0+dfsg1+llvm-0ubuntu1
3 |Scala |scala |2.11.12-2
4 |Scheme |guile-2.0 |2.0.13+1-5build2
4 |Scheme |guile-2.0 |2.0.13+1-5ubuntu0.1
5 |Scilab |scilab |6.0.1-1ubuntu1
6 |sed |sed |4.4-2
7 |Shakespeare |*N/A* |-
Expand Down Expand Up @@ -300,10 +299,10 @@ I used the following Ubuntu deb packages to test this program.
84 |Icon |icont, iconx |9.4.3-6ubuntu1
85 |INTERCAL |intercal |30:0.30-2
86 |Jasmin |jasmin-sable |2.5.0-2
87 |Java |openjdk-8-jdk |8u171-b11-0ubuntu0.18.04.1
88 |JavaScript |nodejs |8.10.0~dfsg-2
87 |Java |openjdk-8-jdk |8u181-b13-0ubuntu0.18.04.1
88 |JavaScript |nodejs |8.10.0~dfsg-2ubuntu0.2
89 |Jq |jq |1.5+dfsg-2
90 |JSFuck |nodejs |8.10.0~dfsg-2
90 |JSFuck |nodejs |8.10.0~dfsg-2ubuntu0.2
91 |ksh |ksh |93u+20120801-3.1ubuntu1
92 |Lazy K |*N/A* |-
93 |Lisaac |lisaac |1:0.39~rc1-3build1
Expand All @@ -327,8 +326,8 @@ I used the following Ubuntu deb packages to test this program.
111 |Ook! |*N/A* |-
112 |PARI/GP |pari-gp |2.9.4-1
113 |Parser 3 |parser3-cgi |3.4.5-2
114 |Pascal |fp-compiler |3.0.4+dfsg-18
115 |Perl 5 |perl |5.26.1-6ubuntu0.1
114 |Pascal |fp-compiler |3.0.4+dfsg-18ubuntu1
115 |Perl 5 |perl |5.26.1-6ubuntu0.2
116 |Perl 6 |rakudo |2018.03-1
117 |PHP |php-cli |1:7.2+60ubuntu1
118 |Piet |*N/A* |-
Expand Down
2 changes: 1 addition & 1 deletion SHA1SUMS
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ ad9baf8e05955b0664fe26b63fc44a559cca818e *QR.mzn
d3d6f48a2fb9a438bdbb78f698131daa1fdbc3ac *QR.m
e49170e9105ae1ec16888da63f47dddbc87f7032 *QR.ml
2f38f7b47c653f5a5d4912b8af95d12e0fa49a82 *QR.octave
19f4e5297e2b33948ec16f5b028763c43b834d99 *QR.ook
da39a3ee5e6b4b0d3255bfef95601890afd80709 *QR.ook
e86659b77ab96cdc6db67ec8fde2d12ddfcf7c7c *QR.gp
0f2937b85e2e887721eec91ae7fc299e23857740 *QR.p
56f333a8794e888581c9f83f0172d700343cf1e2 *QR.pas
Expand Down
16 changes: 14 additions & 2 deletions src/Makefile.gen.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,21 @@ def banner(s1, s2=nil, i=nil)
OUT << ""
OUT << "#{ s2.src }: #{ s1.src }"
banner(s1.name, s2.name, i)
OUT << "\t@mv #{ s1.backup } #{ s1.backup }.bak" if s1.backup
if s1.backup
if s1.backup.is_a?(String)
OUT << "\t@mv #{ s1.backup } #{ s1.backup }.bak"
else
OUT << "\t@#{ s1.backup[0] }"
end
end
cmd.split("&&").each {|c| OUT << "\t" + c.strip.gsub(/^!/, "ulimit -s unlimited && ") }
OUT << "\t@mv #{ s1.backup }.bak #{ s1.backup }" if s1.backup
if s1.backup
if s1.backup.is_a?(String)
OUT << "\t@mv #{ s1.backup }.bak #{ s1.backup }"
else
OUT << "\t@#{ s1.backup[1] }"
end
end
end

OUT << <<-END
Expand Down
6 changes: 5 additions & 1 deletion src/code-gen.rb
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,12 @@ class MiniZinc < CodeGen

class Maxima < CodeGen
File = "QR.mac"
Cmd = "mv /tmp /tmp.bak && ln -s /dev/shm /tmp && maxima -q --init-mac=QR.mac > OUTFILE && rm /tmp && mv /tmp.bak /tmp"
Cmd = "maxima -q --init-mac=QR.mac > OUTFILE"
Apt = "maxima"
Backup = [[
%(if [ $TRAVIS = "true" ]; then mv /tmp /tmp.bak && ln -s /dev/shm /tmp; fi),
%(if [ $TRAVIS = "true" ]; then rm /tmp && mv /tmp.bak /tmp; fi),
]]
Code = %q("linel:99999;print#{E[PREV]};quit();")
end

Expand Down

0 comments on commit d773c93

Please sign in to comment.