Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve #992. Remove cffi flag, it has become obsolete #1026

Merged
merged 1 commit into from
Jun 6, 2023
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
6 changes: 1 addition & 5 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ jobs:
cabal-docspec $ARG_COMPILER
- name: hlint
run: |
if [ $((HCNUMVER >= 90200 && HCNUMVER < 90400)) -ne 0 ] ; then (cd ${PKGDIR_aeson} && hlint -h ${GITHUB_WORKSPACE}/source/.hlint.yaml -XHaskell2010 src attoparsec-iso8601/src src-pure src-ffi) ; fi
if [ $((HCNUMVER >= 90200 && HCNUMVER < 90400)) -ne 0 ] ; then (cd ${PKGDIR_aeson} && hlint -h ${GITHUB_WORKSPACE}/source/.hlint.yaml -XHaskell2010 src attoparsec-iso8601/src src-pure) ; fi
if [ $((HCNUMVER >= 90200 && HCNUMVER < 90400)) -ne 0 ] ; then (cd ${PKGDIR_attoparsec_iso8601} && hlint -h ${GITHUB_WORKSPACE}/source/.hlint.yaml -XHaskell2010 src) ; fi
if [ $((HCNUMVER >= 90200 && HCNUMVER < 90400)) -ne 0 ] ; then (cd ${PKGDIR_aeson_examples} && hlint -h ${GITHUB_WORKSPACE}/source/.hlint.yaml -XHaskell2010 src/) ; fi
if [ $((HCNUMVER >= 90200 && HCNUMVER < 90400)) -ne 0 ] ; then (cd ${PKGDIR_aeson_benchmarks} && hlint -h ${GITHUB_WORKSPACE}/source/.hlint.yaml -XHaskell2010 .) ; fi
Expand Down Expand Up @@ -314,10 +314,6 @@ jobs:
run: |
$CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='aeson +ordered-keymap' all
$CABAL v2-test $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='aeson +ordered-keymap' all
- name: constraint set cffi
run: |
if [ $((HCNUMVER < 90400)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='aeson +cffi' all ; fi
if [ $((HCNUMVER < 90400)) -ne 0 ] ; then $CABAL v2-test $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='aeson +cffi' all ; fi
- name: save cache
uses: actions/cache/save@v3
if: always()
Expand Down
25 changes: 4 additions & 21 deletions aeson.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
name: aeson
version: 2.1.2.1
x-revision: 3
version: 2.2
license: BSD3
license-file: LICENSE
category: Text, Web, JSON
Expand Down Expand Up @@ -39,24 +38,15 @@ description:
extra-source-files:
*.yaml
benchmarks/json-data/*.json
cbits/*.c
changelog.md
README.markdown
src-ffi/Data/Aeson/Parser/*.hs
src-pure/Data/Aeson/Parser/*.hs
tests/golden/*.expected
tests/JSONTestSuite/results/*.tok
tests/JSONTestSuite/results/*.txt
tests/JSONTestSuite/test_parsing/*.json
tests/JSONTestSuite/test_transform/*.json

flag cffi
description:
Controls whether to include c-ffi bits or pure haskell. Default to False for security.

default: False
manual: True

flag ordered-keymap
description: Use ordered @Data.Map.Strict@ for KeyMap implementation.
default: True
Expand Down Expand Up @@ -148,16 +138,9 @@ library

ghc-options: -Wall

if (impl(ghcjs) || !flag(cffi))
hs-source-dirs: src-pure
other-modules: Data.Aeson.Parser.UnescapePure

else
c-sources: cbits/unescape_string.c
cpp-options: -DCFFI
hs-source-dirs: src-ffi
other-modules: Data.Aeson.Parser.UnescapeFFI
build-depends: text <2.0
-- String unescaping
hs-source-dirs: src-pure
other-modules: Data.Aeson.Parser.UnescapePure

if flag(ordered-keymap)
cpp-options: -DUSE_ORDEREDMAP=1
Expand Down
6 changes: 0 additions & 6 deletions cabal.haskell-ci
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@ hlint: True
hlint-job: 9.2.8
hlint-yaml: .hlint.yaml

constraint-set cffi
ghc: <9.4
constraints: aeson +cffi
tests: True
run-tests: True

constraint-set ordered-keymap-on
constraints: aeson +ordered-keymap
tests: True
Expand Down
149 changes: 0 additions & 149 deletions cbits/unescape_string.c

This file was deleted.

5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
For the latest version of this document, please see [https://github.com/haskell/aeson/blob/master/changelog.md](https://github.com/haskell/aeson/blob/master/changelog.md).

### 2.2

* Remove `cffi` flag. Then the C implementation for string unescaping was used for `text <2` versions.
The new native Haskell implementation introduced in version 2.0.3.0 is at least as fast.

### 2.1.2.1

* Support `th-abstraction-0.5`
Expand Down
58 changes: 0 additions & 58 deletions src-ffi/Data/Aeson/Parser/UnescapeFFI.hs

This file was deleted.

4 changes: 0 additions & 4 deletions src/Data/Aeson/Parser/Unescape.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,4 @@ module Data.Aeson.Parser.Unescape
unescapeText
) where

#ifdef CFFI
import Data.Aeson.Parser.UnescapeFFI (unescapeText)
#else
import Data.Aeson.Parser.UnescapePure (unescapeText)
#endif