Skip to content

Add tests for autogen-modules as main-is#11457

Merged
mergify[bot] merged 1 commit intohaskell:masterfrom
cabalism:test/autogen-modules-main-is
Jan 28, 2026
Merged

Add tests for autogen-modules as main-is#11457
mergify[bot] merged 1 commit intohaskell:masterfrom
cabalism:test/autogen-modules-main-is

Conversation

@philderbeast
Copy link
Copy Markdown
Collaborator

A question came up in #11390.

Is it that autogen-modules can't be used with a custom main-is, or that the module in main-is can't be an autogenerated module.

These tests show, for executables, test suites and benchmarks, that autogenerated modules can be set as the main-is module and cabal act-as-setup configure will pass but cabal act-as-setup sdist will fail because it can't find the main module.


Template B: This PR does not modify behaviour or interface

E.g. the PR only touches documentation or tests, does refactorings, etc.

Include the following checklist in your PR:

  • Patches conform to the coding conventions.
  • Is this a PR that fixes CI? If so, it will need to be backported to older cabal release branches (ask maintainers for directions).

@philderbeast
Copy link
Copy Markdown
Collaborator Author

philderbeast commented Jan 23, 2026

So far these tests only use setup' that uses cabal act-as-setup. We could also try a cabal build with these packages:

$ cabal build MainIsExe --project-dir=.
Warning: this is a debug build of cabal-install with assertions enabled.
Resolving dependencies...
Build profile: -w ghc-9.12.2 -O1
In order, the following will be built (use -v for more details):
 - MainIsExe-0.1 (exe:Exe) (first run)
Warning: this is a debug build of cabal-install with assertions enabled.
Configuring executable 'Exe' for MainIsExe-0.1...
Warning: this is a debug build of cabal-install with assertions enabled.
Preprocessing executable 'Exe' for MainIsExe-0.1...
Error: [Cabal-7554]
can't find source for MyDummy in
  .
, dist-newstyle/build/x86_64-linux/ghc-9.12.2/MainIsExe-0.1/x/Exe/build/Exe/autogen
, dist-newstyle/build/x86_64-linux/ghc-9.12.2/MainIsExe-0.1/x/Exe/build/global-autogen
Error: [Cabal-7125]
Failed to build exe:Exe from MainIsExe-0.1.

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.

Yay, more (good!) tests. Thank you.

We could also try a cabal build with these packages

Yes, let's do!

@philderbeast philderbeast force-pushed the test/autogen-modules-main-is branch from dca02cd to c959050 Compare January 26, 2026 19:34
@philderbeast
Copy link
Copy Markdown
Collaborator Author

I've added the cabal build tests. The executable test fails with a different message to the test suite and benchmark tests that both fail with MyDummy.hs doesn't exist.

- MyDummy.hs doesn't exist
+ can't find source for MyDummy in ., cabal.dist/work/./dist/build/<ARCH>/ghc-<GHCVER>/MainIsExe-0.1/x/Exe/build/Exe/autogen, cabal.dist/work/./dist/build/<ARCH>/ghc-<GHCVER>/MainIsExe-0.1/x/Exe/build/global-autogen

@philderbeast philderbeast added merge me Tell Mergify Bot to merge and removed attention: needs-review labels Jan 26, 2026
- Add a test of cabal too
@philderbeast philderbeast force-pushed the test/autogen-modules-main-is branch from 8c30a3c to 11686ad Compare January 26, 2026 20:05
@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 Jan 26, 2026
@mergify
Copy link
Copy Markdown
Contributor

mergify Bot commented Jan 28, 2026

Merge Queue Status

✅ The pull request has been merged at 11686ad

This pull request spent 10 minutes 49 seconds in the queue, with no time running CI.
The checks were run in-place.

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 mergify Bot merged commit 6cc9c63 into haskell:master Jan 28, 2026
194 of 198 checks passed
@mergify mergify Bot removed the queued label Jan 28, 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants