Page MenuHomeFreeBSD

Update lang/ghc to 8.0.2 and update hs-* to the newest releases

Authored by tcberner on Jul 11 2017, 5:29 PM.
Referenced Files
F89008640: D11558.id31715.diff
Mon, Jul 22, 8:29 AM
Unknown Object (File)
Wed, Jul 17, 11:37 AM
Unknown Object (File)
Sat, Jul 6, 4:10 PM
Unknown Object (File)
Tue, Jul 2, 1:10 PM
Unknown Object (File)
Sat, Jun 29, 9:21 AM
Unknown Object (File)
Thu, Jun 27, 2:22 AM
Unknown Object (File)
Thu, Jun 27, 2:10 AM
Unknown Object (File)
Thu, Jun 27, 2:01 AM



Everything should be fine now.

  • I dropped the compiler choices
    • BCLANG/PCLANG - this required a dependency on an old llvm37
    • So for now, just USE_GCC always [note, with some changes to compiler/main/*hs we could maybe get it to work with base clang as compiler]-
  • Use SUB_FILES to create the file
  • Prepare a target to create future bootstrap tarballs
  • Note, I did not yet add the SUBDIR += entries for the new ports or add MOVED entries for hs-directory.
Test Plan


Diff Detail

rP FreeBSD ports repository
No Lint Coverage
No Test Coverage
Build Status
Buildable 10428
Build 10838: arc lint + arc unit

Event Timeline

tcberner edited the summary of this revision. (Show Details)

the i386 distfiles disapeared.

tcberner edited the summary of this revision. (Show Details)

Readd the i386 boot tarball.

The user guide build seems to fail.

Chapter 19.                                                
[473] [474] (./users_guide.ind [475] [476] [477] [478] [479] [480] [481]                                               
[482] [483] [484] [485] [486] [487]                        
Underfull \hbox (badness 10000) in paragraph at lines 1240--1241                                                       
[]\EU1/DejaVuSerif(0)/m/n/10 __GLASGOW_HASKELL_PATCHLEVEL1__,                                                          

Underfull \hbox (badness 10000) in paragraph at lines 1241--1242                                                       
[]\EU1/DejaVuSerif(0)/m/n/10 __GLASGOW_HASKELL_PATCHLEVEL2__,                                                          
[488] [489]                                                
Underfull \hbox (badness 10000) in paragraph at lines 1498--1499                                                       
[]| \EU1/DejaVuSerif(0)/m/n/10 -Wmissing-pattern-synonym-signatures,                                                   
[490] [491] [492] [493] [494] [495] [496] [497] [498] [499]) (./users_guide.aux                                        

LaTeX Warning: There were multiply-defined labels.         

(see the transcript file for additional information)       
Output written on users_guide.pdf (515 pages).             
Transcript written on users_guide.log.                     
cp docs/users_guide/build-pdf/users_guide/users_guide.pdf docs/users_guide/users_guide.pdf                             
gmake[2]: *** [Makefile:134: all] Error 2                  
gmake[2]: Leaving directory '/usr/home/ports/lang/ghc/work/ghc-8.0.2'                                                  
===> Compilation failed unexpectedly.                      
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to                                            
the maintainer.                                            
*** Error code 1                                           

make[1]: stopped in /usr/home/ports/lang/ghc               
*** Error code 1                                           

make: stopped in /usr/home/ports/lang/ghc                  

===>>> make build failed for lang/ghc                      
===>>> Aborting update                                     

===>>> You can restart from the point of failure with this command line:                                               
       portmaster <flags> lang/ghc                         

This command has been saved to /tmp/portmasterfail.txt

I believe this is the same error I also get when building it outside of poudriere. Let me double check.

If you scroll all the way up you should see

  File "/usr/local/lib/python2.7/site-packages/docutils/writers/", line 671, in depart_document
    assert not self.context, 'len(context) = %s' % len(self.context)
AssertionError: len(context) = 1
The full traceback has been saved in /wrkdirs/usr/local/poudriere/ports/ghc/lang/ghc/work/ghc-8.0.2/tmp/sphinx-err-oiNtsC.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <>. Thanks!

devel/hs-transformers-base is failing with following:

===>  Building for hs-transformers-base-0.4.4
Building transformers-base-0.4.4...
Preprocessing library transformers-base-0.4.4...
[1 of 1] Compiling Control.Monad.Base ( src/Control/Monad/Base.hs, dist/build/Control/Monad/Base.o )
src/Control/Monad/Base.hs:22:1: warning: [-Wunused-imports]
    The import of ‘Data.Monoid’ is redundant
      except perhaps to import instances from ‘Data.Monoid’
    To import instances alone, use: import Data.Monoid()
[1 of 1] Compiling Control.Monad.Base ( src/Control/Monad/Base.hs, dist/build/Control/Monad/Base.p_o )
src/Control/Monad/Base.hs:48:1: error:
    Failed to load interface for ‘Control.Monad.STM’
    Perhaps you haven't installed the profiling libraries for package ‘stm-’?
    Use -v to see a list of the files searched for.
*** Error code 1

Complete build log at

Is there any reason not to always build with profiling and dynamic ? If not I would also like to get rid of these options. Because, it just makes stuff unnecessary breaky and buggy, as the last comment shows.

Is there any reason not to always build with profiling and dynamic ? If not I would also like to get rid of these options. Because, it just makes stuff unnecessary breaky and buggy, as the last comment shows.

Sorry, this is indeed my fault, I missed resetting hs-stm port's options, while the result. Also, the reason we'd these OPTIONs is so as to not force it on someone, as we're essentially adding another run of compilation cycle per option, so if someone doesn't need/care for these options, can just disable them, and get smaller build times. The breaky, and buggy part was entirely my fault, which I failed to notice.

I think there is nothing wrong with the DYNAMIC and PROFILE options. The issue that Ashish was experiencing is due to the fact that GHC cannot build either a dynamically-linked or profiling version of a library/executable if any of the dependencies does not have those versions built and installed. The reason why PROFILE is not enabled by default is also that it is mostly a developer option. The _p version of the libraries contain some extra bits for doing performance profiling and I do not think it would make sense to build and package them unless the user wants to have them specifically. (They can increase the size of the package by about one third, I guess.) On that other hand, as far as I remember, DYNAMIC has been a default option for a while now.

I have added some comments to the patch inline. In addition to them, a general remark: I believe all ports where there was no version change, the PORTREVISION must be bumped because a major dependency has still changed, the compiler. That is, they will have to rebuilt anyway. I do not know if this is still required these days, though.


Excellent idea! Thank you.


Why do not you simply disable the test flag explicitly for the build? You can do that with adding FLAGS_DISABLE= test to the Makefile.


Why is this dependency removed?


I think this PORTREVISION reset was missed.


That is a very long line, it should be broken.


The COMMENT might be too long per the recommendations of the Porter's Handbook.


A potentially long COMMENT.


This line is too long for pkg-descr.


PORTREVISION must be reset on version upgrade.


The LLVM option activates the LLVM backend for GHC. Although it may not work in every case perfectly, this is still something that the user may want to use for development, for example. That is why it has not been enabled by default.


Well, I guess GHC 8.0 supports a newer, supported version of LLVM in the ports. So, that is all.


Not always. However, base Clang is updated quite often.


That is cool. Great idea!


Perhaps this one should be with gmake?


Why is it broken?


Yeah, that is a good idea.


I think the output generated by V = 2 is too verbose for the everyday use.


I guess this is just temporary?


Why is this dependency removed?


I think this is a typo.


There is a missing full stop.

Thanks, I'll update the review later.


This is part of an upstream commit, I used as the base for this.


As I understand this is now in base -- and I did not want to add the "empty" package.


The issue is, its bound to exactly one version of llvm. And old versions of llvm will be dropped from the ports tree sooner or later.


You're probably right. I have not yet tested that :)


I think this was a comment to something I wrote there before and dropped.


Yes, that is only in there to test at the moment.


Yes, I just don't have a clue how you generate that file =)


see the other comment related to this.


Install the Agda compiler without this file (it should just work), then use the compiler to build it from Primitive.agda. This file is placed under the datadir of the Agda package (somewhere around lib/prim/Agda).


The documentation now requires Sphinx (textproc/py-sphinx) for building as the GHC developers have moved from using DocBook, starting from version 8.

Do you really want to upgrade hoauth2 to its latest version? gitit uses versions 0.4.x (x >= 2) or 0.5.x, and the Network.Gitit.Authentication.Github module would need to be heavily patched in order to be able to build with version 1.3.0 (due changes in the API).

I think the following ports could be safely dropped as they got deprecated and unmaintained in upstream:

  • devel/hs-MonadCatchIO-mtl and devel/hs-MonadCatchIO-transformers: Deprecated in favor of the exceptions package.
  • textproc/hs-citeproc-hs: Its functionality has been replaced with that of textproc/hs-pandoc-citeproc.
  • devel/hs-syb-with-class-instances-text: Unmaintained for a while now, and it has no dependents.

Thanks, I'll try to get to it on tuesday.

Unfortunately, the documentation for lang/ghc cannot yet be built with the current version of textproc/py-sphinx in the tree. This has been reported and fixed upstream but it is not there in the ports. I submitted a bug report for that.

All right, I have worked myself through all the mentioned issues as part of my more exhaustive review that eventually resulted in an updated version of the published diff. Basically now all the ports build fine, except devel/stack where I could not yet figure out what causes the build to fail.

I found some additional build problems on i386 that I have now fixed. I updated the previously referenced diff with those changes.

When I was discussing with tobik how to deal with devel/stack, he spotted that lang/ghc does not configure with setting the DOCS option to off. I investigated the issue, and it turned out the X_SUB_LIST_OFF variables do not properly escape the '#' characters so sed(1) fails. They have to be prefixed with a backslash in order to work.

I updated my diff to incorporate this fix.

Escape the FOO_SUBLIST_OFF values.

I updated my diff to incorporate this fix.

Did it contain any other changes?

I think it did not, but since I have spotted other problems, I kept working on the diff, which has been updated by now. To the latest version, it features the following changes:

  • Fix build with the DOCS option set to off. It turned out that GHC does not ship the xhtml package if no documentation is generated. (It is a dependency of the built-in Haddock instance, so without Haddock it is not built at all.) I also polished the interaction with the devel/hs-haddock port -- it can be used to re-add or update Haddock that comes with GHC.
  • In coordination with tobik, a new distribution tarball was produced for devel/stack, now it can build with GHC 8. I hacked on the Makefile a little bit more, as devel/stack did not want to build if the dynamically-linked executables were disabled. (It uses cabal-install that pulls in some packages that stack also needs, but only if cabal-install was built with the DYNAMIC option.)
  • Further fixes to lang/ghc to package properly with either DYNAMIC or PROFILE set to off.

@tcberner : You seem to forgot to remove the SUBDIR entry for hs-directory in devel/Makefile, so I fixed it. In addition to that, the new version of my diff now contains:

    • A missing patch for devel/hs-git-annex to have its man pages in the right directory.
  • An entry for UPDATING.

Update lang/ghc's plist to include the manpage.

pgj removed a subscriber: pgj.

I think it is fine now.

While toying with the related commit message, I realized that your change wants to re-add the math/hs-nats port that was removed on the last major update. It actually had a reason: the functionality of the nats package has been merged in the base package that ships with GHC, and it looks like that is still the case.

I have checked it, and it turned out that only the converters/hs-aeson-compat port would need it. So I changed the port to not to use the nats package, hence there is no need to resurrect the math/hs-nats port.

I updated my diff with this modification.

Compiled latest revision in 11.0 jail.

This revision was automatically updated to reflect the committed changes.