Skip to content

Linking error while trying to build a haskell.nix project #1643

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

Closed
MangoIV opened this issue Sep 6, 2022 · 9 comments
Closed

Linking error while trying to build a haskell.nix project #1643

MangoIV opened this issue Sep 6, 2022 · 9 comments

Comments

@MangoIV
Copy link
Contributor

MangoIV commented Sep 6, 2022

When I build plutus-contract everything works fine but as soon as I'm trying to use it in another project I'm getting
<command line>: /nix/store/i3qmxk5w0nkxl3gab75lhzf57c2pq9hx-plutus-contract-lib-plutus-contract-1.0.0.0/lib/x86_64-linux-ghc-8.10.7/libHSplutus-contract-1.0.0.0-1AL5S92CBMQKDifUePrV6X-ghc8.10.7.so: undefined symbol: plutuszmcontractzm1zi0zi0zi0zm1AL5S92CBMQKDifUePrV6X_WalletziEffects_getClientParams1_closure

It's important to note that the function that's undefined is generate by template haskell, because there seem to be a bunch of related issues:
https://gitlab.haskell.org/ghc/ghc/-/issues/21423
haskell/cabal#8114
https://gitlab.haskell.org/ghc/ghc/-/issues/3799
The latter one looks exactly like my problem although it seems to be fixed for 10 years now.

Is is possible, that plutus-contractgets build with a different ghc that I get in my shell/ as soon as I try to build my library with nix?

I've tried running nix develop with --ignore-environment, building with nix build instead of cabal and all the other stuff you would normally try if you're desperate. I'm mainly looking for an idea of a starting point for how to debug this.

Thanks in advance.

@ocharles
Copy link
Contributor

ocharles commented Sep 6, 2022

https://raw.githubusercontent.com/MangoIV/plutus-contract/mangoiv/next-node/rip-out-plutus-contract-api/plutus-contract/plutus-contract.cabal doesn't mention Wallet.Effects in exposed-modules or other-modules. I suggest turning on -Wmissing-home-modules, there should have been a warning from the build of plutus-contract (this doesn't look like a Haskell.nix problem).

@MangoIV
Copy link
Contributor Author

MangoIV commented Sep 6, 2022

Thank you; how ignorant of me

@MangoIV MangoIV closed this as completed Sep 6, 2022
@ocharles
Copy link
Contributor

ocharles commented Sep 7, 2022

@MangoIV Don't worry - happens to all of us! I've seen that error enough times I'm laser focused on it by now 😄

@MangoIV
Copy link
Contributor Author

MangoIV commented Sep 7, 2022

The worst thing is when you're debugging Haskell.nix stuff for 7 days straight; at some point you don't even think of such trivial things.
Thank you for your help :)

@L-as
Copy link
Contributor

L-as commented Sep 7, 2022

Maybe -Werror=-Wmissing-home-modules could be enabled in haskell.nix by default?

@ocharles
Copy link
Contributor

ocharles commented Sep 7, 2022

I think that is too opinionated and the status quo is correct.

@L-as
Copy link
Contributor

L-as commented Sep 7, 2022

But almost all cases where the warning fires, the build would fail, no?

@L-as
Copy link
Contributor

L-as commented Sep 7, 2022

You could enable it just for the main project.

@ocharles
Copy link
Contributor

ocharles commented Sep 7, 2022

But almost all cases where the warning fires, the build would fail, no?

Sure, but I still don't think it's Haskell.nix's responsibility, much like it's not Cabal's responsibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants