Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/google/cabal2bazel
Haskell Bazel rules and cabal2bazel import tool.
https://github.com/google/cabal2bazel
Last synced: about 1 month ago
JSON representation
Haskell Bazel rules and cabal2bazel import tool.
- Host: GitHub
- URL: https://github.com/google/cabal2bazel
- Owner: google
- License: apache-2.0
- Created: 2018-05-03T05:35:22.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-04-16T17:54:49.000Z (over 3 years ago)
- Last Synced: 2024-08-03T21:02:15.980Z (5 months ago)
- Language: Starlark
- Homepage:
- Size: 249 KB
- Stars: 41
- Watchers: 13
- Forks: 6
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: ChangeLog.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome-cabal - `cabal2bazel`
README
# cabal2bazel
A tool to help with fetching Cabal packages from Hackage and importing
them as packages into cabal2bazel.Usage:
cabal2bazel --fetchExamples:
cabal2bazel --fetch binary
cabal2bazel --fetch binary-0.5.0.2
cabal2bazel --recursive --fetch lensThe process for installing third-party Haskell packages is specified at:
https://opensource.google.com/docs/thirdparty/haskell/
cabal2bazel does not (yet) capture all the subtleties of this process,
and is no substitute for code review. But it will automate the bulk of
chores, including:- fetching the Cabal package;
- unpacking it into an appropriate directory;
- ensuring the license file is in the expected location;
- generating a BUILD file with suitable rules.
- if --recursive is specified, traversing graph of all dependencies of
selected package and importing all of them.cabal2bazel attempts to map the dependencies of a Cabal library or
executable to the 'deps' attribute of the resulting Bazel target.Things that still need manual attention include:
- optimization modes need to be removed from ghcopts, because Bazel
chooses them itself;
- cabal2bazel adds '-Wwarn' to all rules' ghcopts; this might not be
desired;
- correct choice of license attributes should be checked;
- generated dependencies might need to be adjusted to point to specific
versions of the packages depended upon.NOTE: You will need an appropriate version of 'cabal' to be available
on your path; cabal2bazel uses it for downloading and unpacking packages.NOTE: Sometimes it is necessary to edit the cabal file and re-run
cabal2bazel. In such cases rerun cabal2bazel as follows to resume
installation:cabal2bazel --wire-up
Example:
cabal2bazel --wire-up //third_party/haskell/binary/v0_5_0_2