-
-
Notifications
You must be signed in to change notification settings - Fork 114
[RFC] haskell build recipe updates #6955
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
base: main
Are you sure you want to change the base?
Conversation
**Summary** - Update build recipe to use `%haskell-*` macros instead of raw cabal as discussed at getsolus#6540 (comment) - Disable parallel build due to weird bug in cabal/ghc - Replace `.cabal` patch file with `--constraint` argument - Enable running tests by explicitly providing `hspec-discover`
**Summary** - Update build recipe to use `%haskell-*` macros instead of raw cabal as discussed at getsolus#6540 (comment) - Switch to hackage source for `pandoc-cli` specifically instead of whole pandoc repo
**Summary** - Switch to hackage source for `pandoc-crossref` to avoid ugly hack with rm of `cabal.project.freeze`
**Summary** - Update build recipe to use `%haskell-*` macros instead of raw cabal as discussed at getsolus#6540 (comment) - Tests are disabled because they require following dependencies - [Icarus Verilog](https://steveicarus.github.io/iverilog/) - for Verilog simulation - [shUnit2](https://github.com/kward/shunit2) - test framework
|
@GZGavinZhao please take a look I tried to switch remaining packages to I am thinking that we could introduce several more macros:
|
| %cabal_configure -f+tar -f+tui --enable-tests | ||
| %cabal_configure -f+tar -f+tui --enable-tests \ | ||
| --constraint='brick >=2.5 && <2.8' | ||
| cabal install hspec-discover |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be %cabal_install_build_tool hspec-discover
| mkdir -p $installdir/usr/bin | ||
| cabal install --installdir=$installdir/usr/bin --install-method=copy exe:ghcup | ||
| %haskell_install exe:ghcup | ||
| rm -rf $installdir/%libdir% |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can also bundle this rm -rf somewhere into %haskell_install_exe or something like that?
| setup : | | ||
| rm $workdir/cabal.project.freeze | ||
| %cabal_configure --enable-tests | ||
| %cabal_configure --constraint="crypton-x509-store == 1.6.11" --enable-tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here %cabal_configure works because --constraint contains only version specification
| --disable-executable-dynamic \ | ||
| --ghc-options="-H512m %JOBS%" \ | ||
| -f embed_data_files | ||
| cabal build %JOBS% --only-dependencies --disable-tests -O2 --ghc-options="-H128m %JOBS%" \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be
%cabal_build_dependencies --constraint="crypton-x509-store == 1.6.11" \
--constraint="pandoc +embed_data_files"
%haskell_configure_exe
| export CABAL_DIR="$HOME/.cabal" | ||
| cabal update | ||
| cabal configure -O2 %JOBS% --disable-executable-dynamic | ||
| cabal install alex happy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be %cabal_install_build_tool alex happy
Note
This is independent of Upgrade of Haskell stack
Summary
Switched all remaining haskell packages that did not use
%haskell_*macros to use them.However, this highlighted some issues with expressiveness of current macros.
I had to use cabal directly for following tasks:
alex,happyandhspec-discover,which
runhaskell Setup.hsdoes not build due to issuerunhaskell Setup.hsapparentlyonly supports version bounds in
--constraintand not setting flags as well(needed for
pandocbuild with--constraint="pandoc +embed_data_files")Below are summaries for each package:
%haskell-*macros instead of raw cabalas discussed at ghcup: Add at v0.1.50.2 #6540 (comment)
.cabalpatch file with--constraintargumenthspec-discover%haskell-*macros instead of raw cabalas discussed at ghcup: Add at v0.1.50.2 #6540 (comment)
pandoc-clispecifically instead of whole pandoc repopandoc-crossrefto avoid ugly hack with rm ofcabal.project.freeze%haskell-*macros instead of raw cabalas discussed at ghcup: Add at v0.1.50.2 #6540 (comment)
Checklist