Skip to content

Avoid unnecessary recompilation due to -haddock #4596

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

fendor
Copy link
Collaborator

@fendor fendor commented May 21, 2025

Due to unprincipled adding and removing the -haddock flag during compilation and recompilation checking, we were performing more work than necessary.
We avoid this by compiling everything with -haddock by default. This is safe nowadays, we have essentially been doing this for many releases, and know this is fine.
For the occasion where we actually want to parse without the -haddock flag, we keep explicitly disabling it.

We enable -haddock flag during session loading, since we already perform a number of DynFlags tweaks.
This behaviour is dependent on the OptHaddockParse opton, which can, currently, only be modified at compile-time.

Closes #4511

@fendor fendor requested a review from wz1000 as a code owner May 21, 2025 16:59
@fendor
Copy link
Collaborator Author

fendor commented May 21, 2025

I would love to implement a regression test for this, but I am currently unsure how.

@fendor fendor force-pushed the fix/haddock-recompilation branch 2 times, most recently from 3f84a3d to 16d4457 Compare May 23, 2025 16:28
fendor added 2 commits May 24, 2025 15:07
Due to unprincipled adding and removing the `-haddock` flag during
compilation and recompilation checking, we were performing more work
than necessary.
We avoid this by compiling everything with `-haddock` by default. This
is safe nowadays, we have essentially been doing this for many releases,
and know this is fine.
For the occasion where we actually want to parse without the `-haddock`
flag, we keep explicitly disabling it.

We enable `-haddock` flag during session loading, since we already
perform a number of DynFlags tweaks.
This behaviour is dependent on the `OptHaddockParse` opton, which can,
currently, only be modified at compile-time.
@fendor fendor force-pushed the fix/haddock-recompilation branch from 16d4457 to 2606976 Compare May 24, 2025 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

All dependent files are recompiled on a save
1 participant