strange cabal build behaviour - won't detect changes to code files

172 Views Asked by At

This might have something to do with me working in a docker container, that is an ubuntu version of linux, with nix installed and plutus-starter cloned.

I'm currently updating a plutus script I wrote based on an older version of plutus-starter, so I'm trying to update it.

When I go into nix-shell and enter 'cabal build', I get a build error, which is unsurprising because there have been a lot of changes in plutus.

However, if I change the file, either in VS Code on my MacOS host, or using vim inside the nix-shell in the container, and then try 'cabal build' again, I get the exact same error.

Cabal is not reloading the modified file.

If I enter 'cabal repl', at first it shows the same error as 'cabal build' and has not loaded the current version of the file, BUT THEN if I specifically load the file while in cabal repl, it does actually see the change.

Why is 'cabal build' not seeing file changes?

Exiting the nix-shell and going back in does not fix this or refresh the file.

I've noticed that when I edit the file in VS Code, it does not seem to update the last modified time on the file, but using vim inside the container does update the modified time, and cabal build still doesn't see reload it.

Am I missing a ghc or cabal option somewhere?

My next attempt was to try to run my container as a VS Code devcontainer, but I can't even get nix-shell to work in that situation.

Is there a way to trigger cabal to check for code file updates?

the actual error isn't important, because no matter what nonsense I put in to replace 'Ledger.getDatum', the error is always the same. the error isn't relevant, but no matter what nonsense I put in to replace 'Ledger.getDatum', the error is always the same.

0

There are 0 best solutions below