Skip to content

Refactor before import warning#11773

Merged
mergify[bot] merged 1 commit into
haskell:masterfrom
cabalism:refactor/before-import-warning
May 16, 2026
Merged

Refactor before import warning#11773
mergify[bot] merged 1 commit into
haskell:masterfrom
cabalism:refactor/before-import-warning

Conversation

@philderbeast
Copy link
Copy Markdown
Collaborator

@philderbeast philderbeast commented Apr 30, 2026

Split from #10933, the refactoring and the sorting changes without the duplicate import by alternate paths detection, as requested by @ulysses4ever.

  • Add a new module cabal-install/src/Distribution/Client/ProjectConfig/Import.hs and move some stuff there from cabal-install-solver/src/Distribution/Solver/Types/ProjectConfigPath.hs that was only ever used in cabal-install.

For messages, I added some doctests and ended up with two ways of comparing ProjectConfigPath.

-- | A comparison that puts projects first, URLs last and sorts the other paths
-- lexically.
compareLexicographically :: ProjectConfigPath -> ProjectConfigPath -> Ordering

-- | A comparison that puts projects first, URLs last and sorts the other paths
-- by putting longer paths after shorter ones as measured by the number of path
-- segments. If still equal, then sorting is lexical.
compareSegmentally:: ProjectConfigPath -> ProjectConfigPath -> Ordering

I'll squash commits before applying the merge label if this pull request is approved.


Template Α: This PR modifies behaviour or interface

Include the following checklist in your PR:

Copy link
Copy Markdown
Collaborator

@ulysses4ever ulysses4ever left a comment

Choose a reason for hiding this comment

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

Thanks a lot for splitting it --- it helped reviewing a lot! A couple nitpicks inline.

Comment thread cabal.validate.project
Comment thread cabal-install/src/Distribution/Client/ProjectConfig/Import.hs Outdated
@philderbeast philderbeast force-pushed the refactor/before-import-warning branch from 83257e1 to 0874d33 Compare May 4, 2026 17:36
@philderbeast philderbeast force-pushed the refactor/before-import-warning branch 2 times, most recently from 7310351 to 069d489 Compare May 13, 2026 15:41
@ulysses4ever
Copy link
Copy Markdown
Collaborator

One little nitpick: I can't quite parse the PR title "Refactor/before import warning". Could you turn into something more readable?

@philderbeast philderbeast changed the title Refactor/before import warning Refactor before import warning May 13, 2026
@philderbeast
Copy link
Copy Markdown
Collaborator Author

Sorry about that @ulysses4ever. That was the branch name. I've removed the needless "/" separator.

Copy link
Copy Markdown
Member

@Mikolaj Mikolaj left a comment

Choose a reason for hiding this comment

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

Thank you.

- Move fetchImportConfig to Import module
- Move fetchImportParse to Import module
- Nest fetchImportConfig within fetchImportParse
- Move cyclicalImportMsg to cabal-install
- Move untrimmedUriImportMsg to cabal-install
- Move docProjectConfigFiles to cabal-install
- Add compareLexically & compareSegmentally
- Update hops test expectation for lexical sort
- Remove +legacy-comparison
- Satisfy fourmolu
- Add change log entry
- s/lexically/lexicographically/
- s/fetchImportParse/fetchImport/
@philderbeast philderbeast force-pushed the refactor/before-import-warning branch from 069d489 to de5211a Compare May 14, 2026 18:31
@philderbeast philderbeast added the merge me Tell Mergify Bot to merge label May 14, 2026
@mergify mergify Bot added ready and waiting Mergify is waiting out the cooldown period merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days queued labels May 14, 2026
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented May 16, 2026

Merge Queue Status

This pull request spent 1 hour 50 minutes 59 seconds in the queue, including 1 hour 40 minutes 40 seconds running CI.

Required conditions to merge
  • #approved-reviews-by >= 2 [🛡 GitHub branch protection]
  • #changes-requested-reviews-by = 0 [🛡 GitHub branch protection]
  • #review-threads-unresolved = 0 [🛡 GitHub branch protection]
  • any of [🛡 GitHub branch protection]:
    • check-success = Doctest Cabal
    • check-neutral = Doctest Cabal
    • check-skipped = Doctest Cabal
  • any of [🛡 GitHub branch protection]:
    • check-success = Meta checks
    • check-neutral = Meta checks
    • check-skipped = Meta checks
  • any of [🛡 GitHub branch protection]:
    • check-success = docs/readthedocs.org:cabal
    • check-neutral = docs/readthedocs.org:cabal
    • check-skipped = docs/readthedocs.org:cabal
  • any of [🛡 GitHub branch protection]:
    • check-success = Validate post job
    • check-neutral = Validate post job
    • check-skipped = Validate post job
  • any of [🛡 GitHub branch protection]:
    • check-success = fourmolu
    • check-neutral = fourmolu
    • check-skipped = fourmolu
  • any of [🛡 GitHub branch protection]:
    • check-success = hlint
    • check-neutral = hlint
    • check-skipped = hlint
  • any of [🛡 GitHub branch protection]:
    • check-success = Bootstrap post job
    • check-neutral = Bootstrap post job
    • check-skipped = Bootstrap post job
  • any of [🛡 GitHub branch protection]:
    • check-success = whitespace
    • check-neutral = whitespace
    • check-skipped = whitespace
  • any of [🛡 GitHub branch protection]:
    • check-success = Check sdist post job
    • check-neutral = Check sdist post job
    • check-skipped = Check sdist post job
  • any of [🛡 GitHub branch protection]:
    • check-success = Changelogs
    • check-neutral = Changelogs
    • check-skipped = Changelogs

mergify Bot added a commit that referenced this pull request May 16, 2026
mergify Bot added a commit that referenced this pull request May 16, 2026
@mergify mergify Bot merged commit 52bd676 into haskell:master May 16, 2026
212 checks passed
@mergify mergify Bot removed the queued label May 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days merge me Tell Mergify Bot to merge ready and waiting Mergify is waiting out the cooldown period type: refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants