Skip to content
This repository was archived by the owner on Nov 13, 2024. It is now read-only.

Commit 4b8a70d

Browse files
authored
Support binaryen version_96 (#13)
1 parent 72805af commit 4b8a70d

File tree

6 files changed

+52
-23
lines changed

6 files changed

+52
-23
lines changed

.github/workflows/pipeline.yml

Lines changed: 41 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,35 +11,54 @@ jobs:
1111
runs-on: ubuntu-20.04
1212
steps:
1313

14-
- uses: cachix/install-nix-action@v10
14+
- name: setup-haskell
15+
uses: actions/setup-haskell@main
1516
with:
16-
skip_adding_nixpkgs_channel: true
17+
stack-version: 2.3.3
18+
enable-stack: true
19+
stack-no-global: true
20+
21+
- name: setup-binaryen
22+
run: |
23+
curl \
24+
-o /tmp/binaryen.deb \
25+
http://deb.debian.org/debian/pool/main/b/binaryen/binaryen_96-1_amd64.deb
26+
sudo dpkg -i /tmp/binaryen.deb
27+
rm /tmp/binaryen.deb
1728
1829
- name: checkout
1930
uses: actions/checkout@v2
2031

2132
- name: build
2233
run: |
23-
mkdir ~/.stack
24-
printf "nix:\n enable: true\n" > ~/.stack/config.yaml
25-
26-
nix-shell --pure --run "stack test"
34+
stack test
2735
2836
sdist:
2937
name: sdist
3038
runs-on: ubuntu-20.04
3139
steps:
3240

33-
- uses: cachix/install-nix-action@v10
41+
- name: setup-haskell
42+
uses: actions/setup-haskell@main
3443
with:
35-
skip_adding_nixpkgs_channel: true
44+
ghc-version: 8.10.2
45+
cabal-version: 3.2.0.0
46+
47+
- name: setup-binaryen
48+
run: |
49+
curl \
50+
-o /tmp/binaryen.deb \
51+
http://deb.debian.org/debian/pool/main/b/binaryen/binaryen_96-1_amd64.deb
52+
sudo dpkg -i /tmp/binaryen.deb
53+
rm /tmp/binaryen.deb
3654
3755
- name: checkout
3856
uses: actions/checkout@v2
3957

4058
- name: sdist
4159
run: |
42-
nix-shell --pure --run "cabal check && cabal v2-sdist all"
60+
cabal check
61+
cabal v2-sdist all
4362
4463
- name: upload-artifact
4564
uses: actions/upload-artifact@v2
@@ -52,16 +71,26 @@ jobs:
5271
runs-on: ubuntu-20.04
5372
steps:
5473

55-
- uses: cachix/install-nix-action@v10
74+
- name: setup-haskell
75+
uses: actions/setup-haskell@main
5676
with:
57-
skip_adding_nixpkgs_channel: true
77+
ghc-version: 8.10.2
78+
cabal-version: 3.2.0.0
79+
80+
- name: setup-binaryen
81+
run: |
82+
curl \
83+
-o /tmp/binaryen.deb \
84+
http://deb.debian.org/debian/pool/main/b/binaryen/binaryen_96-1_amd64.deb
85+
sudo dpkg -i /tmp/binaryen.deb
86+
rm /tmp/binaryen.deb
5887
5988
- name: checkout
6089
uses: actions/checkout@v2
6190

6291
- name: haddock
6392
run: |
64-
nix-shell --pure --run "cabal v2-haddock --haddock-for-hackage --haddock-hyperlink-source --haddock-quickjump all"
93+
cabal v2-haddock --haddock-for-hackage --haddock-hyperlink-source --haddock-quickjump all
6594
6695
- name: upload-artifact
6796
uses: actions/upload-artifact@v2

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ it's no less than the minimum version listed below.
1818
| Haskell bindings version | Minimum Binaryen version |
1919
|--------------------------|--------------------------|
2020
| 0.0.1.* | version_91 |
21-
|--------------------------|--------------------------|
2221
| 0.0.2.* | version_94 |
22+
| 0.0.3.* | version_96 |
2323

2424

2525
## How to build

binaryen.cabal

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ cabal-version: 1.12
44
--
55
-- see: https://github.com/sol/hpack
66
--
7-
-- hash: f6057bbdb94c86826246804c0ebc4e4201ba42f10aef683bb852f11dfd961045
7+
-- hash: c6dda58fc71ff980baacba8cebb211dfae6ba9a6099d849dd9f830555bb86cf2
88

99
name: binaryen
10-
version: 0.0.2.0
10+
version: 0.0.3.0
1111
synopsis: Haskell bindings to binaryen
1212
description: Haskell bindings to [binaryen](https://github.com/WebAssembly/binaryen). Provides complete bindings to the C API, which can be useful for building WebAssembly toolchains in Haskell.
1313
category: Compiler

package.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: binaryen
2-
version: 0.0.2.0
2+
version: 0.0.3.0
33
synopsis: Haskell bindings to binaryen
44
description: Haskell bindings to [binaryen](https://github.com/WebAssembly/binaryen). Provides complete bindings to the C API, which can be useful for building WebAssembly toolchains in Haskell.
55
category: Compiler

src/Binaryen/Expression.hs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ foreign import ccall unsafe "BinaryenBlockGetNumChildren"
449449
blockGetNumChildren ::
450450
Expression -> IO Index
451451

452-
foreign import ccall unsafe "BinaryenBlockGetChild"
452+
foreign import ccall unsafe "BinaryenBlockGetChildAt"
453453
blockGetChild ::
454454
Expression -> Index -> IO Expression
455455

@@ -489,7 +489,7 @@ foreign import ccall unsafe "BinaryenSwitchGetNumNames"
489489
switchGetNumNames ::
490490
Expression -> IO Index
491491

492-
foreign import ccall unsafe "BinaryenSwitchGetName"
492+
foreign import ccall unsafe "BinaryenSwitchGetNameAt"
493493
switchGetName ::
494494
Expression -> Index -> IO (Ptr CChar)
495495

@@ -513,7 +513,7 @@ foreign import ccall unsafe "BinaryenCallGetNumOperands"
513513
callGetNumOperands ::
514514
Expression -> IO Index
515515

516-
foreign import ccall unsafe "BinaryenCallGetOperand"
516+
foreign import ccall unsafe "BinaryenCallGetOperandAt"
517517
callGetOperand ::
518518
Expression -> Index -> IO Expression
519519

@@ -525,7 +525,7 @@ foreign import ccall unsafe "BinaryenCallIndirectGetNumOperands"
525525
callIndirectGetNumOperands ::
526526
Expression -> IO Index
527527

528-
foreign import ccall unsafe "BinaryenCallIndirectGetOperand"
528+
foreign import ccall unsafe "BinaryenCallIndirectGetOperandAt"
529529
callIndirectGetOperand ::
530530
Expression -> Index -> IO Expression
531531

@@ -569,7 +569,7 @@ foreign import ccall unsafe "BinaryenHostGetNumOperands"
569569
hostGetNumOperands ::
570570
Expression -> IO Index
571571

572-
foreign import ccall unsafe "BinaryenHostGetOperand"
572+
foreign import ccall unsafe "BinaryenHostGetOperandAt"
573573
hostGetOperand ::
574574
Expression -> Index -> IO Expression
575575

@@ -905,7 +905,7 @@ foreign import ccall unsafe "BinaryenThrowGetEvent"
905905
throwGetEvent ::
906906
Expression -> IO (Ptr CChar)
907907

908-
foreign import ccall unsafe "BinaryenThrowGetOperand"
908+
foreign import ccall unsafe "BinaryenThrowGetOperandAt"
909909
throwGetOperand ::
910910
Expression -> Index -> IO Expression
911911

stack.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
resolver: lts-16.4
1+
resolver: lts-16.10
22

33
nix:
44
path: [nixpkgs=./nixpkgs.nix]

0 commit comments

Comments
 (0)