|
| 1 | +--- |
| 2 | +layout: posts |
| 3 | +title: Bazel 0.5.0 Released |
| 4 | +--- |
| 5 | + |
| 6 | +We are delighted to announce the [0.5.0 release of |
| 7 | +Bazel](https://github.com/bazelbuild/bazel/releases/tag/0.5.0) (follow the link |
| 8 | +for the full release notes and list of changes). |
| 9 | + |
| 10 | +This release simplifies Bazel installation on Windows and platforms where a JDK |
| 11 | +is not available. It solidifies the Build Event Protocol and [Remote Execution |
| 12 | +APIs](https://docs.google.com/document/d/1AaGk7fOPByEvpAbqeXIyE8HX_A3_axxNnvroblTZ_6s/edit). |
| 13 | + |
| 14 | +## Improvements from our roadmap |
| 15 | + |
| 16 | +### Bundled JDK |
| 17 | + |
| 18 | +As announced earlier, when using an install script, bazel now comes by default |
| 19 | +bundled with JDK 8. This means fewer steps required to install Bazel. Read more |
| 20 | +about JDK 7 deprecation in [the related blog |
| 21 | +post](https://bazel.build/blog/2017/04/21/JDK7-deprecation.html). |
| 22 | + |
| 23 | +### Windows support: now in beta |
| 24 | + |
| 25 | +Bazel on Windows is now easier to install: it is no longer linked with MSYS. A |
| 26 | +following blog post will detail this further. Bazel is now able to build Java, |
| 27 | +C++ and Python on Windows. |
| 28 | + |
| 29 | +### Build Event Protocol |
| 30 | + |
| 31 | +The [Build Event |
| 32 | +Protocol](https://github.com/bazelbuild/bazel/blob/master/src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.proto) |
| 33 | +is now available as an experimental option; it enables programmatic subscription |
| 34 | +to Bazel's events (build started, action status, target completed, test |
| 35 | +results…). Currently, the protocol can only be written to a file. A gRPC |
| 36 | +transport is already in the works and will be added in the next minor release. |
| 37 | +The API will be stabilized in 0.5.1. |
| 38 | + |
| 39 | +### Coverage support for pure Java targets |
| 40 | + |
| 41 | +Use bazel coverage //my:target to generate coverage information from a |
| 42 | +java\_test. |
| 43 | + |
| 44 | +## Other major changes since 0.4.0 |
| 45 | + |
| 46 | +### New rules |
| 47 | + |
| 48 | +New rules in Bazel: |
| 49 | +[proto\_library](https://bazel.build/versions/master/docs/be/protocol-buffer.html#proto_library), |
| 50 | +[java\_lite\_proto\_library](https://bazel.build/versions/master/docs/be/java.html#java_lite_proto_library), |
| 51 | +[java\_proto\_library](https://bazel.build/versions/master/docs/be/java.html#java_proto_library) |
| 52 | +and |
| 53 | +[cc\_proto\_library](https://bazel.build/versions/master/docs/be/c-cpp.html#cc_proto_library). |
| 54 | + |
| 55 | +### New Apple rules |
| 56 | + |
| 57 | +There is a new repository for building for Apple platforms: |
| 58 | +[https://github.com/bazelbuild/rules\_apple](https://github.com/bazelbuild/rules_apple). |
| 59 | +These rules replace the deprecated iOS/watchOS rules built into Bazel. By |
| 60 | +rebuilding the rules from the ground up in Skylark and hosting them separately, |
| 61 | +we can more quickly fix bugs and implement new Apple features and platform |
| 62 | +versions as they become available. |
| 63 | + |
| 64 | +### Android Support Improvements |
| 65 | + |
| 66 | +- Integration with the Android Support Repository libraries in |
| 67 | + android\_sdk\_repository. |
| 68 | +- Support for Java 8 in Android builds with --experimental\_desugar\_for\_android. |
| 69 | + See [Android Studio's |
| 70 | + documentation](https://developer.android.com/studio/preview/features/java8-support.html) |
| 71 | + for more details about Android's Java 8 language features. |
| 72 | +- Multidex is now fully supported via |
| 73 | + [android\_binary.multidex](https://bazel.build/versions/master/docs/be/android.html#android_binary.multidex). |
| 74 | +- android\_ndk\_repository now supports Android NDK 13 and NDK 14. |
| 75 | +- APKs are now signed with both APK Signature V1 and V2. |
| 76 | + See [Android |
| 77 | + documentation](https://source.android.com/security/apksigning/v2.html) for more |
| 78 | + details about APK Signature Scheme v2. |
| 79 | + |
| 80 | +### Remote Execution API |
| 81 | + |
| 82 | +We fixed a number of bugs in the Remote Execution implementation. The final RPC |
| 83 | +API design has been sent to |
| 84 | +[bazel-discuss@](https://groups.google.com/forum/#!forum/bazel-discuss) for |
| 85 | +discussion (see [Design Document: Remote Execution |
| 86 | +API](https://docs.google.com/document/d/1AaGk7fOPByEvpAbqeXIyE8HX_A3_axxNnvroblTZ_6s/edit#heading=h.ole76l21af90)) |
| 87 | +and it should be finalized in the 0.6.0 release. The final API should only be a |
| 88 | +minor change compared to the implementation in this 0.5.0 release. |
| 89 | + |
| 90 | +## Skylark |
| 91 | + |
| 92 | +- Declared Providers are now implemented and |
| 93 | + [documented](https://bazel.build/versions/master/docs/skylark/rules.html#providers). |
| 94 | + They enable more robust and clearly defined interfaces between different |
| 95 | + rules and aspects. We recommend using them for all rules and aspects. |
| 96 | +- The type formerly known as 'set' is now called 'depset'. Depsets make your |
| 97 | + rules perform much better, allowing rules memory consumption to scale |
| 98 | + linearly instead of quadratically with build graph size - make sure you have |
| 99 | + read the |
| 100 | + [documentation on depsets](https://bazel.build/versions/master/docs/skylark/depsets.html). |
| 101 | + |
| 102 | +## Finally... |
| 103 | + |
| 104 | +A big thank you to our community for your continued support. |
| 105 | +Particular shout-outs to Peter Mounce for the [Chocolatey Windows |
| 106 | +package](https://bazel.build/versions/master/docs/install-windows.html) and Yuki |
| 107 | +Yugui Sonoda for maintaining [rules\_go](https://github.com/bazelbuild/rules_go) |
| 108 | +(they both received an [open source peer |
| 109 | +bonus](https://opensource.googleblog.com/2017/03/the-latest-round-of-google-open-source.html) |
| 110 | +from Google). |
| 111 | + |
| 112 | +Thank you all, keep the |
| 113 | +[questions](http://stackoverflow.com/questions/tagged/bazel) and [bug |
| 114 | +reports](https://github.com/bazelbuild/bazel/issues) coming! |
| 115 | + |
| 116 | +\--- |
| 117 | + |
| 118 | +## FULL RELEASE NOTES: |
| 119 | + |
| 120 | +### Incompatible changes: |
| 121 | + |
| 122 | +- Bazel's Linux sandbox no longer mounts an empty tmpfs on /tmp, |
| 123 | + instead the existing /tmp is mounted read-write. If you prefer |
| 124 | + to have a tmpfs on /tmp for sandboxed actions for increased |
| 125 | + hermeticity, please use the flag --sandbox\_tmpfs\_path=/tmp. |
| 126 | +- Converting artifacts to strings and printing them now return |
| 127 | + "File" instead of "Artifact" to be consistent with the type name. |
| 128 | +- The return type of depset.to\_list() is now a list rather than a |
| 129 | + frozen list. (Modifying the list has no effect on the depset.) |
| 130 | +- Bazel now prints logs in single lines to java.log |
| 131 | +- --use\_dash, --dash\_url and --dash\_secret are removed. |
| 132 | +- Remote repositories must define any remote repositories they |
| 133 | + themselves use (e.g., if @x//:foo depends on @y//:bar, @y must be |
| 134 | + defined |
| 135 | + in @x's WORKSPACE file). |
| 136 | +- Remote repositories must define any remote repositories they |
| 137 | + themselves use (e.g., if @x//:foo depends on @y//:bar, @y must be |
| 138 | + defined |
| 139 | + in @x's WORKSPACE file). |
| 140 | +- objc\_xcodeproj has been removed, use tulsi.bazel.build instead. |
| 141 | + |
| 142 | +### New features: |
| 143 | + |
| 144 | +- If grte\_top is a label, it can now follow non-configurable |
| 145 | + redirects. |
| 146 | +- Optional coverage\_files attribute to cc\_toolchain |
| 147 | +- "query --output=build" now includes select()s |
| 148 | +- Raw LLVM profiles are now supported. |
| 149 | + |
| 150 | +### Important changes: |
| 151 | + |
| 152 | +- Automatically generate Proguard mapping when resource shrinking |
| 153 | + and Proguard are enabled. |
| 154 | +- New rules in Bazel: proto\_library, java\_lite\_proto\_library, |
| 155 | + java\_proto\_library and cc\_proto\_library |
| 156 | +- Activate the "dead\_strip" feature if objc binary stripping is |
| 157 | + enabled. |
| 158 | +- More stable naming scheme for lambda classes in desugared android |
| 159 | + code |
| 160 | +- Convert --use\_action\_cache to a regular option |
| 161 | +- Per-architecture dSYM binaries are now propagated by |
| 162 | + apple\_binary's AppleDebugOutputsProvider. |
| 163 | +- Avoid factory methods when desugaring stateless lambdas for |
| 164 | + Android |
| 165 | +- desugar calls to Objects.requireNonNull(Object o) with |
| 166 | + o.getClass() for android |
| 167 | +- Add an --copy\_bridges\_from\_classpath argument to android |
| 168 | + desugaring tool |
| 169 | +- Change how desugar finds desugared classes to have it working on |
| 170 | + Windows |
| 171 | +- Evaluation of commands on TargetsBelowDirectory patterns |
| 172 | + (e.g. //foo/...) matching packages that fail to load now report |
| 173 | + more |
| 174 | + detailed error messages in keep\_going mode. |
| 175 | +- Allow to have several inputs and outputs |
| 176 | +- Repository context's execute() function can print stdout/stderr |
| 177 | + while running. To enable, pass quiet=False. |
| 178 | +- Bazel can now be built with a bundled version of the OpenJDK. |
| 179 | + This makes it possible to use Bazel on systems without a JDK, or |
| 180 | + where |
| 181 | + the installed JDK is too old. |
| 182 | +- The --jobs flag now defaults to "auto", which causes Bazel to |
| 183 | + use a reasonable degree of parallelism based on the local |
| 184 | + machine's |
| 185 | + capacity. |
| 186 | +- Bazel benchmark (perf.bazel.build) supports Java and Cpp targets. |
| 187 | +- no factory methods generated for lambda expressions on android |
| 188 | +- The Linux sandbox no longer changes the user to 'nobody' by |
| 189 | + default, instead the current user is used as is. The old behavior |
| 190 | + can be |
| 191 | + restored via the --sandbox\_fake\_username flag. |
| 192 | +- /tmp and /dev/shm are now writable by default inside the |
| 193 | + Linux sandbox. |
| 194 | +- Bazel can now use the process-wrapper + symlink tree based |
| 195 | + sandbox implementation in FreeBSD. |
| 196 | +- turn on --experimental\_incremental\_dexing\_error\_on\_missed\_jars by |
| 197 | + default. |
| 198 | +- All android\_binarys are now signed with both Apk Signature V1 and |
| 199 | + V2. See https://source.android.com/security/apksigning/v2.html |
| 200 | + for more details. |
| 201 | +- Windows MSVC wrappers: Not filtering warning messages anymore, |
| 202 | + use --copt=-w and --host\_copt=-w to suppress them. |
| 203 | +- A downloader bug was fixed that prevented RFC 7233 Range |
| 204 | + connection resumes from working with certain HTTP servers |
| 205 | +- Introduces experimental android\_device rule for configuring and |
| 206 | + launching Android emulators. |
| 207 | +- For boolean flags, setting them to false using --no\_<flag\_name> |
| 208 | + is deprecated. Use --no<flag\_name> without the underscore, or |
| 209 | + --<flag\_name>=false instead. |
| 210 | +- Add --experimental\_android\_compress\_java\_resources flag to store |
| 211 | + java |
| 212 | + resources as compressed inside the APK. |
| 213 | +- Removed --experimental\_use\_jack\_for\_dexing and libname.jack |
| 214 | + output of |
| 215 | + android\_library. |
| 216 | +- blaze canonicalize-flags now takes a --show\_warnings flag |
| 217 | +- Changing --invocation\_policy will no longer force a server |
| 218 | + restart. |
| 219 | +- Bazel now supports Android NDK14. |
| 220 | +- android\_binary multidex should now work without additional flags. |
| 221 | +- Use action\_config in crosstool for static library archiving, |
| 222 | + remove ar\_flag. |
| 223 | +- new option for bazel canonicalize-flags, --canonicalize\_policy |
| 224 | +- Use action\_config in crosstool for static library archiving, |
| 225 | + remove ar\_flag. |
| 226 | +- android\_library exports\_manifest now defaults to True. |
| 227 | +- Fix select condition intersections. |
| 228 | +- Adds a --override\_repository option that takes a repository |
| 229 | + name and path. This forces Bazel to use the directory at that path |
| 230 | + for the repository. Example usage: |
| 231 | + `--override_repository=foo=/home/user/gitroot/foo`. |
| 232 | +- fix idempotency issue with desugaring lambdas in interface |
| 233 | + initializers for android |
| 234 | +- --experimental\_android\_use\_singlejar\_for\_multidex is now a no-op |
| 235 | + and will eventually be removed. |
| 236 | +- Every local\_repository now requires a WORKSPACE file. |
| 237 | +- Remove jack and jill attributes of the android\_sdk rule. |
| 238 | +- Add Skylark stubs needed to remove sysroot from CppConfiguration. |
| 239 | +- Desugar try-with-resources so that this language feature is |
| 240 | + available |
| 241 | + to deveces with API level under 19. |
| 242 | +- The flag --worker\_max\_retries was removed. The |
| 243 | + WorkerSpawnStrategy no longer retries execution of failed Spawns, |
| 244 | + the reason being that this just masks compiler bugs and isn't |
| 245 | + done for any other execution strategy either. |
| 246 | +- Bazel will no longer gracefully restart workers that crashed / |
| 247 | + quit, instead this triggers a build failure. |
| 248 | +- All java resources are now compressed in android\_binary APKs by |
| 249 | + default. |
| 250 | +- All java resources are now compressed in android\_binary APKs by |
| 251 | + default. |
| 252 | +- android\_ndk\_repository now creates a cc\_library |
| 253 | + (@androidndk//:cpufeatures) for the cpufeatures library that is |
| 254 | + bundled in the Android NDK. See |
| 255 | + https://developer.android.com/ndk/guides/cpu-features.html for |
| 256 | + more details. |
| 257 | +- 'output\_groups' and 'instrumented\_files' cannot be specified in |
| 258 | + DefaultInfo. |
| 259 | +- You can increase the CPU reservation for tests by adding a |
| 260 | + "cpu:<n>" (e.g. "cpu:4" for four cores) tag to their rule in a |
| 261 | + BUILD file. This can be used if tests would otherwise overwhelm |
| 262 | + your system if there's too much parallelism. |
| 263 | +- Deprecate use\_singlejar\_for\_proguard\_libraryjars and force |
| 264 | + behavior to always on. |
0 commit comments