Skip to content
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

Cabal 3.8 does not appear to track extra-source-file rebuilds correctly #8632

Closed
michaelpj opened this issue Dec 12, 2022 · 3 comments · Fixed by #8640
Closed

Cabal 3.8 does not appear to track extra-source-file rebuilds correctly #8632

michaelpj opened this issue Dec 12, 2022 · 3 comments · Fixed by #8640

Comments

@michaelpj
Copy link
Collaborator

Describe the bug
A clear and concise description of what the bug is.

To Reproduce

It's large, but here's the reproducer: https://github.com/input-output-hk/plutus

cabal build plutus-core:plutus-core
# edit plutus-core/cost-model/data/builtinCostModel.json
cabal v2-build plutus-core:plutus-core
# observe no recompliation

Expected behavior

Since there is a file that depends on plutus-core/cost-model/data/builtinCostModel.json using addDependentFile, I would expect modifying it to trigger a rebuild.

System information

  • NixOS
  • cabal 3.8.1
  • ghc 9.2.4

Additional context

We've confirmed that this works on cabal 3.6.2, and not on 3.8.1. I've tried a few semi-random things to try and get cabal to notice the change:

  • Move the file to the package root to avoid directory separators in the pattern.
  • Remove all the other extra-source-files
  • Explicitly add a call to addDependentFile <path> to the relevant module.
  • Changing to use a wildcard match on the file extension
  • Bumping the cabal-version of the cabal file
  • Add the package directory to the extra-source-file path in case there was a CWD mixup and it was looking from the project root somehow.

None of these have worked.

@gbaz
Copy link
Collaborator

gbaz commented Dec 24, 2022

First I want to clear up a confusion. As far as I know, addDependentFile never was tracked by cabal. What did happen was there was a patch (#6889) to add extra source files to cabal's rebuild tracking. I would very much like to figure out why that seems to no longer work.

[EDIT -- for now I think I found the flag to twiddle to stop requiring the nix shell]

@gbaz
Copy link
Collaborator

gbaz commented Dec 24, 2022

Additionally, can it be that this tracking works in a single cabal package, but it is the introduction of multiple packages in a joint cabal-project that breaks it?

@gbaz gbaz changed the title Cabal 3.8 does not appear to track addDependentFile dependencies correctly Cabal 3.8 does not appear to track extra-source-file rebuilds correctly Dec 24, 2022
@michaelpj
Copy link
Collaborator Author

Sorry not to have a smaller reproducer, I didn't have time to make one and I thought this was better than nothing :(

I could have tested your hypotheses out for you but it looks like you found it already, which is excellent, thank you!

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

Successfully merging a pull request may close this issue.

3 participants