input-output-hk / haskell.nix

Alternative Haskell Infrastructure for Nixpkgs
https://input-output-hk.github.io/haskell.nix
Apache License 2.0
558 stars 240 forks source link

Unfoldings are less exposed #1525

Closed L-as closed 11 months ago

L-as commented 2 years ago

See e.g. https://github.com/input-output-hk/plutus/pull/4651

In addition, internally at MLabs we have plutus-tx projects that work with cabal build, but when building with haskell.nix, it gives the following non-sense error message:

GHC Core to PLC plugin: E043:Error: Reference to a name which is not a local, a builtin, or an external INLINABLE function: Variable PlutusTx.Base.$

$ is marked as INLINABLE: https://github.com/input-output-hk/plutus/blob/ab3d01280109c1b5d1522f9bae475f5984fbc055/plutus-tx/src/PlutusTx/Base.hs#L26

I don't have a minimal reproducible example unfortunately.

L-as commented 2 years ago

I wonder how much performance we're missing out on.

hamishmack commented 2 years ago

This might be a problem with one of the GHC patches haskell.nix applies. Perhaps the unboxed tuple one?

I don't have a minimal reproducible example unfortunately.

A large one would be fine. I've looked on hydra logs in https://hydra.iohk.io/jobset/Cardano/plutus, https://hydra.iohk.io/jobset/Cardano/plutus-pr-4552 and https://hydra.iohk.io/jobset/Cardano/plutus-pr-4651, but could not find the error in question anywhere.

L-as commented 2 years ago

This might be a problem with one of the GHC patches haskell.nix applies. Perhaps the unboxed tuple one?

I don't have a minimal reproducible example unfortunately.

A large one would be fine. I've looked on hydra logs in https://hydra.iohk.io/jobset/Cardano/plutus, https://hydra.iohk.io/jobset/Cardano/plutus-pr-4552 and https://hydra.iohk.io/jobset/Cardano/plutus-pr-4651, but could not find the error in question anywhere.

The PR doesn't err, it just doesn't inline the function.

hamishmack commented 2 years ago

So if I revert that PR and run something will it break? What should I run?

L-as commented 2 years ago

I'm not sure what a could way to detect this would be, @michaelpj has more experience with this.

L-as commented 2 years ago

With Plutus projects, it's very common to do doHaddock = false on various dependencies, and it seems to be related to this too.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

L-as commented 1 year ago

This is definitely still an issue, and also quite important.

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

pgrange commented 1 year ago

I stumbled upon a similar issue:

GHC Core to PLC plugin: E043:Error: Reference to a name which is not a local, a builtin, or an external INLINABLE function: Variable Plutus.Extras.wrapValidator

But as far as I can tell, wrapValidator is inlineable.

Step to reproduce:

git clone https://github.com/input-output-hk/hydra.git
cd hydra
nix build .?submodules=1#hydraProject.x86_64-linux.hsPkgs.hydra-plutus.components.library.doc
stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.