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

Use "ghc" library in place of "haskell-src". #248

Merged
merged 10 commits into from
May 12, 2024
Merged
33 changes: 28 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,34 @@ jobs:
- ubuntu-latest
- macos-latest
compiler:
- ghc8107
- ghc902
- ghc924
- ghc946
- ghc928
- ghc948
- ghc962
- ghc981
dhall:
- false
- true
swagger:
- false
- true
swaggerWrapper:
- false
- true
largeRecords:
- false
- true
exclude:
- swagger: false
swaggerWrapper: true
- compiler: ghc962
largeRecords: true
- compiler: ghc981
largeRecords: true
- compiler: ghc981
dhall: true
- compiler: ghc902
os: macos-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3.5.3
Expand All @@ -27,5 +51,4 @@ jobs:
with:
name: awakesecurity
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: nix-build --attr proto3-suite --argstr compiler "${{ matrix.compiler }}" --arg enableDhall true --arg enableLargeRecords false
- run: nix-build --attr proto3-suite --argstr compiler "${{ matrix.compiler }}" --arg enableDhall true --arg enableLargeRecords true
- run: nix-build --attr proto3-suite --argstr compiler "${{ matrix.compiler }}" --arg enableDhall "${{ matrix.dhall }}" --arg enableSwagger "${{ matrix.swagger }}" --arg swaggerWrapperFormat "${{ matrix.swaggerWrapper }}" --arg enableLargeRecords "${{ matrix.largeRecords }}"
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# 0.8.0
* [BREAKING CHANGE: Use "ghc" library in place of "haskell-src".]
The "ghc" library is now used to parse and print Haskell source code.
Switching to "ghc" adds support for language features beyond Haskell 98
and should improve diagnostic messages for sources specified with
"--extraInstanceFile". Breakage should be limited to users of:
* Proto3.Suite.DotProto.Generate
* Proto3.Suite.DotProto.Generate.LargeRecord
* Proto3.Suite.DotProto.Generate.Syntax
* Drop support for GHC 8.10.
* On Darwin, drop support for GHC 9.0.
* Add support for GHC 9.6 (without large-records).
* Add support for GHC 9.8 (without large-records, dhall).

# 0.7.0
* Support GHC 9.2, 9.4.
* Support proto files without a package declaration.
Expand Down
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,37 @@ for more details.

## Building

### GHC Versions

#### GHC 9.8

We do not support features making use of the "dhall" or "large-records"
libraries because neither library currently builds on GHC 9.8, and
therefore we cannot test our support.

Otherwise we support GHC 9.8 on Linux and Darwin.

#### GHC 9.6

We do not support features making use of the "large-records"
library because it does not currently build on GHC 9.6, and
therefore we cannot test our support.

Otherwise we support GHC 9.6 on Linux and Darwin.

#### GHC 9.4

Supported on Linux and Darwin.

#### GHC 9.2

Supported on Linux and Darwin.

#### GHC 9.0

Supported only on Linux because "crypton" fails a test on Darwin,
probably due to [this issue](https://github.com/kazu-yamamoto/crypton/issues/35).

### Nix shell + Cabal (recommended)

The Nix shell provides an incremental build environment (but see below for
Expand Down
8 changes: 4 additions & 4 deletions nix/nixpkgs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ args:

let
nixpkgs = builtins.fetchTarball {
# release: nixpkgs-23.05pre491123.261abe8a44a7
# commit: 261abe8a44a7e8392598d038d2e01f7b33cf26d0
url = "https://hydra.nixos.org/build/236149912/download/2/nixpkgs-23.05pre491123.261abe8a44a7.tar.xz";
sha256 = "0yhf6zbnkj3a7wfas5clli5qk4xl0cw5zq5w4fzvd724za5nb04f";
# build: https://hydra.nixos.org/build/258096332
# commit: 0638fe2715d998fa81d173aad264eb671ce2ebc1
url = "https://hydra.nixos.org/build/258096332/download/2/nixpkgs-23.11pre558121.0638fe2715d9.tar.xz";
sha256 = "1z3s1hqg3b72g608pf9sv474d4y9s00p86nsvfw5i9xgwhjncjjb";
};
in import nixpkgs ({ config = { }; } // args)
228 changes: 225 additions & 3 deletions nix/overlays/haskell-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,224 @@ in {
[ (pkgsNew.haskell.lib.packagesFromDirectory { directory = ../packages; })

(haskellPackagesNew: haskellPackagesOld: {

# With nixpkgs-23.11 and ghc981, adjunctions wants hspec for testing,
# which causes problems.
adjunctions =
pkgsNew.haskell.lib.dontCheck haskellPackagesOld.adjunctions;

# With nixpkgs-23.11 and ghc981, aeson-2.1.2.1 thinks that th-abstraction is out of bounds.
# Also, in order to avoid the breaking change to package structure in aeson-2.2.0.0,
# we patch the import list of aeson-2.1.2.1.
aeson =
pkgsNew.haskell.lib.doJailbreak
( pkgsNew.haskell.lib.appendPatches haskellPackagesOld.aeson
[ ../patches/aeson-2.1.2.1.patch ] );

# With nixpkgs-23.11 and ghc981, atomic-write wants hspec for testing,
# which causes problems.
atomic-write =
pkgsNew.haskell.lib.dontCheck haskellPackagesOld.atomic-write;

# With nixpkgs-23.11 and ghc981, base-compat-batteries wants hspec for testing,
# which causes problems.
base-compat-batteries =
pkgsNew.haskell.lib.dontCheck haskellPackagesOld.base-compat-batteries;

# With nixpkgs-23.11 and ghc981, base-orphans wants hspec for testing,
# which causes problems.
base-orphans =
pkgsNew.haskell.lib.dontCheck haskellPackagesOld.base-orphans;

# With nixpkgs-23.11 and ghc981, bifunctors wants hspec for testing,
# which causes problems.
bifunctors =
pkgsNew.haskell.lib.dontCheck haskellPackagesOld.bifunctors;

# With nixpkgs-23.11 and ghc981, conduit wants hspec for testing,
# which causes problems.
conduit =
pkgsNew.haskell.lib.dontCheck haskellPackagesOld.conduit;

# With nixpkgs-23.11 and ghc981, constraints wants hspec for testing,
# which causes problems.
constraints =
pkgsNew.haskell.lib.dontCheck haskellPackagesOld.constraints;

# With nixpkgs-23.11 and ghc981, data-diverse wants hspec for testing,
# which causes problems.
data-diverse =
pkgsNew.haskell.lib.dontCheck haskellPackagesOld.data-diverse;

# With nixpkgs-23.11 and ghc981, distribution-nixpkgs wants hspec for testing,
# which causes problems.
distribution-nixpkgs =
pkgsNew.haskell.lib.dontCheck haskellPackagesOld.distribution-nixpkgs;

# With nixpkgs-23.11 and ghc981, distributive wants hspec for testing,
# which causes problems.
distributive =
pkgsNew.haskell.lib.dontCheck haskellPackagesOld.distributive;

# With ghc981, doctest-0.22.2 complains about the version of the base
# package and depends on hspec for testing, which causes problems.
doctest =
pkgsNew.haskell.lib.dontCheck
(pkgsNew.haskell.lib.doJailbreak haskellPackagesOld.doctest);

# With nixpkgs-23.11 and ghc981, generic-deriving wants hspec for testing,
# which causes problems. Also, it generic-deriving thinks that
# th-abstraction is out of bounds.
generic-deriving =
pkgsNew.haskell.lib.dontCheck
(pkgsNew.haskell.lib.doJailbreak haskellPackagesOld.generic-deriving);

# With nixpkgs-23.11 and ghc981, half thinks that deepseq is out of bounds.
half =
pkgsNew.haskell.lib.doJailbreak haskellPackagesOld.half;

# With nixpkgs-23.11 and ghc981, hourglass does not support the version
# of the time package that is provided, but that matters only to tests.
hourglass =
pkgsNew.haskell.lib.dontCheck haskellPackagesOld.hourglass;

# With nixpkgs-23.11 and ghc981, hpack-0.36.0 wants hspec for testing,
# which causes problems.
hpack =
pkgsNew.haskell.lib.dontCheck haskellPackagesOld.hpack;

# With nixpkgs-23.11 and ghc981, http-types wants hspec for testing,
# which causes problems.
http-types =
pkgsNew.haskell.lib.dontCheck haskellPackagesOld.http-types;

# With nixpkgs-23.11 and ghc981, infer-license wants hspec for testing,
# which causes problems.
infer-license =
pkgsNew.haskell.lib.dontCheck haskellPackagesOld.infer-license;

# With nixpkgs-23.11 and our overrides, insert-ordered-containers thinks that lens is out of bounds.
insert-ordered-containers =
pkgsNew.haskell.lib.doJailbreak haskellPackagesOld.insert-ordered-containers;

# With nixpkgs-23.11 and ghc981, invariant indirectly depends on hspec for testing,
# which causes problems. Also, it generic-deriving thinks that
# th-abstraction is out of bounds.
invariant =
pkgsNew.haskell.lib.dontCheck
(pkgsNew.haskell.lib.doJailbreak haskellPackagesOld.invariant);

# With nixpkgs-23.11 and ghc981, iproute wants hspec for testing,
# which causes problems.
iproute =
pkgsNew.haskell.lib.dontCheck haskellPackagesOld.iproute;

# With nixpkgs-23.11 and ghc962, generics-sop-0.5.1.4 thinks that th-abstraction is out of bounds.
generics-sop =
pkgsNew.haskell.lib.doJailbreak haskellPackagesOld.generics-sop;

# With nixpkgs-23.11 and ghc902, large-generics thinks that primitive is out of bounds.
large-generics =
pkgsNew.haskell.lib.doJailbreak haskellPackagesOld.large-generics;

# With nixpkgs-23.11 and ghc902, large-records thinks that primitive is out of bounds.
large-records =
pkgsNew.haskell.lib.doJailbreak haskellPackagesOld.large-records;

# With nixpkgs-23.11 and ghc981 (or perhaps our customized dependencies),
# the tests in lifted-base fail.
lifted-base =
pkgsNew.haskell.lib.dontCheck haskellPackagesOld.lifted-base;

# With nixpkgs-23.11 and ghc981, monad-par wants test-framework for testing, which
# wants language-haskell-extract, which does not support modern template-haskell.
monad-par =
pkgsNew.haskell.lib.dontCheck haskellPackagesOld.monad-par;

# With nixpkgs-23.11 and ghc981, mono-traversable wants hspec for testing,
# which causes problems.
mono-traversable =
pkgsNew.haskell.lib.dontCheck haskellPackagesOld.mono-traversable;

# With nixpkgs-23.11 and our overrides, neat-interpolation that rebase is out of bounds.
neat-interpolation =
pkgsNew.haskell.lib.doJailbreak haskellPackagesOld.neat-interpolation;

# With nixpkgs-23.11 and our overrides, rerebase that rebase is out of bounds.
rerebase =
pkgsNew.haskell.lib.doJailbreak haskellPackagesOld.rerebase;

# With nixpkgs-23.11 and ghc981, safe-exceptions wants hspec for testing,
# which causes problems.
safe-exceptions =
pkgsNew.haskell.lib.dontCheck haskellPackagesOld.safe-exceptions;

# With nixpkgs-23.11 and ghc981, streaming-commons wants hspec for testing,
# which causes problems.
streaming-commons =
pkgsNew.haskell.lib.dontCheck haskellPackagesOld.streaming-commons;

# With nixpkgs-23.11 and our dependency overrides, swagger2 wants hspec for testing,
# which causes problems. Also, we jailbreak to allow a newer version of lens.
swagger2 =
pkgsNew.haskell.lib.dontCheck
(pkgsNew.haskell.lib.doJailbreak haskellPackagesOld.swagger2);

# With nixpkgs-23.11 and ghc981, reflection indirectly depends on hspec for testing,
# which causes problems.
reflection =
pkgsNew.haskell.lib.dontCheck haskellPackagesOld.reflection;

# With nixpkgs-23.11 and ghc981, resourceat wants hspec for testing,
# which causes problems.
resourceat =
pkgsNew.haskell.lib.dontCheck haskellPackagesOld.resourceat;

# With nixpkgs-23.11 and ghc981, resourcet wants hspec for testing,
# which causes problems.
resourcet =
pkgsNew.haskell.lib.dontCheck haskellPackagesOld.resourcet;

# With nixpkgs-23.11 and ghc981, tasty-discover wants hspec for testing,
# which causes problems.
tasty-discover =
pkgsNew.haskell.lib.dontCheck haskellPackagesOld.tasty-discover;

# Suppress:
# warning: non-portable path to file '"dist/build/Test/autogen/cabal_macros.h"'; specified path differs in case from file name on disk [-Wnonportable-include-path]
tasty-golden =
pkgsNew.haskell.lib.appendConfigureFlags haskellPackagesOld.tasty-golden
[ "--ghc-option=-Wno-nonportable-include-path" ];

# With nixpkgs-23.11 and ghc981, text-metrics wants hspec for testing,
# which causes problems.
text-metrics =
pkgsNew.haskell.lib.dontCheck haskellPackagesOld.text-metrics;

# With nixpkgs-23.11 and ghc981, th-compat wants hspec for testing,
# which causes problems.
th-compat =
pkgsNew.haskell.lib.dontCheck haskellPackagesOld.th-compat;

# With nixpkgs-23.11 and our overrides, th-lift thinks that th-abstraction is out of bounds.
th-lift =
pkgsNew.haskell.lib.doJailbreak haskellPackagesOld.th-lift;

# With nixpkgs-23.11 and ghc981, unix-compat wants hspec for testing,
# which causes problems.
unix-compat =
pkgsNew.haskell.lib.dontCheck haskellPackagesOld.unix-compat;

# With nixpkgs-23.11 and ghc981, hpack-0.36.0 wants hspec for testing,
# which causes problems.
unix-time =
pkgsNew.haskell.lib.dontCheck haskellPackagesOld.unix-time;

# With nixpkgs-23.11 and ghc981, yaml wants hspec for testing,
# which causes problems.
yaml =
pkgsNew.haskell.lib.dontCheck haskellPackagesOld.yaml;

range-set-list =
pkgsNew.haskell.lib.overrideCabal
haskellPackagesOld.range-set-list
Expand All @@ -34,15 +252,19 @@ in {
jailbreak = true;
});

# With nixpkgs-23.11 and ghc962, proto3-wire thinks
# that doctest and transformers are out of bounds.
proto3-wire =
let
source = pkgsNew.fetchFromGitHub {
owner = "awakesecurity";
repo = "proto3-wire";
rev = "938523213d5de2d0ad9ece051d1a03002ee539cc";
sha256 = "GVH3N1KrFUVpR8ZRkjZcRp51VgMtSXqClL88dM7FBdc=";
rev = "b3d837f66d97f97f1ad46c5bb0f1d1bb3b7b13c1"; # 1.4.2
sha256 = "LXinRHg7fjBf9of7pDm/oWAacCwJ9x/PtnJz6S0W/FA=";
};
in haskellPackagesNew.callCabal2nix "proto3-wire" source { };
in
pkgsNew.haskell.lib.doJailbreak
(haskellPackagesNew.callCabal2nix "proto3-wire" source { });

proto3-suite-base =
let
Expand Down
22 changes: 22 additions & 0 deletions nix/packages/bifunctors.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{ mkDerivation, assoc, base, comonad, containers
, foldable1-classes-compat, hspec, hspec-discover, lib, QuickCheck
, tagged, template-haskell, th-abstraction, transformers
, transformers-compat
}:
mkDerivation {
pname = "bifunctors";
version = "5.6.2";
sha256 = "1086a9285061eed0c2c5d3cb65aa223defd52fca6d0515bb69ddf2dbc3d9697a";
libraryHaskellDepends = [
assoc base comonad containers foldable1-classes-compat tagged
template-haskell th-abstraction transformers
];
testHaskellDepends = [
base hspec QuickCheck template-haskell transformers
transformers-compat
];
testToolDepends = [ hspec-discover ];
homepage = "http://github.com/ekmett/bifunctors/";
description = "Bifunctors";
license = lib.licenses.bsd3;
}
Loading
Loading