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 install #23

Closed idontgetoutmuch closed 11 months ago

idontgetoutmuch commented 1 year ago
[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
[nix-shell:~/Frames-beam]$ cabal build
cabal build
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] trying: Frames-beam-0.2.0.0 (user goal)
[__1] next goal: vinyl (dependency of Frames-beam)
[__1] rejecting: vinyl-0.14.3 (conflict: Frames-beam => vinyl>=0.10 && <0.11)
[__1] skipping: vinyl-0.14.2, vinyl-0.14.1, vinyl-0.13.3, vinyl-0.13.2,
vinyl-0.13.1, vinyl-0.13.0, vinyl-0.12.3, vinyl-0.12.1, vinyl-0.12.0,
vinyl-0.11.0 (has the same characteristics that caused the previous version to
fail: excluded by constraint '>=0.10 && <0.11' from 'Frames-beam')
[__1] trying: vinyl-0.10.0.1
[__2] next goal: base (dependency of Frames-beam)
[__2] rejecting: base-4.16.4.0/installed-4.16.4.0 (conflict: vinyl =>
base>=4.7 && <4.13)
[__2] skipping: base-4.18.0.0, base-4.17.1.0, base-4.17.0.0, base-4.16.4.0,
base-4.16.3.0, base-4.16.2.0, base-4.16.1.0, base-4.16.0.0, base-4.15.1.0,
base-4.15.0.0, base-4.14.3.0, base-4.14.2.0, base-4.14.1.0, base-4.14.0.0,
base-4.13.0.0 (has the same characteristics that caused the previous version
to fail: excluded by constraint '>=4.7 && <4.13' from 'vinyl')
[__2] rejecting: base-4.12.0.0, base-4.11.1.0, base-4.11.0.0, base-4.10.1.0,
base-4.10.0.0, base-4.9.1.0, base-4.9.0.0, base-4.8.2.0, base-4.8.1.0,
base-4.8.0.0, base-4.7.0.2, base-4.7.0.1, base-4.7.0.0, base-4.6.0.1,
base-4.6.0.0, base-4.5.1.0, base-4.5.0.0, base-4.4.1.0, base-4.4.0.0,
base-4.3.1.0, base-4.3.0.0, base-4.2.0.2, base-4.2.0.1, base-4.2.0.0,
base-4.1.0.0, base-4.0.0.0, base-3.0.3.2, base-3.0.3.1 (constraint from
non-upgradeable package requires installed instance)
[__2] fail (backjumping, conflict set: Frames-beam, base, vinyl)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: Frames-beam, vinyl, base
gagandeepb commented 1 year ago

Hi @idontgetoutmuch , I am not quite sure what the currently standard/in-vogue way of packaging Haskell libraries using Nix is, but you can see my attempt on the branch/PR referenced above. Let me know if that works for your platform (darwin/aarch64, as I see above).

$ nix-shell -p stack
$ stack build

The above worked successfully for me on x86-linux.

idontgetoutmuch commented 1 year ago
[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
idontgetoutmuch commented 1 year ago

Which branch should I be on?

idontgetoutmuch commented 1 year ago

I tried this which at least allowed me to try building

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";
      }) "" { });
    };
  };
};

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
    cassava
    hasql
    http-client
    http-client-tls
    http-conduit
    microlens
    path
    path-io
    pipes
    postgresql-binary
    process
    unix-compat
    vinyl
    xlsx
    zip

    katip

    Frames

    bytestring
    conduit
    hasql
    hasql-streams-conduit
    hasql-streams-pipes
    hasql-streams-streaming
    hasql-streams-streamly
    hasql-th
    hasql-transaction
    hasql-transaction-io
    mtl
    optparse-applicative
    pipes
    rel8
    resourcet
    safe-exceptions
    streaming
    streamly
    text
    unliftio-core

    time

    finite-typelits
    lifted-base
    indexed-list-literals
    pqueue
    some
    sop-core
    type-equality
    vector-sized
    generics-sop
    constraints
    beam-core
    constraints-extras
    dependent-sum
    dependent-map
    beam-migrate
    beam-postgres
  ];

in

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

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

But got the following compiler errors

[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)
   |                           ^^^^^^^^^^^^^^
gagandeepb commented 1 year ago

I wonder if you tried building the branch update-lts ? That pins the specific version of dependencies and GHC (which are somewhat dated by now). Let me know if/how this branch works on your side.

On Fri, Jul 7, 2023 at 10:40 AM idontgetoutmuch @.***> wrote:

I tried this which at least allowed me to try building

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"; }) "" { }); }; }; };

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 cassava hasql http-client http-client-tls http-conduit microlens path path-io pipes postgresql-binary process unix-compat vinyl xlsx zip

katip

Frames

bytestring
conduit
hasql
hasql-streams-conduit
hasql-streams-pipes
hasql-streams-streaming
hasql-streams-streamly
hasql-th
hasql-transaction
hasql-transaction-io
mtl
optparse-applicative
pipes
rel8
resourcet
safe-exceptions
streaming
streamly
text
unliftio-core

time

finite-typelits
lifted-base
indexed-list-literals
pqueue
some
sop-core
type-equality
vector-sized
generics-sop
constraints
beam-core
constraints-extras
dependent-sum
dependent-map
beam-migrate
beam-postgres

];

in

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

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

But got the following compiler errors

[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) | ^^^^^^^^^^^^^^

— Reply to this email directly, view it on GitHub https://github.com/gagandeepb/Frames-beam/issues/23#issuecomment-1625060307, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEKMPJVBBGLMD3GBQRNRMFLXO7DO5ANCNFSM6AAAAAAY5Q7GSA . You are receiving this because you commented.Message ID: @.***>

gagandeepb commented 11 months ago

@idontgetoutmuch Closing this one. From my side, https://github.com/gagandeepb/Frames-beam/pull/24 should fix this.