Skip to content
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

__HADDOCK__ CPP macro isn't defined #1237

Closed
UnkindPartition opened this issue Mar 14, 2013 · 5 comments · Fixed by #1238
Closed

__HADDOCK__ CPP macro isn't defined #1237

UnkindPartition opened this issue Mar 14, 2013 · 5 comments · Fixed by #1238

Comments

@UnkindPartition
Copy link
Contributor

I noticed that __HADDOCK__ CPP macro doesn't get set during the haddock phase.

From looking at prepareSources (Cabal/Distribution/Simple/Haddock.hs), it seems that preprocessing happens regardless of the Haddock version, but -D__HADDOCK__ is passed only for haddock 0.x.

Possibly related old issue: #231

@23Skidoo
Copy link
Member

Also related: #926. Perhaps it's better to just always define __HADDOCK__.

23Skidoo added a commit to 23Skidoo/cabal that referenced this issue Mar 15, 2013
This is useful e.g. for "writing documentation that links to module A without
explicitly qualifying everything, where A is not directly imported." (see the
discussion in haskell#926)

Fixes haskell#1237.
23Skidoo added a commit to 23Skidoo/cabal that referenced this issue Mar 15, 2013
This is useful e.g. for "writing documentation that links to module A without
explicitly qualifying everything, where A is not directly imported." (see the
discussion in haskell#926)

Fixes haskell#1237.
@UnkindPartition
Copy link
Contributor Author

I did a bit of archaeology. The commits that change the situation described in #231 are cef898e and afc1603 by @Saizan. He doesn't seem to explain, however, why these changes were made.

So, unless someone can remember the rationale behind them, I'd be happy to see your patch applied. (Essentially it reverts afc1603.)

Also, the module header has to be updated. It says:

It has to do pre-processing for haddock 0.x which involves 'unlit'ing and using -DHADDOCK for any source code that uses cpp.

23Skidoo added a commit to 23Skidoo/cabal that referenced this issue Mar 15, 2013
This is useful e.g. for "writing documentation that links to module A without
explicitly qualifying everything, where A is not directly imported." (see the
discussion in haskell#926)

Fixes haskell#1237.
@23Skidoo
Copy link
Member

@feuerbach

Also, the module header has to be updated.

Updated, thanks.

@23Skidoo
Copy link
Member

Actually, we should probably drop support for Haddock < 2 and just pass --optghc=-cpp to Haddock if the package has the CPP extension enabled.

@dcoutts
Copy link
Contributor

dcoutts commented Mar 15, 2013

Gah, too many tickets about the same thing. See my comments in #926 and #1238.

Summary: I explain why we had afc1603 in the first place and suggest an alternative to using cpp for this problem.

23Skidoo added a commit to 23Skidoo/cabal that referenced this issue Mar 19, 2013
This is useful e.g. for "writing documentation that links to module A without
explicitly qualifying everything, where A is not directly imported." (see the
discussion in haskell#926)

Fixes haskell#1237.
23Skidoo added a commit to 23Skidoo/cabal that referenced this issue Apr 15, 2013
This is useful e.g. for "writing documentation that links to module A without
explicitly qualifying everything, where A is not directly imported." (see the
discussion in haskell#926)

Fixes haskell#1237.
23Skidoo added a commit to 23Skidoo/cabal that referenced this issue Apr 23, 2013
This is useful e.g. for "writing documentation that links to module A without
explicitly qualifying everything, where A is not directly imported." (see the
discussion in haskell#926)

Fixes haskell#1237.
23Skidoo added a commit to 23Skidoo/cabal that referenced this issue May 2, 2013
This is useful e.g. for "writing documentation that links to module A without
explicitly qualifying everything, where A is not directly imported." (see the
discussion in haskell#926)

Fixes haskell#1237.
23Skidoo added a commit to 23Skidoo/cabal that referenced this issue May 11, 2013
This is useful e.g. for "writing documentation that links to module A without
explicitly qualifying everything, where A is not directly imported." (see the
discussion in haskell#926)

Fixes haskell#1237.
23Skidoo added a commit to 23Skidoo/cabal that referenced this issue May 13, 2013
This is useful e.g. for "writing documentation that links to module A without
explicitly qualifying everything, where A is not directly imported." (see the
discussion in haskell#926)

Fixes haskell#1237.
23Skidoo added a commit to 23Skidoo/cabal that referenced this issue Jul 17, 2013
This is useful e.g. for "writing documentation that links to module A without
explicitly qualifying everything, where A is not directly imported." (see the
discussion in haskell#926)

Fixes haskell#1237.
23Skidoo added a commit to 23Skidoo/cabal that referenced this issue Jul 17, 2013
This is useful e.g. for "writing documentation that links to module A without
explicitly qualifying everything, where A is not directly imported." (see the
discussion in haskell#926)

Fixes haskell#1237.
23Skidoo added a commit to 23Skidoo/cabal that referenced this issue Jul 19, 2013
This is useful e.g. for "writing documentation that links to module A without
explicitly qualifying everything, where A is not directly imported." (see the
discussion in haskell#926)

Fixes haskell#1237.
23Skidoo added a commit to 23Skidoo/cabal that referenced this issue Aug 23, 2013
This is useful e.g. for "writing documentation that links to module A without
explicitly qualifying everything, where A is not directly imported." (see the
discussion in haskell#926)

Fixes haskell#1237.
23Skidoo added a commit to 23Skidoo/cabal that referenced this issue Aug 26, 2013
This is useful e.g. for "writing documentation that links to module A without
explicitly qualifying everything, where A is not directly imported." (see the
discussion in haskell#926)

Fixes haskell#1237.
23Skidoo added a commit to 23Skidoo/cabal that referenced this issue Sep 5, 2013
This is useful e.g. for "writing documentation that links to module A without
explicitly qualifying everything, where A is not directly imported." (see the
discussion in haskell#926)

Fixes haskell#1237.
23Skidoo added a commit to 23Skidoo/cabal that referenced this issue Sep 7, 2013
This is useful e.g. for "writing documentation that links to module A without
explicitly qualifying everything, where A is not directly imported." (see the
discussion in haskell#926)

Fixes haskell#1237.
23Skidoo added a commit to 23Skidoo/cabal that referenced this issue Oct 7, 2013
This is useful e.g. for "writing documentation that links to module A without
explicitly qualifying everything, where A is not directly imported." (see the
discussion in haskell#926)

Fixes haskell#1237.
23Skidoo added a commit to 23Skidoo/cabal that referenced this issue Oct 12, 2013
This is useful e.g. for "writing documentation that links to module A without
explicitly qualifying everything, where A is not directly imported." (see the
discussion in haskell#926)

Fixes haskell#1237.
23Skidoo added a commit to 23Skidoo/cabal that referenced this issue Oct 14, 2013
This is useful e.g. for "writing documentation that links to module A without
explicitly qualifying everything, where A is not directly imported." (see the
discussion in haskell#926)

Fixes haskell#1237.
23Skidoo added a commit to 23Skidoo/cabal that referenced this issue Oct 16, 2013
This is useful e.g. for "writing documentation that links to module A without
explicitly qualifying everything, where A is not directly imported." (see the
discussion in haskell#926)

Fixes haskell#1237.
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 a pull request may close this issue.

3 participants