Skip to content

Commit

Permalink
Merge pull request tweag#122 from tweag/wip-err-stack
Browse files Browse the repository at this point in the history
Fallback to the node runner in `ahc-link --run`
  • Loading branch information
bollu committed May 16, 2019
2 parents b7cf63a + 19b2831 commit ed00d94
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 20 deletions.
22 changes: 3 additions & 19 deletions asterius/src/Asterius/Main.hs
Expand Up @@ -19,7 +19,6 @@ import Asterius.Internals.Temp
import Asterius.JSFFI
import Asterius.JSGen.Constants
import Asterius.JSGen.Wasm
import Asterius.JSRun.Main
import Asterius.Ld (rtsUsedSymbols)
import Asterius.Resolve
import Asterius.Types
Expand All @@ -44,7 +43,6 @@ import Data.Maybe
import qualified Data.Set as S
import Data.String
import Foreign
import Language.JavaScript.Inline.Core
import Language.WebAssembly.WireFormat
import qualified Language.WebAssembly.WireFormat as Wasm
import NPM.Parcel
Expand Down Expand Up @@ -465,23 +463,9 @@ ahcDistMain logger task@Task {..} (final_m, err_msgs, report) = do
[takeFileName out_js]
else do
logger $ "[INFO] Running " <> out_entry
case inputEntryMJS of
Just _ ->
callProcess "node" $
["--experimental-wasm-return-call" | tailCalls] <>
["--experimental-modules", takeFileName out_entry]
_ -> do
mod_buf <- LBS.readFile $ takeFileName out_wasm
withJSSession
defJSSessionOpts
{ nodeExtraArgs =
["--experimental-wasm-return-call" | tailCalls]
} $ \s -> do
i <- newAsteriusInstance s (takeFileName out_lib) mod_buf
hsInit s i
hsMain s i
wasm_stdout <- hsStdOut s i
LBS.putStr wasm_stdout
callProcess "node" $
["--experimental-wasm-return-call" | tailCalls] <>
["--experimental-modules", takeFileName out_entry]

ahcLinkMain :: Task -> IO ()
ahcLinkMain task = do
Expand Down

0 comments on commit ed00d94

Please sign in to comment.