Skip to content

Commit

Permalink
Add support for GHC 9.8 and drop support for GHC 9.2
Browse files Browse the repository at this point in the history
  • Loading branch information
arybczak committed Nov 21, 2023
1 parent 5484571 commit 1bcf164
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 28 deletions.
33 changes: 17 additions & 16 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# This GitHub workflow config has been generated by a script via
#
# haskell-ci 'github' '--config=cabal.haskell-ci' 'ghc-tags.cabal'
# haskell-ci 'github' '--config=cabal.haskell-ci' 'cabal.project'
#
# To regenerate the script (for example after adjusting tested-with) run
#
# haskell-ci regenerate
#
# For more information, see https://github.com/haskell-CI/haskell-ci
#
# version: 0.16.3
# version: 0.17.20231110
#
# REGENDATA ("0.16.3",["github","--config=cabal.haskell-ci","ghc-tags.cabal"])
# REGENDATA ("0.17.20231110",["github","--config=cabal.haskell-ci","cabal.project"])
#
name: Haskell-CI
on:
Expand All @@ -32,19 +32,19 @@ jobs:
strategy:
matrix:
include:
- compiler: ghc-9.6.2
- compiler: ghc-9.8.1
compilerKind: ghc
compilerVersion: 9.6.2
compilerVersion: 9.8.1
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.4.5
- compiler: ghc-9.6.3
compilerKind: ghc
compilerVersion: 9.4.5
compilerVersion: 9.6.3
setup-method: ghcup
allow-failure: false
- compiler: ghc-9.2.8
- compiler: ghc-9.4.8
compilerKind: ghc
compilerVersion: 9.2.8
compilerVersion: 9.4.8
setup-method: ghcup
allow-failure: false
fail-fast: false
Expand All @@ -54,10 +54,10 @@ jobs:
apt-get update
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
mkdir -p "$HOME/.ghcup/bin"
curl -sL https://downloads.haskell.org/ghcup/0.1.19.2/x86_64-linux-ghcup-0.1.19.2 > "$HOME/.ghcup/bin/ghcup"
curl -sL https://downloads.haskell.org/ghcup/0.1.20.0/x86_64-linux-ghcup-0.1.20.0 > "$HOME/.ghcup/bin/ghcup"
chmod a+x "$HOME/.ghcup/bin/ghcup"
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
"$HOME/.ghcup/bin/ghcup" install cabal 3.10.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
env:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
Expand All @@ -69,11 +69,13 @@ jobs:
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
HCDIR=/opt/$HCKIND/$HCVER
HC=$HOME/.ghcup/bin/$HCKIND-$HCVER
HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER")
HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#')
HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#')
echo "HC=$HC" >> "$GITHUB_ENV"
echo "HCPKG=$HOME/.ghcup/bin/$HCKIND-pkg-$HCVER" >> "$GITHUB_ENV"
echo "HADDOCK=$HOME/.ghcup/bin/haddock-$HCVER" >> "$GITHUB_ENV"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.1.0 -vnormal+nowrap" >> "$GITHUB_ENV"
echo "HCPKG=$HCPKG" >> "$GITHUB_ENV"
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.10.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))')
echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV"
echo "ARG_TESTS=--enable-tests" >> "$GITHUB_ENV"
Expand Down Expand Up @@ -158,7 +160,6 @@ jobs:
echo " ghc-options: -Werror=missing-methods" >> cabal.project
cat >> cabal.project <<EOF
EOF
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: $_ installed\n" unless /^(ghc-tags)$/; }' >> cabal.project.local
cat cabal.project
cat cabal.project.local
- name: dump install plan
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# ghc-tags-1.8 (????-??-??)
* Add support for GHC 9.8 and drop support for GHC 9.2.

# ghc-tags-1.7 (2023-06-29)
* Add support for GHC 9.6 and drop support for GHC 9.0.

Expand Down
2 changes: 2 additions & 0 deletions cabal.haskell-ci
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ branches: master
doctest: False
tests: True
jobs-selection: any

installed: -all
1 change: 1 addition & 0 deletions cabal.project
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
packages: .
10 changes: 5 additions & 5 deletions ghc-tags.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 2.4
name: ghc-tags
version: 1.7
version: 1.8
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,7 +14,7 @@ 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.2.8 || ==9.4.5 || ==9.6.2
tested-with: GHC ==9.4.8 || ==9.6.3 || ==9.8.1

source-repository head
type: git
Expand All @@ -28,12 +28,12 @@ flag ghc-lib
executable ghc-tags
ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-A4m

if !flag(ghc-lib) && impl(ghc == 9.6.*)
if !flag(ghc-lib) && impl(ghc == 9.8.*)
build-depends: ghc, ghc-boot
else
build-depends: ghc-lib == 9.6.*
build-depends: ghc-lib == 9.8.*

build-depends: base >=4.16 && <4.19
build-depends: base >=4.17 && <4.20
, aeson >= 2.0.0.0
, async
, attoparsec
Expand Down
8 changes: 4 additions & 4 deletions src/GhcTags/Ghc.hs
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ data GhcTagKind
| GtkTypeClass
| GtkTypeClassMember (HsWildCardBndrs GhcPs (LHsSigType GhcPs))
| GtkTypeClassInstance (HsType GhcPs)
| GtkTypeFamily (Maybe ([HsTyVarBndr () GhcPs], Either (HsKind GhcPs) (HsTyVarBndr () GhcPs)))
| GtkTypeFamily (Maybe ([HsTyVarBndr (HsBndrVis GhcPs) GhcPs], Either (HsKind GhcPs) (HsTyVarBndr () GhcPs)))
| GtkTypeFamilyInstance (TyFamInstDecl GhcPs)
| GtkDataTypeFamily (Maybe ([HsTyVarBndr () GhcPs], Either (HsKind GhcPs) (HsTyVarBndr () GhcPs)))
| GtkDataTypeFamily (Maybe ([HsTyVarBndr (HsBndrVis GhcPs) GhcPs], Either (HsKind GhcPs) (HsTyVarBndr () GhcPs)))
| GtkDataTypeFamilyInstance (Maybe (HsKind GhcPs))
| GtkForeignImport
| GtkForeignExport
Expand All @@ -66,7 +66,7 @@ data GhcTag = GhcTag {
-- ^ tag's kind
, gtIsExported :: Bool
-- ^ 'True' iff the term is exported
, gtFFI :: Maybe String
, gtFFI :: Maybe ByteString
-- ^ @ffi@ import
}

Expand Down Expand Up @@ -347,7 +347,7 @@ hsDeclsToGhcTags mies = foldr go []
case sourceText of
NoSourceText -> tag
-- TODO: add header information from '_mheader'
SourceText s -> tag { gtFFI = Just s }
SourceText s -> tag { gtFFI = Just $ bytesFS s }
: tags
where
tag = mkGhcTag' decLoc fd_name GtkForeignImport
Expand Down
3 changes: 1 addition & 2 deletions src/GhcTags/GhcCompat.hs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ compatInitSettings top_dir = do
getToolSetting :: String -> IO String
getToolSetting key = expandToolDir useInplaceMinGW mtool_dir <$> getSetting key

myExtraGccViaCFlags <- getSetting "GCC extra via C opts"
-- On Windows, mingw is distributed with GHC,
-- so we look in TopDir/../mingw/bin,
-- as well as TopDir/../../mingw/bin for hadrian.
Expand Down Expand Up @@ -229,7 +228,7 @@ compatInitSettings top_dir = do
, toolSettings_opt_lc = []
, toolSettings_opt_i = []

, toolSettings_extraGccViaCFlags = words myExtraGccViaCFlags
, toolSettings_extraGccViaCFlags = []
}

, sTargetPlatform = platform
Expand Down
2 changes: 1 addition & 1 deletion src/GhcTags/Tag.hs
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ ghcTagToTag sing dynFlags GhcTag { gtSrcSpan, gtTag, gtKind, gtIsExported, gtFFI
TagFields $
case gtFFI of
Nothing -> mempty
Just ffi -> [TagField "ffi" $ Text.pack ffi]
Just ffi -> [TagField "ffi" $ Text.decodeUtf8 ffi]


-- 'TagFields' from 'GhcTagKind'
Expand Down

0 comments on commit 1bcf164

Please sign in to comment.