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
52 changes: 52 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: CI

on:
push:
branches:
- master
pull_request:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: GHC ${{ matrix.ghc }}
runs-on: ubuntu-26.04
strategy:
fail-fast: false
matrix:
ghc:
- '9.10.3'
- '9.12.4'
- '9.14.1'
steps:
- uses: actions/checkout@v7

- uses: haskell-actions/setup@v2
id: setup
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: '3.16.1.0'

- name: Configure the project
run: |
cat >> cabal.project.local <<EOF
semaphore: True
jobs: 4

package ghc-tags
ghc-options: -Werror
EOF

- name: Cache the cabal store
uses: actions/cache@v6
with:
path: ${{ steps.setup.outputs.cabal-store }}
key: ${{ runner.os }}-ghc-${{ matrix.ghc }}-${{ hashFiles('ghc-tags.cabal', 'cabal.project') }}
restore-keys: ${{ runner.os }}-ghc-${{ matrix.ghc }}-

- name: Build ghc-tags and generate tags for this repository
run: ./scripts/check-tags.sh
213 changes: 0 additions & 213 deletions .github/workflows/haskell-ci.yml

This file was deleted.

6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# ghc-tags-1.11 (2026-??-??)
* Add support for GHC 9.14 and drop support for GHC 9.8.
* Drop the `ghc-lib` dependency and the `ghc-lib` flag. The parser now comes
from the `ghc` library of the compiler that builds `ghc-tags`. The supported
syntax is the syntax of that compiler.

# ghc-tags-1.10 (2025-11-19)
* Add support for GHC 9.12 and drop support for GHC 9.6.

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ghc-tags

[![Build Status](https://github.com/arybczak/ghc-tags/workflows/Haskell-CI/badge.svg?branch=master)](https://github.com/arybczak/ghc-tags/actions?query=branch%3Amaster)
[![Build Status](https://github.com/arybczak/ghc-tags/workflows/CI/badge.svg?branch=master)](https://github.com/arybczak/ghc-tags/actions?query=branch%3Amaster)
[![Hackage](https://img.shields.io/hackage/v/ghc-tags.svg)](https://hackage.haskell.org/package/ghc-tags)

A command line tool that generates etags
Expand Down
6 changes: 0 additions & 6 deletions cabal.haskell-ci

This file was deleted.

20 changes: 6 additions & 14 deletions ghc-tags.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 3.0
name: ghc-tags
version: 1.10
version: 1.11
synopsis: Utility for generating ctags and etags with GHC API.
description: Utility for generating etags (Emacs) and ctags (Vim and other
editors) with GHC API for efficient project navigation.
Expand All @@ -14,26 +14,16 @@ extra-source-files: CHANGELOG.md
README.md
homepage: https://github.com/arybczak/ghc-tags
bug-reports: https://github.com/arybczak/ghc-tags/issues
tested-with: GHC == { 9.8.4, 9.10.3, 9.12.2 }
tested-with: GHC == { 9.10.3, 9.12.4, 9.14.1 }

source-repository head
type: git
location: https://github.com/arybczak/ghc-tags

flag ghc-lib
default: False
manual: True
description: Use ghc-lib even when compiling with compatible GHC version.

executable ghc-tags
ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-A4m

if !flag(ghc-lib) && impl(ghc == 9.12.*)
build-depends: ghc, ghc-boot
else
build-depends: ghc-lib == 9.12.*
ghc-options: -Wall -Wunused-packages -threaded -rtsopts -with-rtsopts=-A4m

build-depends: base >=4.19 && <4.22
build-depends: base >=4.20 && <4.23
, aeson >= 2.0.0.0
, async >= 2.2.5
, attoparsec
Expand All @@ -42,6 +32,8 @@ executable ghc-tags
, deepseq
, directory
, filepath
, ghc >= 9.10 && < 9.15
, ghc-boot >= 9.10 && < 9.15
, ghc-paths
, stm
, optparse-applicative
Expand Down
34 changes: 34 additions & 0 deletions scripts/check-tags.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env bash
#
# Build ghc-tags, run it on the sources of this repository in both formats and
# check the result. ghc-tags exits with 0 even when it fails to parse a file, it
# only reports the file: a parse error goes to stdout, an error of the external
# preprocessor goes to stderr. A successful run prints nothing, so any output is
# a failure.

set -euo pipefail

cd "$(dirname "$0")/.."

work_dir=$(mktemp -d)
trap 'rm -rf "$work_dir"' EXIT

cabal build

cabal run -v0 ghc-tags -- -c -f "$work_dir/tags" src > "$work_dir/ctags.log" 2>&1
cabal run -v0 ghc-tags -- -e -f "$work_dir/TAGS" src > "$work_dir/etags.log" 2>&1

cat "$work_dir/ctags.log" "$work_dir/etags.log"

if [ -s "$work_dir/ctags.log" ] || [ -s "$work_dir/etags.log" ]; then
echo "Error: ghc-tags failed to process some files."
exit 1
fi

for file in tags TAGS; do
if [ ! -s "$work_dir/$file" ]; then
echo "Error: $file is empty."
exit 1
fi
echo "$file: $(wc -l < "$work_dir/$file") lines"
done
Loading