-
Notifications
You must be signed in to change notification settings - Fork 0
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
Make alertmanager client compile with ghc9 #3
base: master
Are you sure you want to change the base?
Changes from all commits
37add40
4f2a224
7bf842d
00c6a06
dea8194
85d6941
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Alertmanager | ||
|
||
## 0.1.0 | ||
|
||
+ Initial generation | ||
+ Make it compile with ghc 9 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ nixpkgs ? import ../nix/pin.nix {}, compiler ? "default", doBenchmark ? false }: | ||
|
||
let | ||
|
||
inherit (nixpkgs) pkgs; | ||
|
||
f = { mkDerivation, alertmanager-openapi, base, http-client, lens | ||
, lib, text, transformers, cabal-install | ||
}: | ||
mkDerivation { | ||
pname = "alertmanager-client"; | ||
version = "0.1.0.0"; | ||
src = ./.; | ||
libraryToolDepends = [ cabal-install ]; | ||
libraryHaskellDepends = [ | ||
alertmanager-openapi base http-client lens text transformers | ||
]; | ||
homepage = "https://github.com/SupercedeTech/alertmanager-client#readme"; | ||
license = lib.licenses.bsd3; | ||
}; | ||
|
||
haskellPackages = (if compiler == "default" | ||
then pkgs.haskellPackages | ||
else pkgs.haskell.packages.${compiler}).extend(self: super: { | ||
alertmanager-openapi = haskellPackages.callPackage ../alertmanager-openapi {}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is explicitly adding the package necessary here but not above? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it's not available in the package set. no-one uploaded it to hackage. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, my question wasn't clear - why isn't it necessary to add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. otherwise cabal can't find it, nix patches cabal somehow |
||
}); | ||
|
||
variant = if doBenchmark then pkgs.haskell.lib.doBenchmark else pkgs.lib.id; | ||
|
||
drv = variant (haskellPackages.callPackage f { | ||
}); | ||
|
||
in | ||
|
||
if pkgs.lib.inNixShell then drv.env else drv |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
5.2.1-SNAPSHOT | ||
5.4.0 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,16 +30,16 @@ library | |
lib | ||
ghc-options: -Wall -funbox-strict-fields | ||
build-depends: | ||
aeson >=1.0 && <2.0 | ||
aeson >=2.0 && <3.0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Annoying that this big version bump is necessary. I wish the OpenAPI people had supported multiple There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. aeson 1.xx is susceptible to DoS attacks. It's possible to create a universal hash collision for FNV based hash algorithms. |
||
, base >=4.7 && <5.0 | ||
, base64-bytestring >1.0 && <2.0 | ||
, bytestring >=0.10.0 && <0.11 | ||
, case-insensitive | ||
, containers >=0.5.0.0 && <0.8 | ||
, deepseq >= 1.4 && <1.6 | ||
, exceptions >= 0.4 | ||
, http-api-data >= 0.3.4 && <0.5 | ||
, http-client >=0.5 && <0.7 | ||
, http-api-data >= 0.3.4 && <0.6 | ||
, http-client >=0.5 && <0.8 | ||
, http-client-tls | ||
, http-media >= 0.4 && < 0.9 | ||
, http-types >=0.8 && <0.13 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ mkDerivation, aeson, base, base64-bytestring, bytestring | ||
, case-insensitive, containers, deepseq, exceptions, hspec | ||
, http-api-data, http-client, http-client-tls, http-media | ||
, http-types, iso8601-time, lib, microlens, monad-logger, mtl | ||
, network, QuickCheck, random, safe-exceptions, semigroups, text | ||
, time, transformers, unordered-containers, vector, cabal-install | ||
}: | ||
mkDerivation { | ||
pname = "alertmanager-openapi"; | ||
version = "0.0.1.0"; | ||
src = ./.; | ||
libraryToolDepends = [cabal-install]; | ||
libraryHaskellDepends = [ | ||
aeson base base64-bytestring bytestring case-insensitive containers | ||
deepseq exceptions http-api-data http-client http-client-tls | ||
http-media http-types iso8601-time microlens monad-logger mtl | ||
network random safe-exceptions text time transformers | ||
unordered-containers vector | ||
]; | ||
testHaskellDepends = [ | ||
aeson base bytestring containers hspec iso8601-time mtl QuickCheck | ||
semigroups text time transformers unordered-containers vector | ||
]; | ||
homepage = "https://openapi-generator.tech"; | ||
description = "Auto-generated alertmanager-openapi API Client"; | ||
license = lib.licenses.bsd3; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use
callCabal2Nix
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because many, /many/ more packages are broken, I considered going from me not being able to build it at all to having it generate and build the new bindings good enough for this upgrade cycle.