Add --enable-library-bytecode option for building bytecode libraries#11386
Open
mpickering wants to merge 1 commit intohaskell:masterfrom
Open
Add --enable-library-bytecode option for building bytecode libraries#11386mpickering wants to merge 1 commit intohaskell:masterfrom
mpickering wants to merge 1 commit intohaskell:masterfrom
Conversation
geekosaur
reviewed
Jan 5, 2026
| StandaloneBytecodeNotSupportedYet -> | ||
| unlines $ | ||
| [ "The ecosystem doesn't support building packages with just bytecode libraries yet." | ||
| , "If you have run into this error, please comment on issue #<TODO>" |
Collaborator
There was a problem hiding this comment.
just a reminder: stub here
geekosaur
reviewed
Jan 5, 2026
Collaborator
geekosaur
left a comment
There was a problem hiding this comment.
I notice that no test actually exercises the new cabal file entries as yet (which I presume exist in addition to the options, since the cabal file rev was bumped to 3.17).
01c50b5 to
5300d02
Compare
Collaborator
Author
Do you mean the project file? You're right I didn't add any tests for that, I can add some. |
5300d02 to
731a2f3
Compare
731a2f3 to
e985c66
Compare
e985c66 to
cb93beb
Compare
Collaborator
Author
|
I have fixed the #TODO which @geekosaur pointed out and added some more tests now (testing cabal.project files and trying to only build the bytecode way). |
The new `Cabal` and `cabal-install` option tells GHC to build a bytecode library. * When GHC is invoked, bytecode objects are also produced. * A bytecode library is created during linking. * The bytecode library is installed when the package is installed. * The `bytecode-library-dirs` field can be populated to instruct GHC where to find the bytecode library for a package. (This can be useful if the bytecode libraries are distributed separately from the other libraries). The bytecode object files are produced alongside an existing build way. They are prioritised in this order (`-dyn-too`, `-dynamic`, `-static`). Bytecode libraries can't be produced standalone at the moment. You have to produce them alongside an existing build way. This is due to limitations in GHC. At the moment, there is not support implemented for creating profiled bytecode libraries. Implements haskell/cabal-proposals#2 Fixes haskell#11188
cb93beb to
4efc6fd
Compare
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.
The new
Cabalandcabal-installoption tells GHC to build a bytecode library.bytecode-library-dirsfield can be populated to instruct GHC where to find the bytecode library for a package. (This can be useful if the bytecode libraries are distributed separately from the other libraries).The bytecode object files are produced alongside an existing build way. They are prioritised in this order (
-dyn-too,-dynamic,-static).Bytecode libraries can't be produced standalone at the moment. You have to produce them alongside an existing build way. This is due to limitations in GHC.
At the moment, there is not support implemented for creating profiled bytecode libraries.
Implements haskell/cabal-proposals#2
Fixes #11188
Template Α: This PR modifies behaviour or interface
Include the following checklist in your PR:
significance: significantin the changelog file.