Giter VIP home page Giter VIP logo

rules_third_party's Introduction

Third-Party

CI

Bazel resolved third party dependencies. The purpose of this repository is to provide bazel-native (or tuned rules_foreign_cc definitions) for various third party repositories across Linux, Windows and MacOS.

Why?

There is plenty of software that is generally useful that do not support the bazel build system. rules_foreign_cc addresses this problem only partially right now (and possibly won't ever fully address the problem with certain classes of build system Ie. configure/build) in that it tends to have problems operating on platforms that aren't Linux. Sometimes it can be made to work, but sometimes assumptions are made about the build environment that do not work well in bazel causing build failures.

Ultimately we want easy to access bazel libraries that work across at least Linux, Windows and MacOS.

Usage

Add the following to your WORKSPACE file:

load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")

maybe(
    git_repository,
    name = "rules_third_party",
    remote = "https://github.com/DraconicEnt/rules_third_party.git",
    commit = "512b473cb80586381f6c14102cc6c8b0f118e0f7" # Change to any commit ID you want
)

To load and initialize a third party dependency (zlib here for example), also add the following to your WORKSPACE:

load("@third_party//libraries:zlib.bzl", "zlib")

zlib()

For more information about supported libraries and their associated documentation, see the wiki.

Using other Versions of Software

These rules are all defined using the maybe directive. This means you can load alternative versions of the software supported by this repository. For example, you can load ENet 1.3.10 (instead of the 1.3.17) using the following code:

load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

maybe(
    http_archive,
    name = "enet",
    urls = [
        "https://github.com/lsalzman/enet/archive/v1.3.10.tar.gz"
    ],
    sha256 = "035f9b5cdc67b720a45952b77a28fdf054e93fd273df9dd7f6a3e13d60571069",
    build_file = "@rules_third_party//libraries:enet.BUILD"
)

# You should still load and call the initialization function, though, so that all subdependencies are initialized
# but only do this AFTER your declaration above.
load("@third_party//:libraries/enet.bzl", "enet")
enet()

Assumptions

The following assumptions are made about your build environment:

  • Your build host is either Windows, Linux or MacOS.

rules_third_party's People

Contributors

ragora avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

cgrindel

rules_third_party's Issues

MacOS: Most Components do not Build

Describe the bug
Most components do not build on MacOS.

To Reproduce
Steps to reproduce the behavior:

Attempt to build pretty much anything on MacOS.

Additional context
Add any other context about the problem here.


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.