Skip to content

Commit

Permalink
Update build / release / install scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdone committed Aug 6, 2024
1 parent fed4da8 commit 3b79fc3
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.stack-work
result
dist-newstyle
hell
hell-linux-x86-64bit
7 changes: 4 additions & 3 deletions install.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
Bootstrap (do this once):

$ stack build
$ cp .stack-work/dist/x86_64-linux/ghc-9.4.8/build/hell/hell ./hell
$ cp .stack-work/dist/x86_64-linux/ghc-9.4.8/build/hell/hell ./hell-linux-x86-64bit
$ sudo ./hell-linux-x86-64bit scripts/install-hell.hell

Build static binary (do from docker image):

./hell scripts/static-build.hell
hell scripts/static-build.hell

Install static binary to /usr/bin/ (do from host OS):

sudo ./hell scripts/install-hell.hell
sudo ./hell-linux-x86-64bit scripts/install-hell.hell
2 changes: 1 addition & 1 deletion scripts/install-hell.hell
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
main = do
Directory.copyFile "hell" "/usr/bin/hell"
Directory.copyFile "hell-linux-x86-64bit" "/usr/bin/hell"
9 changes: 9 additions & 0 deletions scripts/static-build.hell
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,12 @@ main = do
Process.runProcess_ (Process.proc "docker" ["exec", "hell", "stack", "build","--ghc-options", "-static -optl-static -fforce-recomp", "--force-dirty"])
Directory.renameFile ".stack-work/dist/x86_64-linux/ghc-9.4.8/build/hell/hell" "hell-linux-x86-64bit"
Process.runProcess_ (Process.proc "strip" ["hell-linux-x86-64bit"])
examples <- Directory.listDirectory "examples/"
let check = \fp -> do
Text.putStrLn $ Text.concat ["Checking ", fp]
Process.runProcess_ (Process.proc "./hell-linux-x86-64bit" ["--check", fp])
Monad.forM_ examples \example -> do
check $ Text.concat ["examples/", example]
check "scripts/static-build.hell"
check "scripts/install-hell.hell"
Text.putStrLn "All OK."

0 comments on commit 3b79fc3

Please sign in to comment.