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
2 changes: 1 addition & 1 deletion .github/workflows/cabal-fmt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ jobs:
hackage-index-state: "2026-02-19T00:00:00Z"

- name: 🎗️ Lint with cabal-fmt
run: ./scripts/ci/format-cabal-fmt.sh && git diff --exit-code
run: ./scripts/ci/run-cabal-fmt.sh && git diff --exit-code
2 changes: 1 addition & 1 deletion .github/workflows/stylish-haskell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ jobs:
hackage-index-state: "2026-02-19T00:00:00Z"

- name: 🎗️ Lint with stylish-haskell
run: ./scripts/ci/format-stylish-haskell.sh && git diff --exit-code
run: ./scripts/ci/run-stylish-haskell.sh && git diff --exit-code
29 changes: 3 additions & 26 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ file](./.stylish-haskell.yaml).
To perform a pre-commit code formatting pass, run one of the following:

```
./scripts/ci/format-cabal-fmt.sh
./scripts/ci/format-stylish-haskell.sh
./scripts/ci/run-cabal-fmt.sh
./scripts/ci/run-stylish-haskell.sh
```

## Pull requests
Expand All @@ -37,27 +37,4 @@ The following are requirements for merging a PR into `main`:

## Releases

Releases follow the [Haskell Package Versioning
Policy](https://pvp.haskell.org/). We use version numbers consisting of 3 parts,
like `A.B.C`.
* `A.B` is the *major* version number. A bump indicates a breaking change.
* `C` is the *minor* version number. A bump indicates a non-breaking change.

To publish a release for a package, follow the steps below:

* Changelog checks (`CHANGELOG.md`):
* Check that all user-facing changes have been recorded.
* Check that each changelog entry is in the correct category.
* Check that each changelog entry links to a PR, if applicable.
* Add or update the changelog's section header with the package version that
is going to be released, and the date of the release. The version should be
picked based on our package versioning policy.

* Cabal file checks (`*.cabal`):
* Update the `version` field.
* Update the `tag` field of the `source-repository this` stanza.

* Cabal project file checks (`cabal.project*`):
* Update the `index-state` in the `cabal.project` file to the current
date-time, or the closest valid date-time to the current date-time, so that
CI builds and tests the libraries with the newest versions of dependencies.
To publish a release, follow [the release process](./dev/release-process.md).
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2024-2025, Well-Typed LLP and Anduril Industries Inc.
Copyright (c) 2024-2026, Well-Typed LLP and Anduril Industries Inc.


Redistribution and use in source and binary forms, with or without
Expand Down
16 changes: 7 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
# `libclang-bindings`

[![Build Status](https://github.com/well-typed/libclang-bindings/actions/workflows/haskell.yml/badge.svg)](https://github.com/well-typed/libclang-bindings/actions)
[![License: BSD-3-Clause](https://img.shields.io/badge/license-BSD--3--Clause-lightgray.svg)](https://github.com/well-typed/hs-bindgen/blob/main/hs-bindgen/LICENSE)
[![License: BSD-3-Clause](https://img.shields.io/badge/license-BSD--3--Clause-lightgray.svg)](https://github.com/well-typed/libclang-bindings/blob/main/LICENSE)

`libclang-bindings` is a [Haskell][] library that provides bindings for the
[LLVM/Clang][] `libclang` C API. It supports the [`hs-bindgen`][] project but
[LLVM/Clang][] `libclang` C API. It supports the [`hs-bindgen`][] project but
can be used independently.

> [!WARNING]
> This project has not had an official release yet. There is a wide variety of
> C (and C preprocessor) code in the world, so we are currently soliciting
> feedback prior to the first official release of [`hs-bindgen`][]. Please try
> it out! If something breaks, please check the [issues][] to see if the
> problem is already known, and open an issue if not.
> [!NOTE]
> This is an early release. C (and C preprocessor) code varies widely, so we
> welcome feedback. If something breaks, please check the [issues][] to see if
> it is already known, and open an issue if not.

[Haskell]: https://www.haskell.org/
[issues]: https://github.com/well-typed/libclang-bindings/issues
Expand All @@ -34,7 +32,7 @@ can be used independently.
## Contribution

Our thanks go to those who have contributed to this project with development,
bug reports, feature requests, blog posts, etc. We list
bug reports, feature requests, blog posts, etc. We list
[contributors](https://github.com/well-typed/hs-bindgen#contributors)
in the `hs-bindgen` README.

Expand Down
2 changes: 1 addition & 1 deletion cabal.project
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
index-state: 2026-02-19T00:00:00Z
index-state: 2026-07-14T08:02:36Z

packages:
libclang-bindings
Expand Down
16 changes: 16 additions & 0 deletions dev/release-notes-0.1.0.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## libclang-bindings 0.1.0.0

First non-alpha release of Haskell bindings to the LLVM/Clang `libclang` C API.

### Breaking changes
- Removed the `LLVM_CONFIG` configure variable — set `PATH` so the desired `llvm-config` is found instead.

### New features
- New `Clang.Discover` module with `getPaths` to locate the `clang` executable and builtin include directory.
- Compile-time `CLANG_VERSION` check to catch version mismatches (see `Clang.Version`).
- New `--with-so` configure option to work around Cabal linking issues on Linux.
- `foldTry` (and the `FoldException` type) returning a caught exception as a value, like `Control.Exception.try` (#47).
- New bindings: `clang_isBeforeInTranslationUnit` (Clang 20.1+, #53), `clang_Type_getOffsetOf` (#37), and `clang_disposeToken` (#42).

### Bug fixes
- Silence `-Wdeprecated-declarations` from `<clang-c/Index.h>` on Clang 21 at the system-header include sites, so deprecation warnings for APIs we call stay visible (#58).
43 changes: 31 additions & 12 deletions dev/release-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,38 @@

## Prerequisites

* [ ] Decide on new version number (`MAJOR.MINOR.PATCH`)
* Tag name: `release-${VERSION}`
* [ ] Changelog checks (`CHANGELOG.md`):
* Check that all user-facing changes have been recorded.
* Check that each changelog entry is in the correct category.
* Check that each changelog entry links to a PR, if applicable.
* Add or update the changelog's section header with the package version that
is going to be released, and the date of the release. The version should be
picked based on our package versioning policy.

* [ ] Cabal project file checks (`cabal.project*`):
* Update the `index-state` in the `cabal.project` file to the current
date-time, or the closest valid date-time to the current date-time, so that
CI builds and tests the libraries with the newest versions of dependencies.

* [ ] Decide on new version number (`MAJOR.MAJOR.MINOR.PATCH`): Releases follow
the [Haskell Package Versioning Policy](https://pvp.haskell.org/). We use
version numbers consisting of 3 parts, like `A.B.C.D`.
* `A.B` is the *major* version number. A bump indicates a breaking change.
* `C` is the *minor* version number. A bump indicates a non-breaking change.
* `D` is the *patch* version number. A bump indicating small changes or minor
fixes not affecting users directly.

* Tag name: `release-${VERSION}`

## Preparation

* [ ] Set the version in `libclang-bindings.cabal`

* [ ] Set the `source-repository this` tag in `libclang-bindings.cabal`

* [ ] Set the version in `configure.ac`
* [ ] Set the version in `libclang-bindings/configure.ac`

* [ ] Set the version in `libclang-bootstrap.cabal`

* [ ] Reconfigure

Expand All @@ -27,11 +49,7 @@

## GitHub

* [ ] Push `main`

```
$ git push origin main
```
* [ ] Ensure the changes above land on `main`

* [ ] Tag the release

Expand All @@ -45,7 +63,7 @@
$ git push origin "${TAG}"
```

* [ ] [Create a new release](https://github.com/well-typed/libclang/releases/new)
* [ ] [Create a new GitHub release](https://github.com/well-typed/libclang-bindings/releases/new)
* [ ] Select tag
* [ ] Target: `main`
* [ ] Release title: `Release ${VERSION}`
Expand All @@ -54,15 +72,16 @@

## Hackage

* [ ] Run `cabal check`

TBD

## Preparation for next release

* [ ] Update the `CHANGELOG`
* [ ] Add new section at top
* [ ] Update the `CHANGELOG`, adding a new section at top

```markdown
## ?.?.? -- YYYY-mm-dd
## ?.?.?.? -- YYYY-mm-dd

### Breaking changes

Expand Down
14 changes: 12 additions & 2 deletions libclang-bindings/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
# Revision history for libclang-bindings

## ?.?.? -- YYYY-mm-dd
## ?.?.?.? -- YYYY-mm-dd

### Breaking changes

* Removed `LLVM_CONFIG` configuration variable. Configure `PATH` so that the
### New features

### Minor changes

### Bug fixes

## 0.1.0.0 -- 2026-07-14

### Breaking changes

* Removed `LLVM_CONFIG` configuration variable. Configure `PATH` so that the
desired `llvm-config` is found instead.

### New features
Expand Down
2 changes: 1 addition & 1 deletion libclang-bindings/LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2024-2025, Well-Typed LLP and Anduril Industries Inc.
Copyright (c) 2024-2026, Well-Typed LLP and Anduril Industries Inc.


Redistribution and use in source and binary forms, with or without
Expand Down
7 changes: 4 additions & 3 deletions libclang-bindings/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# `libclang-bindings`

`libclang-bindings` is a [Haskell][] library that provides bindings for the
[LLVM/Clang][] `libclang` C API. It supports the [`hs-bindgen`][] project but
[LLVM/Clang][] `libclang` C API. It supports the [`hs-bindgen`][] project but
can be used independently.

See the [repository README][] for the manual and other information.
`libclang-bindings` requires an LLVM/Clang installation and some build
configuration; see the [manual][] before use.

[Haskell]: <https://www.haskell.org/>
[`hs-bindgen`]: <https://github.com/well-typed/hs-bindgen>
[LLVM/Clang]: <https://github.com/llvm/llvm-project>
[repository README]: <https://github.com/well-typed/libclang-bindings#libclang-bindings>
[manual]: <https://github.com/well-typed/libclang-bindings/blob/main/manual/README.md>
4 changes: 2 additions & 2 deletions libclang-bindings/autogen/clang_config.h.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* autogen/clang_config.h.in. Generated from configure.ac by autoheader. */

/* Define to 1 if you have the `clang_isBeforeInTranslationUnit' function. */
/* Define to 1 if you have the 'clang_isBeforeInTranslationUnit' function. */
#undef HAVE_CLANG_ISBEFOREINTRANSLATIONUNIT

/* Define to 1 if you have the <inttypes.h> header file. */
Expand Down Expand Up @@ -48,7 +48,7 @@
/* Define to the version of this package. */
#undef PACKAGE_VERSION

/* Define to 1 if all of the C90 standard headers exist (not just the ones
/* Define to 1 if all of the C89 standard headers exist (not just the ones
required in a freestanding environment). This macro is provided for
backward compatibility; new code need not use it. */
#undef STDC_HEADERS
Loading
Loading