Skip to content

Backport #12069: Add project monitoring logging#12082

Merged
mergify[bot] merged 1 commit into
3.18from
mergify/bp/3.18/pr-12069
Jul 4, 2026
Merged

Backport #12069: Add project monitoring logging#12082
mergify[bot] merged 1 commit into
3.18from
mergify/bp/3.18/pr-12069

Conversation

@mergify

@mergify mergify Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Split from #11884. Adds project file monitoring logging at the info level with tests. Logging at the info level is not marked so what I do for the tests is export and use mkNormalizerEnv for normalized comparisons.

Important

Removes the assertion "stanzas explicitly disabled should not be available", see #12067 and #11568.

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

Manual QA

This command will surface the monitoring:

$ cabal run cabal-install -- build all --dry-run \
  --project-dir=cabal-testsuite/PackageTests/ProjectImport/FileMonitoring/ -v2
...
Monitor existing:
/home/.../cabal/cabal-testsuite/PackageTests/ProjectImport/FileMonitoring/cabal.project
Monitor imported: cabal.project
(/home/.../cabal/cabal-testsuite/PackageTests/ProjectImport/FileMonitoring/cabal.project)
Monitor imported: cabal.project
(/home/.../cabal/cabal-testsuite/PackageTests/ProjectImport/FileMonitoring/cabal.project)
Monitor imported: cabal.project
(/home/.../cabal/cabal-testsuite/PackageTests/ProjectImport/FileMonitoring/cabal.project)
Monitor nonexistent:
/home/.../cabal/cabal-testsuite/PackageTests/ProjectImport/FileMonitoring/cabal.project.freeze
Monitor nonexistent:
/home/.../cabal/cabal-testsuite/PackageTests/ProjectImport/FileMonitoring/cabal.project.local

Note

The root cabal.project is logged as being monitored multiple times. Showing the root of the import path not the leaf as "Monitor imported: cabal.project" is a bug. I have a one-line fix for this problem, included and to be applied in a separate pull request, #11884.


Template Α: This PR modifies behaviour or interface

Include the following checklist in your PR:


This is an automatic backport of pull request #12069 done by [Mergify](https://mergify.com).

@mergify mergify Bot added the conflicts label Jul 3, 2026
@mergify

mergify Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

Cherry-pick of ffc9edd has failed:

On branch mergify/bp/3.18/pr-12069
Your branch is up to date with 'origin/3.18'.

You are currently cherry-picking commit ffc9edd42.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   cabal-install/src/Distribution/Client/ProjectPlanning.hs
	new file:   cabal-testsuite/PackageTests/ProjectImport/FileMonitoring/app/Main.hs
	new file:   cabal-testsuite/PackageTests/ProjectImport/FileMonitoring/cabal-project-repro.cabal
	new file:   cabal-testsuite/PackageTests/ProjectImport/FileMonitoring/cabal.freeze-only.actual.txt
	new file:   cabal-testsuite/PackageTests/ProjectImport/FileMonitoring/cabal.freeze-only.expect.txt
	new file:   cabal-testsuite/PackageTests/ProjectImport/FileMonitoring/cabal.freeze-only.project
	new file:   cabal-testsuite/PackageTests/ProjectImport/FileMonitoring/cabal.freeze-only.project.freeze
	new file:   cabal-testsuite/PackageTests/ProjectImport/FileMonitoring/cabal.local-only.actual.txt
	new file:   cabal-testsuite/PackageTests/ProjectImport/FileMonitoring/cabal.local-only.expect.txt
	new file:   cabal-testsuite/PackageTests/ProjectImport/FileMonitoring/cabal.local-only.project
	new file:   cabal-testsuite/PackageTests/ProjectImport/FileMonitoring/cabal.local-only.project.local
	new file:   cabal-testsuite/PackageTests/ProjectImport/FileMonitoring/cabal.main-project.actual.txt
	new file:   cabal-testsuite/PackageTests/ProjectImport/FileMonitoring/cabal.main-project.expect.txt
	new file:   cabal-testsuite/PackageTests/ProjectImport/FileMonitoring/cabal.project
	new file:   cabal-testsuite/PackageTests/ProjectImport/FileMonitoring/cabal.test.hs
	new file:   cabal-testsuite/PackageTests/ProjectImport/FileMonitoring/nested/deeply-nested/hop.config
	new file:   cabal-testsuite/PackageTests/ProjectImport/FileMonitoring/nested/hop.config
	new file:   cabal-testsuite/PackageTests/ProjectImport/FileMonitoring/test/Main.hs
	new file:   cabal-testsuite/PackageTests/ProjectImport/FileMonitoring/test/tests-toggle.config
	modified:   cabal-testsuite/src/Test/Cabal/Monad.hs
	new file:   changelog.d/12069.md

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   cabal-install/src/Distribution/Client/ProjectConfig.hs

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@mergify mergify Bot mentioned this pull request Jul 3, 2026
6 tasks
@mergify mergify Bot added the backport label Jul 3, 2026
@Mikolaj

Mikolaj commented Jul 3, 2026

Copy link
Copy Markdown
Member

@philderbeast: any idea what's missing to backport cleanly?

@philderbeast

Copy link
Copy Markdown
Collaborator

There's a merge conflict. Can I add a commit to fix those and remove the <<<<<<< and >>>>>>> markers?

$ grep -E "<<<<<|>>>>>" cabal-install/src/Distribution/Client/ProjectConfig.hs
<<<<<<< HEAD
>>>>>>> ffc9edd42 (Add project monitoring test)
<<<<<<< HEAD
>>>>>>> ffc9edd42 (Add project monitoring test)

Comment thread cabal-install/src/Distribution/Client/ProjectConfig.hs Outdated
Comment thread cabal-install/src/Distribution/Client/ProjectConfig.hs Outdated
@Mikolaj

Mikolaj commented Jul 3, 2026

Copy link
Copy Markdown
Member

@philderbeast: yes, please kindly take over this backport.

@Mikolaj Mikolaj self-requested a review July 3, 2026 18:17
@philderbeast

Copy link
Copy Markdown
Collaborator

@Mikolaj I think we need to backport #11995 too. Shall I go ahead and do that?

@Mikolaj

Mikolaj commented Jul 3, 2026

Copy link
Copy Markdown
Member

Aha! Yes, please do that.

@philderbeast

Copy link
Copy Markdown
Collaborator

I'll close this one and try again with a fresh backport request.

@philderbeast

Copy link
Copy Markdown
Collaborator

Mergify doesn't create a new pull request but tries this one again. I'll fix the branch.

@philderbeast philderbeast reopened this Jul 4, 2026
- Add monitor existing and nonexistant files
- Test for expected monitoring
- Export mkNormalizerEnv
- Don't run configure on the local project
- Only show the absolute path if needed
- Remove assert, explicitly disabled not available
- Add only the test, note TODO and actual behaviour
- Don't check for verbatim monitoring on Windows

Co-Authored-By: Julian Ospald <hasufell@posteo.de>
(cherry picked from commit ffc9edd)
@philderbeast philderbeast force-pushed the mergify/bp/3.18/pr-12069 branch from e0f66c4 to 9afc173 Compare July 4, 2026 12:44
@philderbeast

Copy link
Copy Markdown
Collaborator

@Mikolaj this one is ready for review.

@Mikolaj Mikolaj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. Thank you.

@Mikolaj Mikolaj added the merge me Tell Mergify Bot to merge label Jul 4, 2026
@mergify mergify Bot added the queued label Jul 4, 2026
@mergify

mergify Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor Author

Merge Queue Status

  • Entered queue2026-07-04 20:44 UTC · Rule: default · triggered by rule Put backports in the rebase+merge queue
  • Checks skipped · PR is already up-to-date
  • Merged2026-07-04 20:55 UTC · at 9afc173e6b700db798fe23349c8a4134e1ea102c · merge

This pull request spent 10 minutes 37 seconds in the queue, including 1 second running CI.

Required conditions to merge
  • #review-threads-unresolved = 0 [🛡 GitHub branch protection]
  • github-review-approved [🛡 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 = Validate post job
    • check-neutral = Validate post job
    • check-skipped = Validate post job
  • 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 = 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 mergify Bot merged commit 927c1bd into 3.18 Jul 4, 2026
89 of 93 checks passed
@mergify mergify Bot deleted the mergify/bp/3.18/pr-12069 branch July 4, 2026 20:55
@mergify mergify Bot removed the queued label Jul 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport merge me Tell Mergify Bot to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants