use --store-dir for haskell - #3731
Closed
Baltsat wants to merge 1 commit into
Closed
Conversation
yangfan-yf-yf
approved these changes
Jul 25, 2026
yangfan-yf-yf
left a comment
There was a problem hiding this comment.
Reviewed b0e42c34a207d2e2589777abb21681cc612cb481.
The store directory is derived from the hook environment, while the existing copied executable directory and package selection remain unchanged. The command-construction assertion covers an environment path containing spaces, and the live dependency case verifies that the environment-local store is actually created.
Validation:
python -m pytest tests/languages/haskell_test.py -k test_install_uses_env_local_store -q
1 passed, 3 deselected
git diff --check HEAD^ HEAD
I could not run the two live Haskell cases locally because Cabal is not installed here. The upstream language (..., haskell) checks and the Linux/Windows main matrix are all successful.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Configure Cabal’s package store inside the pre-commit-managed Haskell environment instead of leaving it in the user-level store.
--store-dir <hook-env>/storeas a Cabal global optionFixes #3501
Validation
Passed in clean focused worktrees:
python -m pytest -q tests/languages/haskell_test.py -k test_install_uses_env_local_store— 1 passed, 3 deselectedpython -m pytest --collect-only -q tests/languages/haskell_test.py— 4 tests collectedpython -m compileall -q pre_commit/languages/haskell.py tests/languages/haskell_test.pypython -m tabnanny pre_commit/languages/haskell.py tests/languages/haskell_test.pygit diff --checkThe focused regression fails on current main because the command lacks
--store-dirand passes after the change. Cabal and GHC were unavailable in the worker VM, so the live Haskell integration assertion and full repository suite were not executed locally; this is left to upstream CI.