Skip to content
Merged
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
14 changes: 11 additions & 3 deletions .github/workflows/wasm.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: Compile WASM

on: [push, pull_request, workflow_dispatch]
on:
push:
branches: [master, ci-*, ci]
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
pull_request:
branches: [master]

env:
GHC_WASM_META_FLAVOUR: '9.10'
Expand Down Expand Up @@ -74,9 +80,11 @@ jobs:
echo ">>> Install alex and happy"
~/.ghc-wasm/cabal/bin/cabal install alex-3.5.0.0 happy-1.20.1.1

- name: Run cabal configure
- name: Cabal configure
working-directory: './als'
run: wasm32-wasi-cabal configure --flag=Agda-2-7-0-1
run: |
mv cabal.project.wasm32 cabal.project
wasm32-wasi-cabal configure --flag=Agda-2-7-0-1

- name: 'Build dep: lsp-types'
uses: nick-fields/retry@v3
Expand Down
4 changes: 2 additions & 2 deletions BUILDING_WASM.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

1. Setup a working ghc (tested with v9.10) with WASM backend and wasm32-wasi-cabal.
2. `cd` into `wasm-submodules/network` and run `autoreconf -i`.
3. In the project root, run `wasm32-wasi-cabal build`.
3. In the project root, run `cp cabal.project{.wasm32,}`, and then `wasm32-wasi-cabal build`.

The process might output the following:

Expand All @@ -24,4 +24,4 @@ Node.js v22.14.0
At this moment, you should terminate the process and run it again.
This is a known issue ([ghc#26106](https://gitlab.haskell.org/ghc/ghc/-/issues/26106)). If this does *not* occur to you or you can fix it, please report to that issue.

If everything works properly, it should build a `als.wasm`.
If everything works properly, it should build a binary `als.wasm`.
6 changes: 6 additions & 0 deletions agda-language-server.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ library
PatternSynonyms
TypeOperators
ghc-options: -Wincomplete-patterns -Wunused-do-bind -Wunused-foralls -Wwarnings-deprecations -Wwrong-do-bind -Wmissing-fields -Wmissing-methods -Wmissing-pattern-synonym-signatures -Wmissing-signatures -Werror=incomplete-patterns -fno-warn-orphans
if !arch(wasm32)
ghc-options: -threaded -with-rtsopts=-N
build-depends:
Agda
, aeson
Expand Down Expand Up @@ -126,6 +128,8 @@ executable als
PatternSynonyms
TypeOperators
ghc-options: -Wincomplete-patterns -Wunused-do-bind -Wunused-foralls -Wwarnings-deprecations -Wwrong-do-bind -Wmissing-fields -Wmissing-methods -Wmissing-pattern-synonym-signatures -Wmissing-signatures -rtsopts -Werror=incomplete-patterns -fno-warn-orphans
if !arch(wasm32)
ghc-options: -threaded -with-rtsopts=-N
build-depends:
Agda
, aeson
Expand Down Expand Up @@ -197,6 +201,8 @@ test-suite als-test
PatternSynonyms
TypeOperators
ghc-options: -Wincomplete-patterns -Wunused-do-bind -Wunused-foralls -Wwarnings-deprecations -Wwrong-do-bind -Wmissing-fields -Wmissing-methods -Wmissing-pattern-synonym-signatures -Wmissing-signatures -rtsopts -Werror=incomplete-patterns -fno-warn-orphans
if !arch(wasm32)
ghc-options: -threaded -with-rtsopts=-N
build-depends:
Agda
, aeson
Expand Down
2 changes: 2 additions & 0 deletions cabal.project → cabal.project.wasm32
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ packages:
wasm-submodules/network-simple-0.4.2
wasm-submodules/lsp/lsp-types

package Agda
flags: +optimise-heavily
2 changes: 1 addition & 1 deletion src/Options.hs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ versionNumber = 5
versionString :: String
versionString =
#ifdef wasm32_HOST_ARCH
"Agda v2.7.0.1 Language Server (WebAssembly build) v" <> show versionNumber
"Agda v2.7.0.1 Language Server v" <> show versionNumber <> " (WebAssembly build)"
#elif MIN_VERSION_Agda(2,7,0)
"Agda v2.7.0.1 Language Server v" <> show versionNumber
#elif MIN_VERSION_Agda(2,6,4)
Expand Down
4 changes: 2 additions & 2 deletions src/Server.hs
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ run options = do
-- Switchboard.destroy switchboard
return 0
Nothing -> do
#if defined(wasm32_HOST_ARCH)
#if defined(wasm32_HOST_ARCH)
liftIO $ setFdOption stdInput NonBlockingRead True
`catchIO` (\ e -> hPutStrLn stderr $ "Failed to enable nonblocking on stdin: " ++ (show e) ++ "\nThe WASM module might not behave correctly.")
#endif
#endif
runServer (serverDefn options)
where
serverDefn :: Options -> ServerDefinition Config
Expand Down
Loading