Skip to content

Make --enable-documentation work - #5143

Merged
23Skidoo merged 1 commit into
haskell:masterfrom
alexbiehl:pr/enable-documentation
Feb 14, 2018
Merged

23Skidoo merged 1 commit into
haskell:masterfrom
alexbiehl:pr/enable-documentation

Conversation

@alexbiehl

@alexbiehl alexbiehl commented Feb 13, 2018 •

Copy link
Copy Markdown
Member

Adds the ability to generate haddock documentation for non-inplace
package builds.

In other words this allows

  • $ cabal new-build --enable-documentation
  • $ echo "documentation: true" >> cabal.project && cabal new-build
  • $ echo "documentation: true" >> ~/.cabal/config && cabal new-build

And it will generate (and install) haddock documentation for any
package.

(This works best with #5142 as otherwise global configuration cannot be applied to non-local packages)

Please include the following checklist in your PR:

  • Patches conform to the coding conventions.
  • Any changes that could be relevant to users have been recorded in the changelog.
  • The documentation has been updated, if necessary.
  • If the change is docs-only, [ci skip] is used to avoid triggering the build bots.

Please also shortly describe how you tested your change. Bonus points for added tests!

Adds the ability to generate haddock documentation for non-inplace
package builds.

In other words this allows

  - `$ cabal new-build --enable-documentation`
  - `$ echo "documentation: true" >> cabal.project && cabal new-build`
  - `echo "documentation: true" >> ~/.cabal/config && cabal new-build`

And it will generate (and install) haddock documentation for any
package.
@alexbiehl alexbiehl added the cabal-install: v2-build system Affecting v2-build and related commands that use v2-architecture (aka "nix local builds"). label Feb 13, 2018
@alexbiehl
alexbiehl requested a review from hvr February 13, 2018 12:39
@hvr

hvr commented Feb 13, 2018

Copy link
Copy Markdown
Member

@alexbiehl does --enable-documentation result in a different nix-hash? i.e. does it trigger recompilations of existing packages in the store, or does this result in packages missing docs in the store not being recompiled w/ haddocks?

@alexbiehl

Copy link
Copy Markdown
Member Author

These are the inputs for the nix package hash originating from configuration values:

data PackageHashConfigInputs = PackageHashConfigInputs {
pkgHashCompilerId :: CompilerId,
pkgHashPlatform :: Platform,
pkgHashFlagAssignment :: FlagAssignment, -- complete not partial
pkgHashConfigureScriptArgs :: [String], -- just ./configure for build-type Configure
pkgHashVanillaLib :: Bool,
pkgHashSharedLib :: Bool,
pkgHashDynExe :: Bool,
pkgHashGHCiLib :: Bool,
pkgHashProfLib :: Bool,
pkgHashProfExe :: Bool,
pkgHashProfLibDetail :: ProfDetailLevel,
pkgHashProfExeDetail :: ProfDetailLevel,
pkgHashCoverage :: Bool,
pkgHashOptimization :: OptimisationLevel,
pkgHashSplitObjs :: Bool,
pkgHashSplitSections :: Bool,
pkgHashStripLibs :: Bool,
pkgHashStripExes :: Bool,
pkgHashDebugInfo :: DebugInfoLevel,
pkgHashProgramArgs :: Map String [String],
pkgHashExtraLibDirs :: [FilePath],
pkgHashExtraFrameworkDirs :: [FilePath],
pkgHashExtraIncludeDirs :: [FilePath],
pkgHashProgPrefix :: Maybe PathTemplate,
pkgHashProgSuffix :: Maybe PathTemplate
-- TODO: [required eventually] pkgHashToolsVersions ?
-- TODO: [required eventually] pkgHashToolsExtraOptions ?
-- TODO: [research required] and what about docs?
}
deriving Show

documentation is not part of that input and thus documentation: true doesn't affect the hash.

@23Skidoo

Copy link
Copy Markdown
Member

Would be cool to later add some kind of automatic doc rebuilding like we have for --enable-profiling, but I agree that this shouldn't be part of the package hash.

@23Skidoo
23Skidoo merged commit c094940 into haskell:master Feb 14, 2018
@23Skidoo

Copy link
Copy Markdown
Member

Merged, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cabal-install: v2-build system Affecting v2-build and related commands that use v2-architecture (aka "nix local builds").

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants