Skip to content

docs: post-build hooks run after a component is built, not before linking - #12467

Open
ulysses4ever wants to merge 1 commit into
haskell:masterfrom
ulysses4ever:docs/post-build-hooks-run-after-build
Open

ulysses4ever wants to merge 1 commit into
haskell:masterfrom
ulysses4ever:docs/post-build-hooks-run-after-build

Conversation

@ulysses4ever

Copy link
Copy Markdown
Collaborator

Both the Hooks guide (doc/how-to-use-setup-hooks.rst) and the Distribution.Simple.SetupHooks module docs describe per-component post-build hooks as running "before linking", or as "pre-linking hooks". That is not when they run: build_setupHooks in Distribution.Simple.Build calls the post-build hook right after buildComponent, which for GHC both compiles and links (Distribution.Simple.GHC.Build.build ends in linkOrLoadComponent). HF proposal 60 has it right: the hook exists "to modify an executable after it has been built", and the uses it lists (injecting data, stripping, code signing) all need the linked binary. Read literally, the current wording rules those out.

Found while evaluating a Custom → Hooks port of a package whose post-build step runs the freshly built executable.

Docs only, no behaviour change.


Template B: This PR does not modify behaviour or interface

  • 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). — No.

🤖 Generated with Claude Code

https://claude.ai/code/session_01MWUpUBVSHTCWHGYNCwsjFL

…king

Both the Hooks guide and the Distribution.Simple.SetupHooks module docs
described per-component post-build hooks as running "before linking", or
as "pre-linking hooks". That is not when they run: build_setupHooks in
Distribution.Simple.Build calls the post-build hook right after
buildComponent, which for GHC compiles and links. The uses the proposal
lists for the hook -- injecting data into the executable, stripping it,
signing it -- all need the linked binary.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MWUpUBVSHTCWHGYNCwsjFL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants