Skip to content

Avoid use of parseIndexState #1903

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

Merged
merged 2 commits into from
Mar 27, 2023
Merged

Avoid use of parseIndexState #1903

merged 2 commits into from
Mar 27, 2023

Conversation

hamishmack
Copy link
Collaborator

The parseIndexState uses a very simple parser that breaks for cabal.project files with more complicated index-state: fields.

This will have some drawbacks:

  • There will no longer be a warning in the trace output if an index state was not found.

  • When hackage.nix is bumped the plan will be recomputed even if the index-state: in the cabal.project has not changed. We do not expect this to be a problem since recomputing the plan is normally relatively fast.

The `parseIndexState` uses a very simple parser that breaks for `cabal.project` files with more complicated `index-state:` fields.

This will have some drawbacks:

* There will no longer be a warning in the trace output if an index state was not found.

* When `hackage.nix` is bumped the plan will be recomputed even if the `index-state:` in the `cabal.project` has not changed. We do not expect this to be a problem since recomputing the plan is normally relatively fast.
@hamishmack hamishmack merged commit 9f75bfd into master Mar 27, 2023
@iohk-bors iohk-bors bot deleted the hkm/no-parse-index-state branch March 27, 2023 06:21
@michaelpj
Copy link
Collaborator

Could we in fact just purge all the index-state logic from this file, if we're trusting cabal to do it?

@hamishmack
Copy link
Collaborator Author

We still need it when building hackage projects. I guess we could passing a cabalProjectLocal with the index-state for that too.

@michaelpj
Copy link
Collaborator

We still need it when building hackage projects.

Do we? Won't cabal just pick HEAD if we don't do anything, which will implicitly be the latest thing in hackage.nix?

@hamishmack
Copy link
Collaborator Author

Do we? Won't cabal just pick HEAD if we don't do anything, which will implicitly be the latest thing in hackage.nix?

If you have tools and specify the index-state for them, but do not materialise them, then the code that is left will prevent the plans for all your tools recomputing when hackage.nix is bumped.

@michaelpj
Copy link
Collaborator

I guess that seems not that important to me? Most projects bump hackage.nix pretty rarely. Perhaps it matters for haskell.nix itself which gets daily PRs.

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

Successfully merging this pull request may close these issues.

2 participants