Skip to content
Draft
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
64 changes: 28 additions & 36 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' 'optparse-applicative.cabal'
# haskell-ci 'github' '--project' '--installed=-process -filepath -Win32 -unix -directory -all -bytestring -text' '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.19.20240708
# version: 0.19.20250605
#
# REGENDATA ("0.19.20240708",["github","optparse-applicative.cabal"])
# REGENDATA ("0.19.20250605",["github","--project","--installed=-process -filepath -Win32 -unix -directory -all -bytestring -text","cabal.project"])
#
name: Haskell-CI
on:
Expand All @@ -19,7 +19,7 @@ on:
jobs:
linux:
name: Haskell-CI - Linux - ${{ matrix.compiler }}
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
timeout-minutes:
60
container:
Expand Down Expand Up @@ -78,32 +78,31 @@ jobs:
compilerVersion: 8.6.5
setup-method: ghcup
allow-failure: false
- compiler: ghc-8.4.4
compilerKind: ghc
compilerVersion: 8.4.4
setup-method: ghcup
allow-failure: false
- compiler: ghc-8.2.2
compilerKind: ghc
compilerVersion: 8.2.2
setup-method: ghcup
allow-failure: false
- compiler: ghc-8.0.2
compilerKind: ghc
compilerVersion: 8.0.2
setup-method: ghcup
allow-failure: false
fail-fast: false
steps:
- name: apt
- name: apt-get install
run: |
apt-get update
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 libnuma-dev
apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5
- name: Install GHCup
run: |
mkdir -p "$HOME/.ghcup/bin"
curl -sL https://downloads.haskell.org/ghcup/0.1.30.0/x86_64-linux-ghcup-0.1.30.0 > "$HOME/.ghcup/bin/ghcup"
curl -sL https://downloads.haskell.org/ghcup/0.1.50.1/x86_64-linux-ghcup-0.1.50.1 > "$HOME/.ghcup/bin/ghcup"
chmod a+x "$HOME/.ghcup/bin/ghcup"
- name: Install cabal-install
run: |
"$HOME/.ghcup/bin/ghcup" install cabal 3.14.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
echo "CABAL=$HOME/.ghcup/bin/cabal-3.14.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
- name: Install GHC (GHCup)
if: matrix.setup-method == 'ghcup'
run: |
"$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false)
"$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
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=$HCPKG" >> "$GITHUB_ENV"
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
env:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
Expand All @@ -114,21 +113,12 @@ jobs:
echo "LANG=C.UTF-8" >> "$GITHUB_ENV"
echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV"
echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV"
HCDIR=/opt/$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=$HCPKG" >> "$GITHUB_ENV"
echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV"
echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.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"
echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV"
echo "HEADHACKAGE=false" >> "$GITHUB_ENV"
echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV"
echo "GHCJSARITH=0" >> "$GITHUB_ENV"
env:
HCKIND: ${{ matrix.compilerKind }}
HCNAME: ${{ matrix.compiler }}
Expand Down Expand Up @@ -202,11 +192,13 @@ jobs:
touch cabal.project
touch cabal.project.local
echo "packages: ${PKGDIR_optparse_applicative}" >> cabal.project
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package optparse-applicative" >> cabal.project ; fi
if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi
echo "package optparse-applicative" >> cabal.project
echo " ghc-options: -Werror=missing-methods" >> cabal.project
cat >> cabal.project <<EOF
source-repository-package
type: git
location: https://github.com/0rphee/os-string-io.git
EOF
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(optparse-applicative)$/; }' >> cabal.project.local
cat cabal.project
cat cabal.project.local
- name: dump install plan
Expand Down Expand Up @@ -244,8 +236,8 @@ jobs:
rm -f cabal.project.local
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all
- name: save cache
uses: actions/cache/save@v4
if: always()
uses: actions/cache/save@v4
with:
key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }}
path: ~/.cabal/store
2 changes: 2 additions & 0 deletions cabal.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
packages:
./
2 changes: 0 additions & 2 deletions hie.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
cradle:
cabal:
- path: "./"
component: "optparse-applicative:lib:optparse-applicative"
41 changes: 13 additions & 28 deletions optparse-applicative.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -61,35 +61,20 @@ tested-with:
GHC==8.10.7
GHC==8.8.4
GHC==8.6.5
GHC==8.4.4
GHC==8.2.2
GHC==8.0.2
GHC==7.10.3
GHC==7.8.4
GHC==7.6.3
GHC==7.4.2
GHC==7.2.2
GHC==7.0.4

source-repository head
type: git
location: https://github.com/pcapriotti/optparse-applicative.git

flag process
description:
Depend on the process package for Bash autocompletion
default: True

library
hs-source-dirs: src
ghc-options: -Wall
default-language: Haskell98

-- See https://ghc.haskell.org/trac/ghc/wiki/Migration/8.0#base-4.9.0.0
if impl(ghc >= 8.0)
ghc-options: -Wno-redundant-constraints -Wcompat -Wnoncanonical-monad-instances
if impl(ghc < 8.8)
ghc-options: -Wnoncanonical-monadfail-instances
ghc-options: -Wno-redundant-constraints -Wcompat -Wnoncanonical-monad-instances
if impl(ghc < 8.8)
ghc-options: -Wnoncanonical-monadfail-instances

exposed-modules: Options.Applicative
, Options.Applicative.Arrows
Expand All @@ -109,18 +94,16 @@ library
, Options.Applicative.Types
, Options.Applicative.Internal

build-depends: base >= 4.5 && < 5
build-depends: base >= 4.12 && < 5
, text >= 1.2
, transformers >= 0.5 && < 0.7
, prettyprinter >= 1.7 && < 1.8
, prettyprinter-ansi-terminal >= 1.1.2 && < 1.2

if flag(process)
build-depends: process >= 1.0 && < 1.7

if !impl(ghc >= 8)
build-depends: semigroups >= 0.10 && < 0.21
, fail == 4.9.*
-- 1.6.26.0 due to System.Process.Environment.OsString.getArgs
, process >= 1.6.26.0 && < 1.7
, bytestring
, os-string >= 2.0.5 && < 3
, filepath >= 1.5

test-suite tests
type: exitcode-stdio-1.0
Expand Down Expand Up @@ -148,7 +131,9 @@ test-suite tests

build-depends: base
, optparse-applicative
, os-string
, file-io
, filepath
, text
, QuickCheck >= 2.8 && < 2.16

if !impl(ghc >= 8)
build-depends: semigroups
3 changes: 3 additions & 0 deletions src/Options/Applicative.hs
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,11 @@ module Options.Applicative (
switch,

strOption,
osStrOption,
option,

strArgument,
osStrArgument,
argument,

subparser,
Expand Down Expand Up @@ -134,6 +136,7 @@ module Options.Applicative (

auto,
str,
osStr,
maybeReader,
eitherReader,
disabled,
Expand Down
Loading