commit | d74f00132cd5d93a9d34a67dd29e31652e793e44 | [log] [tgz] |
---|---|---|
author | Manuel Klimek <klimek@google.com> | Thu Feb 19 12:58:58 2015 +0000 |
committer | Han-Wen Nienhuys <hanwen@google.com> | Thu Feb 19 12:58:58 2015 +0000 |
tree | ffc724bf305e8e2472093f2566515cc1f5a40964 | |
parent | fbef62b5ef27ecb783157f993792c6325392b1a0 [diff] |
Port all module map and header parsing related flags to the new crosstool configuration. Together with [] (change to the crosstool configuration), the resulting blaze is able to build header modules (minus clang bugs). Detailed changes: 1. Adapt CppCompileAction to only insert the arguments itself if the crosstool does not specify a feature. 2. Make CppCompileAction provide the build variables to the flag expansion. 3. Pass package features through to the new feature selection / crosstool configuration; allow rules to always request features and mark features as unsupported. 4. Add feature "header_module_includes_dependencies" that controls whether we can only provide top-level header modules in the ${module_files} build variable; the currently integrated clang does not fully support that yet. 5. Add feature "use_header_modules", which allows targets to use compiled header modules without being compilable as module themselves. 6. Convert tests to use the feature configuration where it makes sense; we will be able to delete a lot of unit tests once the control via the feature configuration is rolled out to the stable crosstool, and implement them as crosstool integration tests. -- MOS_MIGRATED_REVID=86680884
Bazel is very much a work in progress. We'd love if you tried it out, but there are many rough edges. Please feel free to give us feedback!
{Fast, Correct} - Choose two
Bazel is an build tool that builds code quickly and reliably. It executes as few build steps as possible by tracking dependencies and outputs, controls the build environment to keep builds hermetic, and uses its knowledge of dependencies to parallelize builds.
This README file contains instructions for building and running Bazel.
Supported platforms:
Java:
Clone the Bazel repo from GitHub:
$ cd $HOME $ git clone https://github.com/google/bazel/
To build Bazel on Ubuntu:
Install required package:
$ sudo apt-get install libarchive-dev
Build Bazel:
$ cd bazel $ ./compile.sh
Using Bazel on Mac OS X requires:
To build Bazel on Mac OS X:
Install required packages:
$ port install protobuf-cpp libarchive
or
$ brew install protobuf libarchive
Build Bazel:
$ cd bazel $ ./compile.sh
The Bazel executable is located at <bazel_home>/output/bazel
.
You must run Bazel from within a workspace directory. Bazel provides a default workspace directory with sample BUILD
files and source code in <bazel_home>/base_workspace
. The default workspace contains files and directories that must be present in order for Bazel to work. If you want to build from source outside the default workspace directory, copy the entire base_workspace
directory to the new location before adding your BUILD
and source files.
Build a sample Java application:
$ cp -R $HOME/bazel/base_workspace $HOME/my_workspace $ cd $HOME/my_workspace $ $HOME/bazel/output/bazel build //examples/java:hello-world
Note: on OS X, you must specify --cpu=darwin to build Java programs (e.g., bazel build --cpu=darwin //examples/java:hello-world).
The build output is located in $HOME/my_workspace/bazel-bin/examples/java/
.
Run the sample application:
$ $HOME/my_workspace/bazel-bin/examples/java/hello-world