commit | 13459b4ee0e743da8f8416fc16bce64687f0c406 | [log] [tgz] |
---|---|---|
author | Michajlo Matijkiw <michajlo@google.com> | Thu Mar 12 19:43:20 2015 +0000 |
committer | Han-Wen Nienhuys <hanwen@google.com> | Fri Mar 13 14:39:06 2015 +0000 |
tree | 2eb32207d9978f15aeeab9bfe048af3d0dd35859 | |
parent | 94588c2ceebca3328d3b84566306c91a8600fae6 [diff] |
add baseline functionality for not saving unused artifacts We define unused artifacts as those that aren't consumed by any action. This can be because an action produced more outputs than a dependent action needed, or because it's a top level artifact and we don't care about its contents, just that it was built without issue. Actions may prevent outputs from being discarded by declaring them as mandatory. This is particularly useful for test outputs. The motivation behind this change is to reduce storage overhead for things we can do without. It is worth noting this change doesn't cover all cases. In particular it has difficulty identifying *_binary artifacts as orphaned. This is due to the insertion of a virtual runfiles artifact which depends upon the rule's outputs. -- MOS_MIGRATED_REVID=88467504
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-native/src/main/java/com/example/myproject:hello-world
Note: on OS X, you must specify --cpu=darwin to build Java programs, for example:
$ bazel build --cpu=darwin //examples/java-native/src/main/java/com/example/myproject:hello-world
The build output is located in $HOME/my_workspace/bazel-bin/examples/java-native/src/main/java/com/example/myproject/
.
Run the sample application:
$ $HOME/my_workspace/bazel-bin/examples/java-native/src/main/java/com/example/myproject/hello-world