brendanhay / amazonka

A comprehensive Amazon Web Services SDK for Haskell.
https://amazonka.brendanhay.nz
Other
599 stars 227 forks source link

Support for GHC 9.6 and recent hackage (mtl, bytestring, transformers, aeson fixs) #898

Closed guibou closed 1 year ago

guibou commented 1 year ago

This branch allows the compilation with GHC 9.6 on amazonka (before the version 2, hence the merge on master).

It is not tested for backward compatibility, but I'm opening this MR for reference so users may cherry-pick on it.

If you are interested in a merge, please tell me what could be the requirements (boundaries check, ensuring backward compatibilities, ...) and I'll do it.

endgame commented 1 year ago

Thank you for the PR, but I don't think that I can do anything with these commits because master is a dead branch. There has been no activity on branch master for years, but main is very close to a second release candidate of amazonka-2.0. 2.0 has has many improvements to the core libraries and the service bindings, and is strongly recommended for all use, even though it's not yet on Hackage. See the release announcement for advice on how to incorporate latest main into your projects, whether you use cabal or stack.

Among other things, main definitely supports aeson 2.x, probably supports the newer bytestring stuff, and no longer cares about unliftio because the AWST monad transformer has been removed.

I would be very interested to hear how you go testing main with GHC 9.4 and/or 9.6 (and a PR to main that fixes anything necessary). If you are good at Bazel it would be a huge help to have someone fix up the build system. Being able to use newer GHCs with the Bazel tooling is a prerequisite to getting everything working in CI again.

guibou commented 1 year ago

Hi @endgame, thank you for the answer.

I understand the reasons to close the branch, at least it is here as reference for users of amazonka < 2.

Now that we are working good with GHC 9.6, I'll try to update to amazonka 2 ASAP and give you feedbacks. I wasn't motivated to bump GHC AND amazonka at the same time.

(Sorry, I won't have a look at the bazel build system of amazonka)

guibou commented 1 year ago

@endgame:

I've tested amazonka 2 (e.g. main branch) with GHC 9.6 and everything are smooth. I had to refactor the module names, rework my usage of MonadAWS which had disappears, and change a few fields / lenses, but everything is smooth. The release announcement helped, thank you.

I use a house made build system based on nix (but converted from a bazel build system) where all the packages of amazonka are loaded using nixpkgs infrastructure for haskell.

The relevant parts are:

In my flake.nix inputs:

    haskell-amazonka = {
      url = "github:brendanhay/amazonka";
      flake = false;
    };

    haskell-amazonka-s3-streaming = {
      url = "github:Axman6/amazonka-s3-streaming";
      flake = false;
    };

In my haskellPackages overlay:

      amazonka = hfinal.callCabal2nix "amazonka" "${inputs.haskell-amazonka}/lib/amazonka" { };
      amazonka-core = hfinal.callCabal2nix "amazonka-core" "${inputs.haskell-amazonka}/lib/amazonka-core" { };
      amazonka-s3 = hfinal.callCabal2nix "amazonka-s3" "${inputs.haskell-amazonka}/lib/services/amazonka-s3" { };
      amazonka-sts = hfinal.callCabal2nix "amazonka-sts" "${inputs.haskell-amazonka}/lib/services/amazonka-sts" { };
      amazonka-sso = hfinal.callCabal2nix "amazonka-sso" "${inputs.haskell-amazonka}/lib/services/amazonka-sso" { };

      amazonka-s3-streaming = hfinal.callCabal2nix "amazonka-s3-streaming" "${inputs.haskell-amazonka-s3-streaming}" { };

Note that I had desactivated all bound checking (i.e. "jailbreaking") and that I'm not running amazonka tests.

Thank you for this awesome refactor of the library.

endgame commented 1 year ago

Excellent news. I am glad that this worked for you.