Closed jpathy closed 5 years ago
Did you see #36 and #37? Do they help?
Thanks using a snapshot of this month worked. Now my binary uses direct-sqlite
with systemlib
, i get linker failure:
/nix/store/ljx5sayk6w0bpd1ahcf0rm5fj55cqafd-binutils-2.31.1/bin/ld: cannot find -lsqlite3
collect2: error: ld returned 1 exit status
`cc' failed in phase `Linker'. (Exit code: 1)
@jpathy Is it an open-source project, so I could try building it?
If not, is it possible for you to strip it down to just some hello-world program with the sqlite dependency?
Also just to confirm, you were xdxd
on IRC, right?
I tried to test this by adding a direct-sqlite
dependency to static-stack2nix-builder-example
, but didn't get far enough because with this patch:
diff -ru static-stack2nix-builder-example/default.nix static-stack2nix-builder-example-sqlite/default.nix
--- static-stack2nix-builder-example/default.nix 2019-06-12 18:55:17.738253636 +0200
+++ static-stack2nix-builder-example-sqlite/default.nix 2019-07-21 03:59:42.133934161 +0200
@@ -17,7 +17,7 @@
stack2nix-script = import "${static-haskell-nix}/static-stack2nix-builder/stack2nix-script.nix" {
inherit pkgs;
stack-project-dir = toString ./.; # where stack.yaml is
- hackageSnapshot = "2019-05-08T00:00:00Z"; # pins e.g. extra-deps without hashes or revisions
+ hackageSnapshot = "2019-07-21T00:00:00Z"; # pins e.g. extra-deps without hashes or revisions
};
static-stack2nix-builder = import "${static-haskell-nix}/static-stack2nix-builder/default.nix" {
diff -ru static-stack2nix-builder-example/example-project.cabal static-stack2nix-builder-example-sqlite/example-project.cabal
--- static-stack2nix-builder-example/example-project.cabal 2019-05-24 01:01:22.576306658 +0200
+++ static-stack2nix-builder-example-sqlite/example-project.cabal 2019-07-21 03:57:26.499945454 +0200
@@ -4,7 +4,7 @@
--
-- see: https://github.com/sol/hpack
--
--- hash: f29499e26d59c63f4043d8f0d8ba9bf25eb9fb9877cde46564e5e1579fe55b11
+-- hash: 7183d88b8421062f436818b1310200068f08e2ca5b811690a7668a79bdf72bbc
name: example-project
version: 0.1.0.0
@@ -33,5 +33,6 @@
ghc-options: -threaded -rtsopts -with-rtsopts=-N
build-depends:
base >=4.7 && <5
+ , direct-sqlite
, example-project
default-language: Haskell2010
diff -ru static-stack2nix-builder-example/package.yaml static-stack2nix-builder-example-sqlite/package.yaml
--- static-stack2nix-builder-example/package.yaml 2019-05-24 01:01:22.576306658 +0200
+++ static-stack2nix-builder-example-sqlite/package.yaml 2019-07-21 03:57:09.252200133 +0200
@@ -20,3 +20,4 @@
- -with-rtsopts=-N
dependencies:
- example-project
+ - direct-sqlite
Only in static-stack2nix-builder-example-sqlite/.stack-work: dist
Only in static-stack2nix-builder-example-sqlite/.stack-work/install/x86_64-linux: 7d6d968be153d4dcc0edab19f77cd81934e5dbcbcb69dad0082c318db701ea3b
Only in static-stack2nix-builder-example-sqlite/.stack-work/install/x86_64-linux: lts-13.28
diff -ru static-stack2nix-builder-example/stack.yaml static-stack2nix-builder-example-sqlite/stack.yaml
--- static-stack2nix-builder-example/stack.yaml 2019-05-24 01:01:22.576306658 +0200
+++ static-stack2nix-builder-example-sqlite/stack.yaml 2019-07-21 03:57:18.896057766 +0200
@@ -1,3 +1,3 @@
-resolver: lts-13.15
+resolver: lts-13.28
packages:
- .
Only in static-stack2nix-builder-example-sqlite: stack.yaml.lock
I get the well-known and dreaded failure:
Determined cabalPackageId as Cabal-2.4.1.0-9MZFDeNrcJI10bcroa6pq8
setupCompileFlags: -package-id Cabal-2.4.1.0-9MZFDeNrcJI10bcroa6pq8
<command line>: cannot satisfy -package-id Cabal-2.4.1.0-9MZFDeNrcJI10bcroa6pq8
(use -v for more information)
Looks like one more case where my overriding to use patched Cabal isn't perfect yet (brought to light because direct-sqlite
somehow recursively depends on Cabal
).
Attached is an example project. I didn't get the cabal problem, it did compile the patched cabal for me.
Yes, i don't directly depend on direct-sqlite, but i pass systemlib
flag, so it doesn't link to the amalgamated sqlite on their repo.
I've found the solution.
Uses just .pkgs
, not the pkgsWithArchiveFiles
that have the sqlite that's overriden to have .a
files.
I'll push a fix soon.
PR in #41
@jpathy PR merged. Please try with the latest static-haskell-nix
, and reopen if it still doesn't work (it does work for me now).
It works now. Thanks for figuring it out.
Great! Sorry it took so long; was a bit unfortunate with some holidays in between.
On lts-13.28 stack2nix: user error (No such package ALUT-2.4.0.3 in the cabal database. Did you run cabal update?)