gagandeepb / Frames-beam

Accessing Postgres in a data frame in Haskell
BSD 3-Clause "New" or "Revised" License
24 stars 3 forks source link

Does not compile #25

Closed idontgetoutmuch closed 9 months ago

idontgetoutmuch commented 1 year ago

With

let

myHaskellPackageOverlay = self: super: {
  myHaskellPackages = super.haskellPackages.override {
    overrides = hself: hsuper: rec {
      htoml = super.haskell.lib.dontCheck (hself.callCabal2nixWithOptions "htoml" (builtins.fetchGit {
        url = "https://github.com/mirokuratczyk/htoml";
        rev = "33971287445c5e2531d9605a287486dfc3cbe1da";
      }) "" { });
      hasql-streams-core = super.haskell.lib.doJailbreak hsuper.hasql-streams-core;
      hasql-streams-conduit = super.haskell.lib.doJailbreak hsuper.hasql-streams-conduit;
      hasql-transaction-io = super.haskell.lib.doJailbreak hsuper.hasql-transaction-io;
      hasql-streams-pipes = super.haskell.lib.doJailbreak hsuper.hasql-streams-pipes;
      hasql-streams-streaming = super.haskell.lib.doJailbreak hsuper.hasql-streams-streaming;
      hasql-streams-streamly = super.haskell.lib.doJailbreak hsuper.hasql-streams-streamly;
    };
  };
};

in

{ nixpkgs ? import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/nixpkgs-22.05-darwin.tar.gz")
  {
    overlays = [ myHaskellPackageOverlay ];
    config.allowBroken = true;
  }
}:

let

  pkgs = nixpkgs;

  haskellDeps = ps: with ps; [
    base
    beam-core
    beam-migrate
    beam-postgres
    text
    Frames
    template-haskell
    generics-sop
    vinyl
    process
    conduit
    monad-control
    bytestring
    scientific
    time
    uuid-types
    hspec
    hspec-core
    QuickCheck
  ];

in

pkgs.stdenv.mkDerivation {
  name = "rOnly";

  buildInputs = [
    pkgs.libintlOrEmpty
    pkgs.stack
    (pkgs.myHaskellPackages.ghcWithPackages haskellDeps)
    pkgs.darwin.apple_sdk.frameworks.Cocoa
  ];
}

I get

[nix-shell:~/Frames-beam]$ stack build
stack build
No setup information found for ghc-8.2.2 on your platform.
This probably means a GHC bindist has not yet been added for OS key 'macosx-aarch64'.
Supported versions: ghc-8.10.5, ghc-8.10.6, ghc-8.10.7, ghc-9.0.2, ghc-9.2.1, ghc-9.2.2, ghc-9.2.3, ghc-9.2.4, ghc-9.2.5, ghc-9.2.6, ghc-9.2.7, ghc-9.2.8, ghc-9.4.1, ghc-9.4.2, ghc-9.4.3, ghc-9.4.4, ghc-9.4.5, ghc-9.6.1, ghc-9.6.2

and

[nix-shell:~/Frames-beam]$ cabal build
cabal build
Build profile: -w ghc-9.0.2 -O1
In order, the following will be built (use -v for more details):
 - Frames-beam-0.2.0.0 (lib) (first run)
Preprocessing library for Frames-beam-0.2.0.0..
Building library for Frames-beam-0.2.0.0..
[4 of 6] Compiling Frames.SQL.Beam.Postgres.Query ( src/Frames/SQL/Beam/Postgres/Query.hs, /Users/dom/Frames-beam/dist-newstyle/build/aarch64-osx/ghc-9.0.2/Frames-beam-0.2.0.0/build/Frames/SQL/Beam/Postgres/Query.o, /Users/dom/Frames-beam/dist-newstyle/build/aarch64-osx/ghc-9.0.2/Frames-beam-0.2.0.0/build/Frames/SQL/Beam/Postgres/Query.dyn_o )

src/Frames/SQL/Beam/Postgres/Query.hs:38:18: error:
    • Couldn't match type ‘Postgres’ with ‘PgSelectSyntax’
      Expected: Q PgSelectSyntax b s (a (QExpr PgExpressionSyntax s))
        Actual: Q Postgres b s (a (QExpr Postgres s))
    • In the expression: all_ (tbl db)
      In an equation for ‘allRows’: allRows tbl db = all_ (tbl db)
   |
38 | allRows tbl db = all_ (tbl db)
   |                  ^^^^^^^^^^^^^

src/Frames/SQL/Beam/Postgres/Query.hs:52:3: error:
    • Couldn't match type ‘PgExpressionSyntax’ with ‘PgSelectSyntax’
      Expected: Q PgSelectSyntax b s (a (QExpr PgExpressionSyntax s))
        Actual: Q PgExpressionSyntax b s (a (QExpr PgExpressionSyntax s))
    • In the expression: filter_ (filterLambda) (allRows tbl db)
      In an equation for ‘allRowsWhere’:
          allRowsWhere tbl db filterLambda
            = filter_ (filterLambda) (allRows tbl db)
   |
52 |   filter_ (filterLambda) (allRows tbl db)
   |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/Frames/SQL/Beam/Postgres/Query.hs:52:27: error:
    • Couldn't match type ‘PgSelectSyntax’ with ‘PgExpressionSyntax’
      Expected: Q PgExpressionSyntax b s (a (QExpr PgExpressionSyntax s))
        Actual: Q PgSelectSyntax b s (a (QExpr PgExpressionSyntax s))
    • In the second argument of ‘filter_’, namely ‘(allRows tbl db)’
      In the expression: filter_ (filterLambda) (allRows tbl db)
      In an equation for ‘allRowsWhere’:
          allRowsWhere tbl db filterLambda
            = filter_ (filterLambda) (allRows tbl db)
   |
52 |   filter_ (filterLambda) (allRows tbl db)
   |                           ^^^^^^^^^^^^^^

Without the jail breaks, the dependencies do not compile.

gagandeepb commented 9 months ago

@idontgetoutmuch I'm closing this, please reopen if you are unable to build master.