Bump hs-bindgen for record-dot support

This commit is contained in:
George Thomas 2026-02-23 11:22:11 +00:00
parent a018cc389a
commit 718554cb2e
4 changed files with 10 additions and 8 deletions

View File

@ -1,19 +1,19 @@
packages: . packages: .
-- https://well-typed.com/blog/2026/02/hs-bindgen-alpha -- not on Hackage yet: https://well-typed.com/blog/2026/02/hs-bindgen-alpha
-- Haskell.nix doesn't seem to like `tag: release-0.1-alpha`, which the blog post suggests -- we've modified the stanzas from that post in order to use a more recent version
-- so we specify the equivalent commit SHAs manually instead -- because we want record-dot support: https://github.com/well-typed/hs-bindgen/issues/1829#issuecomment-4081875451
source-repository-package source-repository-package
type: git type: git
location: https://github.com/well-typed/hs-bindgen location: https://github.com/well-typed/hs-bindgen
tag: e2a9260678d9fa76dab602a5a07927acada3be4f tag: 6ca94188abd756a1fb4dd8a4037de3fa7dca0765
subdir: c-expr-dsl c-expr-runtime hs-bindgen hs-bindgen-runtime subdir: c-expr-dsl c-expr-runtime hs-bindgen hs-bindgen-runtime
--sha256: 0nrs3iq0l5ha5kxyhqnlmvgi7734pmzyp3zf7p8s1gb21ylh4sy0 --sha256: M+8tEZA8gsEc6gXnNdSbRpMBQ5LkH7sphcV1aR0fclA=
source-repository-package source-repository-package
type: git type: git
location: https://github.com/well-typed/libclang location: https://github.com/well-typed/libclang
tag: b5ff712c91c039cde6720ffe2096a121d9f4d802 tag: d6e482df49b88375cf3075928a78ee86c2a068d4
--sha256: 1lwjdxd2ahhkvyxrpli7z9z7ss4l94m2jaif8kg1i2yygbhksrb3 --sha256: 175kjba915bh50wf03gi88njz03jp0n3wp7yq73hznkaly6bpwal
allow-newer: allow-newer:
*:base, *:base,

View File

@ -54,6 +54,7 @@
bacon bacon
ghcid ghcid
llvmPackages.libclang llvmPackages.libclang
llvmPackages.llvm
rust-analyzer rust-analyzer
rust-cbindgen rust-cbindgen
]; ];

View File

@ -41,6 +41,7 @@ do
withHsBindgen withHsBindgen
def def
{ clang = def{extraIncludeDirs = Pkg "rust/target/debug" : systemDirs} { clang = def{extraIncludeDirs = Pkg "rust/target/debug" : systemDirs}
, fieldNamingStrategy = EnableRecordDot
} }
def def
$ hashInclude "garnet_rs.h" $ hashInclude "garnet_rs.h"

View File

@ -27,7 +27,7 @@ data T = T
, b :: Word8 , b :: Word8
} }
convertT :: T -> Raw.T convertT :: T -> Raw.T
convertT T{a, b} = Raw.T{t_a = fromBool a, t_b = b} convertT T{a, b} = Raw.T{a = fromBool a, b}
data Shape data Shape
= Circle CDouble = Circle CDouble