Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch release #5786

Closed
wants to merge 16 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,86 @@
## Release 0.16.0 (2018-07-31)

```
Baseline: 4f64b77a3dd8e4ccdc8077051927985f9578a3a5

Cherry picks:
+ 4c9a0c82d308d5df5c524e2a26644022ff525f3e:
reduce the size of bazel's embedded jdk
+ d3228b61f633cdc5b3f740b641a0836f1bd79abd:
remote: limit number of open tcp connections by default. Fixes
#5491
+ 8ff87c164f48dbabe3b20becd00dde90c50d46f5:
Fix autodetection of linker flags
+ c4622ac9205d2f1b42dac8c598e83113d39e7f11:
Fix autodetection of -z linker flags
+ 10219659f58622d99034288cf9f491865f818218:
blaze_util_posix.cc: fix order of #define
+ ab1f269017171223932e0da9bb539e8a17dd99ed:
blaze_util_freebsd.cc: include path.h explicitly
+ 68e92b45a37f2142c768a56eb7ecfa484b8b22df:
openjdk: update macOS openjdk image. Fixes #5532
+ f45c22407e6b00fcba706eb62141cb9036bd38d7:
Set the start time of binary and JSON profiles to zero correctly.
+ bca1912853086b8e9a28a85a1b144ec0dc9717cc:
remote: fix race on download error. Fixes #5047
+ 3842bd39e10612c7eef36c6048407e81bcd0a8fb:
jdk: use parallel old gc and disable compact strings
```

Incompatible changes:

- The $(ANDROID_CPU) Make variable is not available anymore. Use
$(TARGET_CPU) after an Android configuration transition instead.
- The $(JAVA_TRANSLATIONS) Make variable is not supported anymore.
- Skylark structs (using struct()) may no longer have to_json and
to_proto overridden.
- The mobile-install --skylark_incremental_res flag is no longer
available, use the --skylark flag instead.

New features:

- android_local_test now takes advantage of Robolectric's binary
resource processing which allows for faster tests.
- Allow @ in package names.

Important changes:

- Option --glibc is removed, toolchain selection relies solely on
--cpu and --compiler options.
- Build support for enabling cross binary FDO optimization.
- The --distdir option is no longer experimental. This
option allows to specify additional directories to look for
files before trying to fetch them from the network. Files from
any of the distdirs are only used if a checksum for the file
is specified and both, the filename and the checksum, match.
- Java coverage works now with multiple jobs.
- Flip default value of --experimental_shortened_obj_file_path to
true, Bazel now generates short object file path by default.
- New rules for importing Android dependencies:
`aar_import_external` and `aar_maven_import_external`.
`aar_import_external` enables specifying external AAR
dependencies using a list of HTTP URLs for the artifact.
`aar_maven_import_external` enables specifying external AAR
dependencies using the artifact coordinate and a list of server
URLs.
- The BAZEL_JAVAC_OPTS environment variable allows arguments, e.g.,
"-J-Xmx2g", may be passed to the javac compiler during bootstrap
build. This is helpful if your system chooses too small of a max
heap size for the Java compiler during the bootstrap build.
- --noexpand_configs_in_place is deprecated.
- A tool to parse the Bazel execution log.
- Support for LIPO has been fully removed.
- Remove support for --discard_actions_after_execution.
- Add --materialize_param_files flag to write parameter files even
when actions are executed remotely.
- Windows default system bazelrc is read from the user's
ProgramData if present.
- --[no]allow_undefined_configs no longer exists, passing undefined
configs is an error.
- In remote caching we limit the number of open
TCP connections to 100 by default. The number can be adjusted
by specifying the --remote_max_connections flag.

## Release 0.15.0 (2018-06-26)

```
Expand Down Expand Up @@ -3001,5 +3084,6 @@ Initial release.






24 changes: 12 additions & 12 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -117,31 +117,31 @@ distdir_tar(
# OpenJDK distributions used to create a version of Bazel bundled with the OpenJDK.
http_file(
name = "openjdk_linux",
sha256 = "45f2dfbee93b91b1468cf81d843fc6d9a47fef1f831c0b7ceff4f1eb6e6851c8",
sha256 = "85b81652b3fe8cfb0a2cfb835988672bde7844f613dae5b9487b5b44921a1afd",
urls = [
"https://mirror.bazel.build/openjdk/azul-zulu-9.0.7.1-jdk9.0.7/zulu9.0.7.1-jdk9.0.7-linux_x64.tar.gz",
"https://bazel-mirror.storage.googleapis.com/openjdk/azul-zulu-9.0.7.1-jdk9.0.7/zulu9.0.7.1-jdk9.0.7-linux_x64.tar.gz",
"https://cdn.azul.com/zulu/bin/zulu9.0.7.1-jdk9.0.7-linux_x64.tar.gz",
"https://mirror.bazel.build/openjdk/azul-zulu-8.28.0.1-jdk8.0.163/zulu8.28.0.1-jdk8.0.163-linux_x64.tar.gz",
"https://bazel-mirror.storage.googleapis.com/openjdk/azul-zulu-8.28.0.1-jdk8.0.163/zulu8.28.0.1-jdk8.0.163-linux_x64.tar.gz",
"https://cdn.azul.com/zulu/bin/zulu8.28.0.1-jdk8.0.163-linux_x64.tar.gz",
],
)

http_file(
name = "openjdk_macos",
sha256 = "5a5b3225b86d3fdb51e9add5335f43cc19c6b2d9b8b5558e72b52d7b2ce9162e",
sha256 = "292a44695e708a8822b3d0a462faf32887ddb80b56aa91e7598fd4b6f6341f69",
urls = [
"https://mirror.bazel.build/openjdk/azul-zulu-9.0.7.1-jdk9.0.7/zulu9.0.7.1-jdk9.0.7-macosx_x64.tar.gz",
"https://bazel-mirror.storage.googleapis.com/openjdk/azul-zulu-9.0.7.1-jdk9.0.7/zulu9.0.7.1-jdk9.0.7-macosx_x64.tar.gz",
"https://cdn.azul.com/zulu/bin/zulu9.0.7.1-jdk9.0.7-macosx_x64.tar.gz",
"https://mirror.bazel.build/openjdk/azul-zulu-8.28.0.1-jdk8.0.163/zulu8.28.0.1-jdk8.0.163-macosx_x64.tar.gz",
"https://bazel-mirror.storage.googleapis.com/openjdk/azul-zulu-8.28.0.1-jdk8.0.163/zulu8.28.0.1-jdk8.0.163-macosx_x64.tar.gz",
"https://cdn.azul.com/zulu/bin/zulu8.28.0.1-jdk8.0.163-macosx_x64.tar.gz",
],
)

http_file(
name = "openjdk_win",
sha256 = "75f76c53c6a1f12b1a571b86bd9708ab75adf582d689dddc94fdd77dcc0f3f5c",
sha256 = "0c5ea3634ae7d7851630cf61fdd6344cce110cf9246593345e49fc430bb39442",
urls = [
"https://mirror.bazel.build/openjdk/azul-zulu-9.0.7.1-jdk9.0.7/zulu9.0.7.1-jdk9.0.7-win_x64.zip",
"https://bazel-mirror.storage.googleapis.com/openjdk/azul-zulu-9.0.7.1-jdk9.0.7/zulu9.0.7.1-jdk9.0.7-win_x64.zip",
"https://cdn.azul.com/zulu/bin/zulu9.0.7.1-jdk9.0.7-win_x64.zip",
"https://mirror.bazel.build/openjdk/azul-zulu-8.28.0.1-jdk8.0.163/zulu8.28.0.1-jdk8.0.163-win_x64.zip",
"https://bazel-mirror.storage.googleapis.com/openjdk/azul-zulu-8.28.0.1-jdk8.0.163/zulu8.28.0.1-jdk8.0.163-win_x64.zip",
"https://cdn.azul.com/zulu/bin/zulu8.28.0.1-jdk8.0.163-win_x64.zip",
],
)

Expand Down
4 changes: 2 additions & 2 deletions compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ display "."
log "Building output/bazel"
# We set host and target platform directly since the defaults in @bazel_tools
# have not yet been generated.
bazel_build "src:bazel_nojdk${EXE_EXT}" \
bazel_build "src:bazel${EXE_EXT}" \
--host_platform=@bazel_tools//platforms:host_platform \
--platforms=@bazel_tools//platforms:target_platform \
|| fail "Could not build Bazel"
bazel_bin_path="$(get_bazel_bin_path)/src/bazel_nojdk${EXE_EXT}"
bazel_bin_path="$(get_bazel_bin_path)/src/bazel${EXE_EXT}"
[ -e "$bazel_bin_path" ] \
|| fail "Could not find freshly built Bazel binary at '$bazel_bin_path'"
cp -f "$bazel_bin_path" "output/bazel${EXE_EXT}" \
Expand Down
5 changes: 5 additions & 0 deletions scripts/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,18 @@ genrule(
cmd = " ".join([
"$(location :generate_bash_completion.sh)",
"--bazel=$(location //src:bazel)",
"--javabase=$(JAVABASE)",
"--output=$@",
"--prepend=$(location bazel-complete-template.bash)",
]),
output_to_bindir = 1,
# Bazel 0.8.0 doesn't have this target under @bazel_tools, so we have to
# use it from the main repository
toolchains = ["@bazel_tools//tools/jdk:current_java_runtime"],
tools = [
":generate_bash_completion.sh",
"//src:bazel",
"//tools/defaults:jdk",
],
visibility = ["//scripts/packages:__subpackages__"],
)
Expand Down
2 changes: 1 addition & 1 deletion scripts/packages/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ genrule(

genrule(
name = "rename-bazel-bin",
srcs = ["//src:bazel"],
srcs = ["//src:bazel_with_jdk"],
outs = ["with-jdk/bazel-real"],
cmd = "mkdir -p $$(dirname $@); cp $< $@",
)
Expand Down
56 changes: 25 additions & 31 deletions src/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ filegroup(
}),
) for suffix, embedded_tools_target in {
"": [":embedded_tools"],
"_nojdk": [":embedded_tools_nojdk"],
"_with_jdk": [":embedded_tools_with_jdk"],
"_notools": [],
}.items()]

Expand Down Expand Up @@ -174,13 +174,26 @@ py_binary(
"//conditions:default": [
"//src/tools/singlejar:singlejar_local",
],
}) + ([":embedded_jdk"] if (suffix == "") else []),
}) + (select({
"//src/conditions:darwin": [
"@openjdk_macos//file",
],
"//src/conditions:darwin_x86_64": [
"@openjdk_macos//file",
],
"//src/conditions:windows": [
"@openjdk_win//file",
],
"//conditions:default": [
"@openjdk_linux//file",
],
}) if (suffix == "_with_jdk") else []),
visibility = [
"//src/test:__subpackages__", # For integration tests
],
) for suffix in [
"",
"_nojdk",
"_with_jdk",
]]

rule_size_test(
Expand All @@ -193,32 +206,13 @@ rule_size_test(
margin = 5, # percentage
)

filegroup(
name = "embedded_jdk",
srcs = select({
"//src/conditions:darwin": [
"@openjdk_macos//file",
],
"//src/conditions:darwin_x86_64": [
"@openjdk_macos//file",
],
"//src/conditions:windows": [
"@openjdk_win//file",
],
"//conditions:default": [
"@openjdk_linux//file",
],
}),
visibility = ["//src/test/shell/bazel:__pkg__"],
)

[srcsfile(
name = "embedded_tools" + suffix + "_params",
srcs = [":embedded_tools" + suffix + "_srcs"],
out = "embedded_tools" + suffix + ".params",
) for suffix in [
"",
"_nojdk",
"_with_jdk",
]]

genrule(
Expand All @@ -233,13 +227,13 @@ genrule(
)

genrule(
name = "embedded_tools_nojdk",
name = "embedded_tools_with_jdk",
srcs = [
":embedded_tools_nojdk_params",
":embedded_tools_nojdk_srcs",
":embedded_tools_with_jdk_params",
":embedded_tools_with_jdk_srcs",
],
outs = ["embedded_tools_nojdk.zip"],
cmd = "$(location :create_embedded_tools) \"$@\" $(location :embedded_tools_nojdk_params)",
outs = ["embedded_tools_with_jdk.zip"],
cmd = "$(location :create_embedded_tools) \"$@\" $(location :embedded_tools_with_jdk_params)",
tools = [":create_embedded_tools"],
)

Expand All @@ -264,7 +258,7 @@ genrule(
) for suffix, embed in [
("", True),
("_notools", False),
("_nojdk", True),
("_with_jdk", True),
]]

[genrule(
Expand All @@ -289,7 +283,7 @@ genrule(
) for suffix in [
"",
"_notools",
"_nojdk",
"_with_jdk",
]]

# Build an executable named `bazel.exe`.
Expand All @@ -310,7 +304,7 @@ genrule(
) for suffix in [
"",
"_notools",
"_nojdk",
"_with_jdk",
]]

filegroup(
Expand Down
7 changes: 0 additions & 7 deletions src/main/cpp/blaze.cc
Original file line number Diff line number Diff line change
Expand Up @@ -418,13 +418,6 @@ static vector<string> GetArgumentArray(
result.push_back("-XX:HeapDumpPath=" +
blaze_util::PathAsJvmFlag(heap_crash_path));

// TODO(b/109998449): only assume JDK >= 9 for embedded JDKs
if (!globals->options->GetEmbeddedJavabase().empty()) {
// quiet warnings from com.google.protobuf.UnsafeUtil,
// see: https://github.com/google/protobuf/issues/3781
result.push_back("--add-opens=java.base/java.nio=ALL-UNNAMED");
}

result.push_back("-Xverify:none");

vector<string> user_options;
Expand Down
1 change: 1 addition & 0 deletions src/main/cpp/blaze_util_freebsd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include "src/main/cpp/util/exit_code.h"
#include "src/main/cpp/util/file.h"
#include "src/main/cpp/util/logging.h"
#include "src/main/cpp/util/path.h"
#include "src/main/cpp/util/port.h"
#include "src/main/cpp/util/strings.h"

Expand Down
2 changes: 1 addition & 1 deletion src/main/cpp/blaze_util_posix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#define _WITH_DPRINTF
#include "src/main/cpp/blaze_util_platform.h"

#define _WITH_DPRINTF
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
Expand Down
16 changes: 4 additions & 12 deletions src/main/cpp/startup_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -414,24 +414,16 @@ string StartupOptions::GetSystemJavabase() const {
return blaze::GetSystemJavabase();
}

string StartupOptions::GetEmbeddedJavabase() {
string bundled_jre_path = blaze_util::JoinPath(
install_base, "_embedded_binaries/embedded_tools/jdk");
if (blaze_util::CanExecuteFile(blaze_util::JoinPath(
bundled_jre_path, GetJavaBinaryUnderJavabase()))) {
return bundled_jre_path;
}
return "";
}

string StartupOptions::GetHostJavabase() {
// 1) Allow overriding the host_javabase via --host_javabase.
if (!host_javabase.empty()) {
return host_javabase;
}
if (default_host_javabase.empty()) {
string bundled_jre_path = GetEmbeddedJavabase();
if (!bundled_jre_path.empty()) {
string bundled_jre_path = blaze_util::JoinPath(
install_base, "_embedded_binaries/embedded_tools/jdk");
if (blaze_util::CanExecuteFile(blaze_util::JoinPath(
bundled_jre_path, GetJavaBinaryUnderJavabase()))) {
// 2) Use a bundled JVM if we have one.
default_host_javabase = bundled_jre_path;
} else {
Expand Down
3 changes: 0 additions & 3 deletions src/main/cpp/startup_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,6 @@ class StartupOptions {
// from a blazerc file, if a key is not present, it is the default.
std::map<std::string, std::string> option_sources;

// Returns the embedded JDK, or an empty string.
std::string GetEmbeddedJavabase();

// Returns the GetHostJavabase. This should be called after parsing
// the --host_javabase option.
std::string GetHostJavabase();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -564,10 +564,10 @@ public synchronized void start(
FileWriter writer = null;
if (stream != null) {
if (format == Format.BINARY_BAZEL_FORMAT) {
writer = new BinaryFormatWriter(stream, profileStartTime, comment);
writer = new BinaryFormatWriter(stream, execStartTimeNanos, comment);
writer.start();
} else if (format == Format.JSON_TRACE_FILE_FORMAT) {
writer = new JsonTraceFileWriter(stream, profileStartTime);
writer = new JsonTraceFileWriter(stream, execStartTimeNanos);
writer.start();
}
}
Expand Down
Loading