GithubHelp home page GithubHelp logo

vsco / bazel-toolchains Goto Github PK

View Code? Open in Web Editor NEW
38.0 27.0 7.0 45 KB

A collection of Bazel C++ build infrastructure based on Chromium's LLVM toolchain.

License: Apache License 2.0

Python 75.43% C++ 2.50% Shell 22.07%

bazel-toolchains's Introduction

Bazel Toolchains

Build Status

A collection of Bazel C++ build infrastructure based on Chromium's LLVM toolchain. There are tags corresponding to Chromium releases. The build targets currently supported are Linux x64 and macOS. As in Chromium, the Linux toolchain has a sysroot, bundled copies of binutils, and a copy of libc++. The macOS build is less hermetic, and relies on system binutils and libraries.

Use it in your Bazel WORKSPACE file like this:

git_repository(
    name = 'co_vsco_bazel_toolchains',
    remote = 'https://github.com/vsco/bazel-toolchains',
    tag = 'v64.0.3282.167',
)

load("@co_vsco_bazel_toolchains//toolchains:repositories.bzl", "bazel_toolchains_repositories")
bazel_toolchains_repositories()

Invoke Bazel with the custom toolchain:

bazel build --crosstool_top=@co_vsco_bazel_toolchains//tools/cpp:default-toolchain //your/build:target

Bazel Compatibility

vsco/bazel-toolchains is tested against the following build matrix:

Bazel Version OSX Linux
0.20.0+
0.19.2
0.18.1
0.17.2
0.16.1
0.15.2
0.14.1
0.13.1
0.12.0
0.11.x
0.10.x
0.9.x

Builds beyond the listed versions are not currently tested.

Bazel 0.20.0+ introduced breaking changes to the C++ Toolchain API which need to be addressed for consumers of this repo in a non-breaking manner.

Prerequisites

On macOS, run xcode-select --install in Terminal.

Running the Python scripts

The files in the scripts/ directory are written in Python. Follow these instructions to install a version of Python that comes with the necessary tools for installation of third party libraries. On macOS, this means brew install python, and then following the instructions printed by brew info python (It's recommended to use python@2 for macOS).

Once that's working, type pip install requests to install the necessary dependencies.

From the root of this repository, type python scripts/generate_workspace.py --rev="64.0.3282.167" where --rev is the Chromium tag you wish to pull from. The script will print status messages to stderr and write a file similar to toolchains/repositories.bzl to stdout.

bazel-toolchains's People

Contributors

nicolov avatar promiseofcake avatar sayrer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bazel-toolchains's Issues

Needs explicit deps on @org_chromium_libcxx

Hey there, thanks for the great work here.

I was wondering how to stop having to depend on '@org_chromium_libcxx//:cxx', and :cxxabi in each cc_library rule. It seems pretty tiresome to me. Custom macros are an option, but I was wondering if there was a way to add it to the CROSSTOOL configuration instead.

Asan/Tsan/Msan

Is there a way to use Asan/Tsan/Msan with this toolchain? When I try (e.g. asan) I get an error:

chromium_ld: error: cannot open external/co_vsco_bazel_toolchains/tools/cpp/tool_wrappers/lib/clang/6.0.0/lib/linux/libclang_rt.asan-x86_64.a: No such file or directory

For some reason, chromium_ld is looking for libclang_rt.asan-x86_64.a under external/co_vsco_bazel_toolchains/tools/cpp/tool_wrappers instead of external/org_chromium_clang_linux_x64/...

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.