Git Product home page Git Product logo

cabal2bazel's Introduction

cabal2bazel

A tool to help with fetching Cabal packages from Hackage and importing them as packages into cabal2bazel.

Usage: cabal2bazel --fetch

Examples: cabal2bazel --fetch binary cabal2bazel --fetch binary-0.5.0.2 cabal2bazel --recursive --fetch lens

The 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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.