Liqwid-Labs / plutus-extra

Helper libraries for Plutus.
Apache License 2.0
50 stars 30 forks source link

`nat` quasi-quoter breaks haskell-language-server #153

Open AriFordsham opened 2 years ago

AriFordsham commented 2 years ago

Using haskell-language-server, adding a use of the nat quasi-quoter causes HLS to stop working and just report one error:

GHC runtime linker: fatal error: I found a duplicate definition for symbol
   sqlite3_fts3_may_be_corrupt
whilst processing object file
   /nix/store/w43xg9ni6gk28ndl1mgzlinb2dxxpdci-persistent-sqlite-lib-persistent-sqlite-2.13.0.3/lib/x86_64-linux-ghc-8.10.4.20210212/persistent-sqlite-2.13.0.3-8rnIaulr0SMFWDeiU7TZN4/HSpersistent-sqlite-2.13.0.3-8rnIaulr0SMFWDeiU7TZN4.o
The symbol was previously defined in
   /nix/store/ck5zqxqir93dighfhr2rkxr09bwv7qsk-direct-sqlite-lib-direct-sqlite-2.3.26/lib/x86_64-linux-ghc-8.10.4.20210212/direct-sqlite-2.3.26-Gg0YVBPVrMk3LDxZxB2Bzf/HSdirect-sqlite-2.3.26-Gg0YVBPVrMk3LDxZxB2Bzf.o
This could be caused by:
   * Loading two different object files which export the same symbol
   * Specifying the same object file twice on the GHCi command line
   * An incorrect `package.conf' entry, causing some object to be
     loaded twice.

No idea if this is the fault of plutus-extra, HLS, GHC, or something else, but putting on record here until we can get more insight.

AriFordsham commented 2 years ago

Dependencies of the offending packages, from nix-store --query --referrers (sorted):

From direct-sql:

/nix/store/0iq9ls34frcn04ymnapiwmxj1g09840z-plutus-extra-lib-plutus-extra-3.0
/nix/store/0jqdcar9bv9yj9cnwvfwya0x07k0gk1x-plutus-pab-lib-plutus-pab-0.1.0.0-haddock-config
/nix/store/11j2b75drppz0p7hiw7jvdc3y82xkrkv-plutus-golden-lib-plutus-golden-2.0-haddock-config
/nix/store/1kpvywskh90002ivkv0y2pv46zj3qsal-playground-common-lib-playground-common-0.1.0.0-haddock-config
/nix/store/1ln0mbr2pp6hxc3z2dspfz69bv6ngy4r-plutus-playground-server-lib-plutus-playground-server-0.1.0.0
/nix/store/24bf4inj87yln9hij504m2wf8q4fj23x-web-ghc-lib-web-ghc-0.1.0.0-config
/nix/store/2h6692b1q36k08fqlj890l1rnczf0nly-plutus-contract-lib-plutus-contract-0.1.0.0
/nix/store/2la7n12is4dcsbqmc8yzd0jy7rhncmww-direct-sqlite-lib-direct-sqlite-2.3.26
/nix/store/2mav420phq8br7vb3n5gys1g2mqacn62-plutus-ledger-lib-plutus-ledger-0.1.0.0
/nix/store/3408alif7dcw3rv6vlwhz8g4v3ppayk9-direct-sqlite-lib-direct-sqlite-2.3.26-haddock
/nix/store/40qvaql1nyxj2hindl0jb8310zb4d390-ghc-shell-for-packages-config
/nix/store/4qdycd2w8hp5gwlrjzc4wp8p5ax3kfbh-plutus-numeric-lib-plutus-numeric-2.3-haddock-config
/nix/store/5nvqgkghwi15q0fi9v8m12rb8rip0rc9-ghc-shell-for-packages-config
/nix/store/69b21s35p0l5643qn1m7h4ql25r5ys10-playground-common-lib-playground-common-0.1.0.0
/nix/store/6a4m22dzpahd9m2y7in9d5b4n7ignsdz-beam-sqlite-lib-beam-sqlite-0.5.1.0-haddock-config
/nix/store/6g4wb4frlx39k63v3pyl1p9k3iq131l5-ghc-shell-for-packages-config
/nix/store/7lwc6gfjdbm692ifd5ir01wqg69xp7pl-plutus-playground-server-lib-plutus-playground-server-0.1.0.0-haddock-config
/nix/store/7ns1w34c4q4jsfd94qdg99yqc6w97zmz-plutus-chain-index-core-lib-plutus-chain-index-core-0.1.0.0
/nix/store/8rz22fnhwprr17dvql3x98qhxwwvs7l7-sqlite-simple-lib-sqlite-simple-0.4.18.0-haddock-config
/nix/store/9fa8dx23j7p8g4n7yf0v9fshmfq0dgvb-plutus-ledger-lib-plutus-ledger-0.1.0.0-haddock-config
/nix/store/9i260zlddh4xqm9kv9lb1ckb7271992i-plutus-chain-index-lib-plutus-chain-index-0.1.0.0
/nix/store/a2r8wawxlpfpc2m71drqv01bc7mcr1rm-ghc-shell-for-packages-config
/nix/store/a4b2dvzq14iz412xlq7zkvhzl4mimspp-beam-sqlite-lib-beam-sqlite-0.5.1.0-config
/nix/store/b414yr5xpi5xq7lxrcbm5qvs279cms2i-plutus-use-cases-lib-plutus-use-cases-0.1.0.0-haddock-config
/nix/store/c2y6ddvqwgj179i4ryv5dvsx99hrnnsp-plutus-contract-lib-plutus-contract-0.1.0.0-config
/nix/store/c42jxk6q5dal3rnkrs19cl8lkvczwxg9-ghc-shell-for-packages-config
/nix/store/c65c0csy4nkmdvj3d7wbwxy8zk5vx4mq-web-ghc-lib-web-ghc-0.1.0.0
/nix/store/cnrxadim71jqhyiv4jz8j7hy5wrmp1q8-tasty-plutus-lib-tasty-plutus-4.0-haddock-config
/nix/store/cpl5myazkrj4s8ihr3s53bf1c1pvvglq-sqlite-simple-lib-sqlite-simple-0.4.18.0
/nix/store/cpwwim9iw2vk804zkc0s2w2p14s2lsdi-plutus-ledger-lib-plutus-ledger-0.1.0.0-config
/nix/store/dh8lag7kf3hw874cnc2j03px7i8xyxbg-web-ghc-lib-web-ghc-0.1.0.0-haddock-config
/nix/store/dimjh5nwzyzbikf239ff6d4z5q91d3j3-plutus-pab-lib-plutus-pab-0.1.0.0
/nix/store/i8gdkjxq683gfymxg41p3h2q2lawrp43-playground-common-lib-playground-common-0.1.0.0-config
/nix/store/j6yp44s60xg1k4r787is3xl0bywj9jcx-plutus-use-cases-lib-plutus-use-cases-0.1.0.0-config
/nix/store/jz0c43a780rsn0l4pisszqviz5i6gr5x-plutus-extra-lib-plutus-extra-3.0-haddock-config
/nix/store/k7msahima7grq1d0s1zwfsyi38i0z4qc-plutus-chain-index-core-lib-plutus-chain-index-core-0.1.0.0-config
/nix/store/k7yzn4dd0izfrcly18dzspds66yzb5w7-beam-sqlite-lib-beam-sqlite-0.5.1.0
/nix/store/kd0ydp8zcxrbc22kis7rm4794gxhnxy7-freer-extras-lib-freer-extras-0.1.0.0-config
/nix/store/krqa4kbgnscmijx5d02wxac1by1k4yqb-plutus-chain-index-core-lib-plutus-chain-index-core-0.1.0.0-haddock-config
/nix/store/l1b4qmwp1ksdr76nl1nqiv63x0icwa2p-plutus-extra-lib-plutus-extra-3.0-config
/nix/store/l7vf61vmlpizd9x5g8dsdjjr3zjsz3ry-plutus-contract-lib-plutus-contract-0.1.0.0-haddock-config
/nix/store/n3y9j29idzx8vp41pblz1ixsccsh52nw-plutus-use-cases-lib-plutus-use-cases-0.1.0.0
/nix/store/nzxgc13fdwf3gs0bqxlhsabkzj46c4wx-freer-extras-lib-freer-extras-0.1.0.0-haddock-config
/nix/store/pc5791lc5l4biplga6i74aj5ah3jb9qv-plutus-chain-index-lib-plutus-chain-index-0.1.0.0-haddock-config
/nix/store/qn2wy68awh1ghdmpdcckp9z75hj1yjb6-plutus-pab-lib-plutus-pab-0.1.0.0-config
/nix/store/rmvsy125gccm128lmwxq87rjc61480p8-quickcheck-plutus-instances-lib-quickcheck-plutus-instances-1.2
/nix/store/rxnl4q3jzjw7g4llvxa05jgpvjdnyz2z-tasty-plutus-lib-tasty-plutus-4.0
/nix/store/vphbfagxrzyqiascp2hhsi15bhq6xhrr-plutus-playground-server-lib-plutus-playground-server-0.1.0.0-config
/nix/store/vzkrsz8plzcam76biwjz8k1gm8yr7vvi-quickcheck-plutus-instances-lib-quickcheck-plutus-instances-1.2-haddock-config
/nix/store/ww07akp0jn55kz22s1v61v92c3smh5w9-plutus-numeric-lib-plutus-numeric-2.3
/nix/store/xfldf6lqg9kpynw5vknkichhrplylz1b-sqlite-simple-lib-sqlite-simple-0.4.18.0-config
/nix/store/xsm996k7dfbcp8l0x65fba2xiw83i7nr-plutus-chain-index-lib-plutus-chain-index-0.1.0.0-config
/nix/store/xzsqsq9q9dqhbr5n2niyz0pizwj8d1qh-freer-extras-lib-freer-extras-0.1.0.0
/nix/store/zbiy3i3m7d1y5w3p0hmfxjlsllnggybd-plutus-golden-lib-plutus-golden-2.0

From persistent-sql:

/nix/store/0iq9ls34frcn04ymnapiwmxj1g09840z-plutus-extra-lib-plutus-extra-3.0
/nix/store/0jqdcar9bv9yj9cnwvfwya0x07k0gk1x-plutus-pab-lib-plutus-pab-0.1.0.0-haddock-config
/nix/store/11j2b75drppz0p7hiw7jvdc3y82xkrkv-plutus-golden-lib-plutus-golden-2.0-haddock-config
/nix/store/1kpvywskh90002ivkv0y2pv46zj3qsal-playground-common-lib-playground-common-0.1.0.0-haddock-config
/nix/store/1ln0mbr2pp6hxc3z2dspfz69bv6ngy4r-plutus-playground-server-lib-plutus-playground-server-0.1.0.0
/nix/store/24bf4inj87yln9hij504m2wf8q4fj23x-web-ghc-lib-web-ghc-0.1.0.0-config
/nix/store/2h6692b1q36k08fqlj890l1rnczf0nly-plutus-contract-lib-plutus-contract-0.1.0.0
/nix/store/2mav420phq8br7vb3n5gys1g2mqacn62-plutus-ledger-lib-plutus-ledger-0.1.0.0
/nix/store/40qvaql1nyxj2hindl0jb8310zb4d390-ghc-shell-for-packages-config
/nix/store/41nx26a8hkgdm7c129fyxw1xm4w1bd9x-persistent-sqlite-lib-persistent-sqlite-2.13.0.3
/nix/store/4qdycd2w8hp5gwlrjzc4wp8p5ax3kfbh-plutus-numeric-lib-plutus-numeric-2.3-haddock-config
/nix/store/4x3bshy7siz2a6fvcg0nf7kk6shzg5sw-ghc-shell-for-packages-env
/nix/store/5nvqgkghwi15q0fi9v8m12rb8rip0rc9-ghc-shell-for-packages-config
/nix/store/69b21s35p0l5643qn1m7h4ql25r5ys10-playground-common-lib-playground-common-0.1.0.0
/nix/store/6g4wb4frlx39k63v3pyl1p9k3iq131l5-ghc-shell-for-packages-config
/nix/store/7lwc6gfjdbm692ifd5ir01wqg69xp7pl-plutus-playground-server-lib-plutus-playground-server-0.1.0.0-haddock-config
/nix/store/7ns1w34c4q4jsfd94qdg99yqc6w97zmz-plutus-chain-index-core-lib-plutus-chain-index-core-0.1.0.0
/nix/store/94m1h7isnd7x0cn99yxdfmsrxbmswgvh-ghc-shell-for-packages-env
/nix/store/9fa8dx23j7p8g4n7yf0v9fshmfq0dgvb-plutus-ledger-lib-plutus-ledger-0.1.0.0-haddock-config
/nix/store/9i260zlddh4xqm9kv9lb1ckb7271992i-plutus-chain-index-lib-plutus-chain-index-0.1.0.0
/nix/store/a2r8wawxlpfpc2m71drqv01bc7mcr1rm-ghc-shell-for-packages-config
/nix/store/b414yr5xpi5xq7lxrcbm5qvs279cms2i-plutus-use-cases-lib-plutus-use-cases-0.1.0.0-haddock-config
/nix/store/c2y6ddvqwgj179i4ryv5dvsx99hrnnsp-plutus-contract-lib-plutus-contract-0.1.0.0-config
/nix/store/c42jxk6q5dal3rnkrs19cl8lkvczwxg9-ghc-shell-for-packages-config
/nix/store/c65c0csy4nkmdvj3d7wbwxy8zk5vx4mq-web-ghc-lib-web-ghc-0.1.0.0
/nix/store/cnrxadim71jqhyiv4jz8j7hy5wrmp1q8-tasty-plutus-lib-tasty-plutus-4.0-haddock-config
/nix/store/cpwwim9iw2vk804zkc0s2w2p14s2lsdi-plutus-ledger-lib-plutus-ledger-0.1.0.0-config
/nix/store/d08i57pi03wyn4ryi2lvyy3cc5z0rbvz-ghc-shell-for-packages-env
/nix/store/dh8lag7kf3hw874cnc2j03px7i8xyxbg-web-ghc-lib-web-ghc-0.1.0.0-haddock-config
/nix/store/dimjh5nwzyzbikf239ff6d4z5q91d3j3-plutus-pab-lib-plutus-pab-0.1.0.0
/nix/store/dy5q4vcm4x2zv7vpz3ddvy6r6gin6q2z-ghc-shell-for-packages-env
/nix/store/i8gdkjxq683gfymxg41p3h2q2lawrp43-playground-common-lib-playground-common-0.1.0.0-config
/nix/store/j6yp44s60xg1k4r787is3xl0bywj9jcx-plutus-use-cases-lib-plutus-use-cases-0.1.0.0-config
/nix/store/jz0c43a780rsn0l4pisszqviz5i6gr5x-plutus-extra-lib-plutus-extra-3.0-haddock-config
/nix/store/k7msahima7grq1d0s1zwfsyi38i0z4qc-plutus-chain-index-core-lib-plutus-chain-index-core-0.1.0.0-config
/nix/store/kagx5xm6zciccxnhk2416zh4ks69py8q-ghc-shell-for-packages-env
/nix/store/krqa4kbgnscmijx5d02wxac1by1k4yqb-plutus-chain-index-core-lib-plutus-chain-index-core-0.1.0.0-haddock-config
/nix/store/l1b4qmwp1ksdr76nl1nqiv63x0icwa2p-plutus-extra-lib-plutus-extra-3.0-config
/nix/store/l7vf61vmlpizd9x5g8dsdjjr3zjsz3ry-plutus-contract-lib-plutus-contract-0.1.0.0-haddock-config
/nix/store/n3y9j29idzx8vp41pblz1ixsccsh52nw-plutus-use-cases-lib-plutus-use-cases-0.1.0.0
/nix/store/pc5791lc5l4biplga6i74aj5ah3jb9qv-plutus-chain-index-lib-plutus-chain-index-0.1.0.0-haddock-config
/nix/store/qn2wy68awh1ghdmpdcckp9z75hj1yjb6-plutus-pab-lib-plutus-pab-0.1.0.0-config
/nix/store/qyk44kzhwny180h5b86biyn8dzsd5lfq-lorri-keep-env-hack-ghc-shell-for-packages
/nix/store/rmvsy125gccm128lmwxq87rjc61480p8-quickcheck-plutus-instances-lib-quickcheck-plutus-instances-1.2
/nix/store/rxnl4q3jzjw7g4llvxa05jgpvjdnyz2z-tasty-plutus-lib-tasty-plutus-4.0
/nix/store/sd20n0p16zhixm3fl7yd5n6kkxj3idhj-persistent-sqlite-lib-persistent-sqlite-2.13.0.3-haddock
/nix/store/vphbfagxrzyqiascp2hhsi15bhq6xhrr-plutus-playground-server-lib-plutus-playground-server-0.1.0.0-config
/nix/store/vyzlgh6aw5ph0pc8qr3p9dv6m5c16j3z-cardano-wallet-core-lib-cardano-wallet-core-2021.9.29-haddock-config
/nix/store/vzkrsz8plzcam76biwjz8k1gm8yr7vvi-quickcheck-plutus-instances-lib-quickcheck-plutus-instances-1.2-haddock-config
/nix/store/wczkbp1a34pmfk2r1fk6xslgs3kpzsc0-cardano-wallet-core-lib-cardano-wallet-core-2021.9.29
/nix/store/ww07akp0jn55kz22s1v61v92c3smh5w9-plutus-numeric-lib-plutus-numeric-2.3
/nix/store/xsm996k7dfbcp8l0x65fba2xiw83i7nr-plutus-chain-index-lib-plutus-chain-index-0.1.0.0-config
/nix/store/zbiy3i3m7d1y5w3p0hmfxjlsllnggybd-plutus-golden-lib-plutus-golden-2.0
kozross commented 2 years ago

This is definitely not on our end - according to the error message, this is stemming from persistent-sqlite and direct-sqlite. This is an issue with Plutus if anything, since both are dependencies of theirs (directly), but not ours (except transitively).

I don't use HLS, and honestly think that if quasiquoters are causing this issue, it's better to report it to them if anything. It certainly looks really bad on their end if a quasiquoter this basic breaks them in such a strange way.

jeffhappily commented 2 years ago

As far as I can tell, the version of these two libraries doesn't change since it last worked

kozross commented 2 years ago

Has HLS received updates?

jeffhappily commented 2 years ago

I think so! And also the GHC version.

Previously we're using GHC 8.10.4.20210212 (a patched version) and the HLS from Plutus that's bind to that version, but after migrating to nix flakes, we moved to GHC 8.10.7 and the HLS from nixpkgs instead.

kozross commented 2 years ago

@AriFordsham Are you still seeing this issue? What version of HLS are we running now?

maciej-bendkowski commented 2 years ago

@kozross I'm experiencing the same issues. My HLS version is: haskell-language-server version: 1.5.1.0 (GHC: 8.10.7).

azaretsky commented 2 years ago

The error message is produced by hie-bios. The reason is hie-bios is built without -dynamic ghc option.