Repository navigation
docs: post-build hooks run after a component is built, not before linking - #12467
Open
ulysses4ever wants to merge 1 commit into
Open
ulysses4ever wants to merge 1 commit into
ulysses4ever wants to merge 1 commit into
Conversation
…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
sheaf
approved these changes
Oct 16, 2026
zlonast
approved these changes
Oct 16, 2026
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.
Both the Hooks guide (
doc/how-to-use-setup-hooks.rst) and theDistribution.Simple.SetupHooksmodule docs describe per-component post-build hooks as running "before linking", or as "pre-linking hooks". That is not when they run:build_setupHooksinDistribution.Simple.Buildcalls the post-build hook right afterbuildComponent, which for GHC both compiles and links (Distribution.Simple.GHC.Build.buildends inlinkOrLoadComponent). 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→Hooksport 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
🤖 Generated with Claude Code
https://claude.ai/code/session_01MWUpUBVSHTCWHGYNCwsjFL