Skip to content

use --store-dir for haskell - #3731

Closed
Baltsat wants to merge 1 commit into
pre-commit:mainfrom
Baltsat:fix/3501-haskell-store-dir
Closed

use --store-dir for haskell#3731
Baltsat wants to merge 1 commit into
pre-commit:mainfrom
Baltsat:fix/3501-haskell-store-dir

Conversation

@Baltsat

@Baltsat Baltsat commented Jul 25, 2026

Copy link
Copy Markdown

Summary

Configure Cabal’s package store inside the pre-commit-managed Haskell environment instead of leaving it in the user-level store.

  • pass --store-dir <hook-env>/store as a Cabal global option
  • keep the existing copied executable directory unchanged
  • add focused command-construction coverage, including an environment path containing spaces
  • extend the existing live Haskell dependency test to assert that the environment-local store is created

Fixes #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 deselected
  • python -m pytest --collect-only -q tests/languages/haskell_test.py — 4 tests collected
  • python -m compileall -q pre_commit/languages/haskell.py tests/languages/haskell_test.py
  • python -m tabnanny pre_commit/languages/haskell.py tests/languages/haskell_test.py
  • git diff --check

The focused regression fails on current main because the command lacks --store-dir and 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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@yangfan-yf-yf yangfan-yf-yf left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@asottile asottile closed this Jul 25, 2026
@pre-commit pre-commit locked as spam and limited conversation to collaborators Jul 25, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Use --store-dir for haskell

4 participants