Add PackageMeta_ autogenerated module (#11755)#11756
Open
angerman wants to merge 4 commits intohaskell:masterfrom
Open
Add PackageMeta_ autogenerated module (#11755)#11756angerman wants to merge 4 commits intohaskell:masterfrom
angerman wants to merge 4 commits intohaskell:masterfrom
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new autogenerated module
PackageMeta_<pkgname>that exposes build-environment metadata known at configure time. This complements the existingPackageInfo_<pkgname>(static.cabalmetadata) andPaths_<pkgname>(install paths).Closes #11755.
Related: #392, #826, #1506, #7355, #7488, #11258, #4746.
What
PackageMeta_providesTaxonomy
PackageInfo_.cabalfile editedPackageMeta_(new)Paths_Implementation
Follows the exact pattern established by
PackageInfo_(PR #8534):Distribution.Simple.Build.PackageMetaModule-- generation logicDistribution.Simple.Build.PackageMetaModule.Z-- Zinza-style rendererautogenPackageMetaModuleNameadded toBuildPathsbuiltinAutogenFilesinBuild.hsSrcDist.hsPackageMetaModule/patternNote on git revision:
generatePackageMetaModuleaccepts the git revision and dirty flag as parameters (since computing them requires IO, andbuiltinAutogenFilesis pure). This PR passes empty defaults ("",False). Wiring up the actualgit rev-parse HEADcall at the appropriate IO call site is left for a follow-up, pending discussion on the issue about whether VCS info should be opt-in.Test plan
PackageMetaModule.hsandZ.hscompilecabal checkwarnings for missingautogen-modules