Skip to content
This repository has been archived by the owner on Nov 24, 2022. It is now read-only.

Fix darwin support and test it on CI #399

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,93 @@ jobs:
netlify deploy --dir=_build --message="$CIRCLE_SHA1"
fi
asterius-darwin:
macos:
xcode: "11.5.0"
steps:
- run:
name: Install dependencies
command: |
mkdir -p ~/.local/bin
export PATH=~/.local/bin:$PATH
brew install \
binaryen
curl -L https://github.com/commercialhaskell/stack/releases/download/v2.3.1/stack-2.3.1-osx-x86_64-bin -o ~/.local/bin/stack
chmod +x ~/.local/bin/stack
stack --no-terminal update
- checkout
- run:
name: Boot
command: |
export PATH=~/.local/bin:$PATH
stack --no-terminal -j4 build --test --no-run-tests
export ASTERIUS_CONFIGURE_OPTIONS=-v3
. .envrc
ahc-boot
- run:
name: Test asterius
command: |
export PATH=~/.local/bin:$PATH
stack --no-terminal test asterius:fib
stack --no-terminal test asterius:jsffi
stack --no-terminal test asterius:array
stack --no-terminal test asterius:stableptr
stack --no-terminal test asterius:rtsapi
stack --no-terminal test asterius:teletype
stack --no-terminal test asterius:bytearray
stack --no-terminal test asterius:bigint
stack --no-terminal test asterius:todomvc
stack --no-terminal test asterius:cloudflare
stack --no-terminal test asterius:exception
stack --no-terminal test asterius:regression60
stack --no-terminal test asterius:sizeof_md5context
stack --no-terminal test asterius:largenum
stack --no-terminal test asterius:fib --test-arguments="--backend=wasm-toolkit"
stack --no-terminal test asterius:jsffi --test-arguments="--backend=wasm-toolkit"
stack --no-terminal test asterius:array --test-arguments="--backend=wasm-toolkit"
stack --no-terminal test asterius:stableptr --test-arguments="--backend=wasm-toolkit"
stack --no-terminal test asterius:rtsapi --test-arguments="--backend=wasm-toolkit"
stack --no-terminal test asterius:teletype --test-arguments="--backend=wasm-toolkit"
stack --no-terminal test asterius:bytearray --test-arguments="--backend=wasm-toolkit"
stack --no-terminal test asterius:bigint --test-arguments="--backend=wasm-toolkit"
stack --no-terminal test asterius:todomvc --test-arguments="--backend=wasm-toolkit"
stack --no-terminal test asterius:cloudflare --test-arguments="--backend=wasm-toolkit"
stack --no-terminal test asterius:exception --test-arguments="--backend=wasm-toolkit"
stack --no-terminal test asterius:regression60 --test-arguments="--backend=wasm-toolkit"
stack --no-terminal test asterius:sizeof_md5context --test-arguments="--backend=wasm-toolkit"
stack --no-terminal test asterius:largenum --test-arguments="--backend=wasm-toolkit"
stack --no-terminal test asterius:bytearray --test-arguments="--yolo"
stack --no-terminal test asterius:bytearray --test-arguments="--gc-threshold=128"
stack --no-terminal test asterius:fib --test-arguments="--no-gc-sections"
stack --no-terminal test asterius:fib --test-arguments="--debug" > /dev/null
stack --no-terminal test asterius:jsffi --test-arguments="--debug" > /dev/null
stack --no-terminal test asterius:array --test-arguments="--debug" > /dev/null
stack --no-terminal test asterius:stableptr --test-arguments="--debug" > /dev/null
stack --no-terminal test asterius:rtsapi --test-arguments="--debug" > /dev/null
stack --no-terminal test asterius:teletype --test-arguments="--debug" > /dev/null
# stack --no-terminal test asterius:bytearray --test-arguments="--debug" > /dev/null
stack --no-terminal test asterius:bigint --test-arguments="--debug" > /dev/null
stack --no-terminal test asterius:exception --test-arguments="--debug" > /dev/null
stack --no-terminal test asterius:fib --test-arguments="--tail-calls"
stack --no-terminal test asterius:fib --test-arguments="--tail-calls --no-gc-sections"
stack --no-terminal test asterius:nomain
stack --no-terminal test asterius:nomain --test-arguments="--tail-calls"
stack --no-terminal test asterius:th
stack --no-terminal test asterius:primitive
workflows:
version: 2
build:
jobs:
- asterius-build-docs
- asterius-darwin
12 changes: 4 additions & 8 deletions asterius/src/Asterius/Boot.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module Asterius.Boot
)
where

import Ar
import Asterius.Binary.File
import Asterius.BuildInfo
import Asterius.Builtins
Expand All @@ -23,6 +24,7 @@ import Control.Monad
import Control.Monad.IO.Class
import Data.IORef
import Data.Maybe
import Data.Traversable
import qualified DynFlags as GHC
import qualified GHC
import Language.Haskell.GHC.Toolkit.BuildInfo
Expand Down Expand Up @@ -143,14 +145,8 @@ bootRTSCmm BootArgs {..} =
)
liftIO $ do
obj_paths <- readIORef obj_paths_ref
tmpdir <- getTemporaryDirectory
(rsp_path, rsp_h) <- openTempFile tmpdir "ar.rsp"
hPutStr rsp_h $ unlines obj_paths
hClose rsp_h
callProcess
"ar"
["-r", "-c", obj_topdir </> "rts" </> "libHSrts.a", '@' : rsp_path]
removeFile rsp_path
ar <- Archive <$> for obj_paths loadObj
writeGNUAr (obj_topdir </> "rts" </> "libHSrts.a") ar
where
rts_path = bootLibsPath </> "rts"
obj_topdir = bootDir </> "asterius_lib"
Expand Down