Skip to content

Add PackageInfos_ (#3909) - #8534

Merged
mergify[bot] merged 1 commit into
haskell:masterfrom
blackheaven:package-infos-module
Dec 31, 2022
Merged

mergify[bot] merged 1 commit into
haskell:masterfrom
blackheaven:package-infos-module

Conversation

@blackheaven

@blackheaven blackheaven commented Oct 15, 2022 •

Copy link
Copy Markdown
Collaborator

It's a first attempt, I'm open to feedback.


Please include the following checklist in your PR:

Comment thread doc/cabal-package.rst Resolved
@Mikolaj

Mikolaj commented Oct 15, 2022

Copy link
Copy Markdown
Member

Thanks a lot! So, does this intend to fix #3909 completely or partially? Would you be able to come up with a simple test for the functionality? (It's the easiest to copy-paste and tweak an existing PackageTest or even add a clause to one if it already tests something close enough.) A tiny changelog file would be appreciated as well.

@blackheaven

Copy link
Copy Markdown
Collaborator Author

I'm lost, which changelog should I append my contribution to?

@ulysses4ever

Copy link
Copy Markdown
Collaborator

@blackheaven there's a checklist in the PR template, it has a reference for the changelog process

@blackheaven

Copy link
Copy Markdown
Collaborator Author

Finally

@blackheaven

Copy link
Copy Markdown
Collaborator Author

Is there anything I can do to help the merge?

@chreekat

chreekat commented Nov 7, 2022

Copy link
Copy Markdown
Collaborator

Hi, the impl looks fine and I'm glad this would solve a closure bloat problem in Nixpkgs!

My feedback mostly has to do with English and words in general:

@blackheaven

Copy link
Copy Markdown
Collaborator Author

Thanks for your feedback, I did my best to take them in account, however, if you can highlight my typos, I'd be grateful.

@chreekat chreekat left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nice!

Comment on lines +654 to +655
++ "module PackageInfo_* must include it also on the 'autogen-modules' field "
++ "besides 'exposed-modules' and 'other-modules'. This specifies that "

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
++ "module PackageInfo_* must include it also on the 'autogen-modules' field "
++ "besides 'exposed-modules' and 'other-modules'. This specifies that "
++ "module PackageInfo_* must include it in 'autogen-modules' as well as"
++ " 'exposed-modules' and 'other-modules'. This specifies that "

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I fixed it, but it's a copy-and-paste from Paths_*

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

haha :) The original is what I would consider "European English": used widely among non-native speakers, understandable, but different from what a native speaker would say. I almost considered just leaving it, because I think it's better to say it's dialectical rather than "wrong". Fine either way

Comment thread doc/cabal-package.rst Resolved
@blackheaven

Copy link
Copy Markdown
Collaborator Author

Let me know if I can do something to improve this PR, or if I can squash it

@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

@Mikolaj

Mikolaj commented Dec 29, 2022

Copy link
Copy Markdown
Member

@blackheaven: thank you very much. Re squashing the fixup commits, if you set the squash+merge_me label, Mergify is going to squash the PR when merging it (in two days).

@blackheaven

Copy link
Copy Markdown
Collaborator Author

Thanks, I did it manually.

@Mikolaj

Mikolaj commented Dec 29, 2022

Copy link
Copy Markdown
Member

Perfect. Then go ahead and set the ordinary merge_me label.

@blackheaven blackheaven added the merge me Tell Mergify Bot to merge label Dec 29, 2022
@mergify mergify Bot added the merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days label Dec 31, 2022
@mergify

mergify Bot commented Dec 31, 2022

Copy link
Copy Markdown
Contributor

⚠️ This pull request got rebased on behalf of a random user of the organization.
This behavior will change on the 1st February 2022, Mergify will pick the author of the pull request instead.

To get the future behavior now, you can configure bot_account options (e.g.: bot_account: { author } or update_bot_account: { author }.

Or you can create a dedicated github account for squash and rebase operations, and use it in different bot_account options.

@kokobd
kokobd force-pushed the package-infos-module branch from afa7d0b to 7c1ce92 Compare December 31, 2022 13:27
@mergify
mergify Bot merged commit ffa9f01 into haskell:master Dec 31, 2022
@ffaf1 ffaf1 mentioned this pull request Feb 9, 2023
4 tasks done
@andreabedini

Copy link
Copy Markdown
Collaborator

For future reference this feature should have been conditional on cabal-version. See #9331

angerman added a commit to angerman/cabal that referenced this pull request Apr 17, 2026
Adds a new autogenerated module `PackageMeta_<pkgname>` that exposes
build-environment metadata: compiler flavour and version, platform OS
and architecture, git revision, git dirty flag, and per-flag booleans.

This follows the exact pattern of `PackageInfo_` (PR haskell#8534).

The git revision fields are currently passed as empty/false because
`builtinAutogenFiles` is pure; a follow-up will wire up the IO-based
git revision lookup at the call site.

New modules:
  - Distribution.Simple.Build.PackageMetaModule (generation logic)
  - Distribution.Simple.Build.PackageMetaModule.Z (zinza renderer)

Modified modules:
  - Distribution.Simple.BuildPaths (autogenPackageMetaModuleName)
  - Distribution.Simple.Build (builtinAutogenFiles integration)
  - Distribution.Simple.SrcDist (filterAutogenModules)
  - Cabal.cabal (exposed-modules / other-modules)

Test cases:
  - PackageTests/PackageMetaModule/Executable
  - PackageTests/PackageMetaModule/Library
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants