Skip to content
This repository was archived by the owner on Jun 4, 2024. It is now read-only.

Commit 81dd793

Browse files
James Juddandyscott
James Judd
authored andcommitted
[WIP] Bazel 25 compatibility (#185)
* Update protobuf to remove warning The older version of protobuf is causing a warning like: An illegal reflective access operation has occurred * Bazel 25 compatibility Includes updating the _java attribute to use current_java_runtime and get rid of warnings. The current code with more recent versions of Bazel causes a warning about using the deprecated target '@local_jdk//:java' and to use use @bazel_tools//tools/jdk:current_java_runtime instead (see bazelbuild/bazel#5594). Resolves #122 * Update travis images
1 parent 1b3ca25 commit 81dd793

32 files changed

+342
-1935
lines changed

.bazelrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
common --config=rules
2-
common:v0.21 --config=rules_v0.21
2+
common:v0.25 --config=rules_v0.25
33
import %workspace%/.bazelrc_shared

.bazelrc_shared

+6-38
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ common --color=yes
33

44
build --experimental_strict_action_env
55
build --javacopt="-source 8 -target 8"
6+
67
build --strategy=ScalaCompile=worker
78
build --worker_max_instances=4
89
build --worker_sandboxing
@@ -13,49 +14,16 @@ test --test_output=all
1314
build:rules --disk_cache=.bazel_cache
1415
build:tests --disk_cache=../.bazel_cache
1516

16-
# bazel 0.21.0
17-
18-
# appease io_bazel/third_party/protobuf/3.6.1/protobuf.bzl
19-
common:v0.21 --incompatible_disable_deprecated_attr_params=false
20-
21-
# most of --all_incompatible_changes expanded
22-
common:rules_v0.21 --incompatible_bzl_disallow_load_after_statement
23-
common:rules_v0.21 --incompatible_depset_is_not_iterable
24-
common:rules_v0.21 --incompatible_depset_union
25-
common:rules_v0.21 --incompatible_disable_objc_provider_resources
26-
common:rules_v0.21 --incompatible_disallow_data_transition
27-
common:rules_v0.21 --incompatible_disallow_dict_plus
28-
common:rules_v0.21 --incompatible_disallow_filetype
29-
common:rules_v0.21 --incompatible_disallow_legacy_javainfo
30-
common:rules_v0.21 --incompatible_disallow_load_labels_to_cross_package_boundaries
31-
common:rules_v0.21 --incompatible_disallow_old_style_args_add
32-
common:rules_v0.21 --incompatible_expand_directories
33-
common:rules_v0.21 --incompatible_generate_javacommon_source_jar
34-
common:rules_v0.21 --incompatible_new_actions_api
35-
common:rules_v0.21 --incompatible_no_attr_license
36-
common:rules_v0.21 --incompatible_no_output_attr_default
37-
common:rules_v0.21 --incompatible_no_support_tools_in_action_inputs
38-
common:rules_v0.21 --incompatible_no_target_output_group
39-
common:rules_v0.21 --incompatible_no_transitive_loads
40-
common:rules_v0.21 --incompatible_remove_native_maven_jar
41-
common:rules_v0.21 --incompatible_strict_argument_ordering
42-
common:rules_v0.21 --incompatible_string_is_not_iterable
43-
44-
# appease docker
45-
common:tests_v0.21 --incompatible_remove_native_http_archive=false
46-
common:tests_v0.21 --incompatible_remove_native_git_repository=false
17+
# bazel 0.25.2
18+
common:rules_v0.24 --config=noop
19+
common:rules_v0.25 --config=noop
4720

4821
# route potentially unrouted configs to a terminating noop config
4922
# it's a noop because we use the default value
5023
common:rules --config=noop
5124
common:tests --config=noop
52-
common:v0.19 --config=noop
53-
common:v0.20 --config=noop
54-
common:v0.21 --config=noop
55-
# future proofing
56-
common:v0.22 --config=noop
57-
common:v0.23 --config=noop
58-
common:v0.24 --config=noop
25+
common:v0.24 --config=rules_v0.24
26+
common:v0.25 --config=rules_v0.25
5927

6028
# pick something trivial as a "noop"
6129
common:noop --logging=3

.travis.yml

+12-14
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
dist: trusty
1+
dist: xenial
22
sudo: required
3-
language: java
43

54
addons:
65
apt:
@@ -18,46 +17,45 @@ cache:
1817
# some could be global, but these are OS-specific and ought not to be included
1918
# in the UI or the cache key
2019
_linux: &linux
21-
jdk: oraclejdk8
2220
os: linux
2321
_osx: &osx
2422
os: osx
25-
osx_image: xcode7.3
23+
osx_image: xcode9.3
2624

2725
jobs:
2826
include:
2927
# Build
3028
- stage: build
3129
<<: *osx
32-
env: BAZEL_VERSION=0.21.0
30+
env: BAZEL_VERSION=0.24.1
3331
script: ./scripts/travis.sh build
3432
- <<: *linux
35-
env: BAZEL_VERSION=0.21.0
33+
env: BAZEL_VERSION=0.24.1
3634
script: ./scripts/travis.sh build
3735
- <<: *osx
38-
env: BAZEL_VERSION=0.22.0
36+
env: BAZEL_VERSION=0.25.2
3937
script: ./scripts/travis.sh build
4038
- <<: *linux
41-
env: BAZEL_VERSION=0.22.0
39+
env: BAZEL_VERSION=0.25.2
4240
script: ./scripts/travis.sh build
4341
# Lint
4442
- stage: test
4543
<<: *osx
46-
env: BAZEL_VERSION=0.22.0
44+
env: BAZEL_VERSION=0.24.1
4745
script: ./scripts/travis.sh lint
4846
- <<: *linux
49-
env: BAZEL_VERSION=0.22.0
47+
env: BAZEL_VERSION=0.25.2
5048
script: ./scripts/travis.sh lint
5149
# Test
5250
- <<: *osx
53-
env: BAZEL_VERSION=0.21.0
51+
env: BAZEL_VERSION=0.24.1
5452
script: ./scripts/travis.sh test
5553
- <<: *linux
56-
env: BAZEL_VERSION=0.21.0
54+
env: BAZEL_VERSION=0.24.1
5755
script: ./scripts/travis.sh test
5856
- <<: *osx
59-
env: BAZEL_VERSION=0.22.0
57+
env: BAZEL_VERSION=0.25.2
6058
script: ./scripts/travis.sh test
6159
- <<: *linux
62-
env: BAZEL_VERSION=0.22.0
60+
env: BAZEL_VERSION=0.25.2
6361
script: ./scripts/travis.sh test

README.md

+7-4
Original file line numberDiff line numberDiff line change
@@ -75,16 +75,19 @@ scala_register_toolchains()
7575
git_repository(
7676
name = "bazel_skylib",
7777
remote = "https://github.com/bazelbuild/bazel-skylib.git",
78-
tag = "0.6.0",
78+
tag = "0.8.0",
7979
)
8080

8181
http_archive(
8282
name = "com_google_protobuf",
83-
sha256 = "2c8f8614fb1be709d68abaab6b4791682aa7db2048012dd4642d3a50b4f67cb3",
84-
strip_prefix = "protobuf-0038ff49af882463c2af9049356eed7df45c3e8e",
85-
urls = ["https://github.com/google/protobuf/archive/0038ff49af882463c2af9049356eed7df45c3e8e.zip"],
83+
sha256 = "0963c6ae20340ce41f225a99cacbcba8422cebe4f82937f3d9fa3f5dd7ae7342",
84+
strip_prefix = "protobuf-9f604ac5043e9ab127b99420e957504f2149adbe",
85+
urls = ["https://github.com/google/protobuf/archive/9f604ac5043e9ab127b99420e957504f2149adbe.zip"],
8686
)
8787

88+
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
89+
protobuf_deps()
90+
8891
# Specify the scala compiler we wish to use; in this case, we'll use the default one specified in rules_scala_annex
8992
bind(
9093
name = "default_scala",

WORKSPACE

+43-10
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,62 @@ load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
55

66
http_archive(
77
name = "io_bazel",
8-
sha256 = "f44ad96857209fe76d7321185d1b9ad6861a469752432ffaccaf838858708cdf",
9-
strip_prefix = "bazel-defd737761be2b154908646121de47c30434ed51",
10-
urls = ["https://github.com/bazelbuild/bazel/archive/defd737761be2b154908646121de47c30434ed51.zip"],
8+
sha256 = "437b3237f15e6ce950ae7f892673f65fc83642847e8c12c4c00b19b00b6e0690",
9+
strip_prefix = "bazel-318aebb523b3c91275855e35f0a67814e0d2231f",
10+
urls = ["https://github.com/bazelbuild/bazel/archive/318aebb523b3c91275855e35f0a67814e0d2231f.zip"],
1111
)
1212

1313
http_archive(
1414
name = "io_bazel_skydoc",
15-
sha256 = "4e9bd9ef65af54dedd997b408fa26c2e70c30ee8e078bcc1b51a33cf7d7f9d7e",
16-
strip_prefix = "skydoc-77e5399258f6d91417d23634fce97d73b40cf337",
17-
urls = ["https://github.com/bazelbuild/skydoc/archive/77e5399258f6d91417d23634fce97d73b40cf337.zip"],
15+
sha256 = "694602137e5d56cfd35622cf58c047549324a0db1522ee944ad86e74420be9db",
16+
strip_prefix = "skydoc-b8a32e07ee8297c89ca8020af4fa2163a766706f",
17+
urls = ["https://github.com/bazelbuild/skydoc/archive/b8a32e07ee8297c89ca8020af4fa2163a766706f.zip"],
1818
)
1919

2020
git_repository(
2121
name = "bazel_skylib",
2222
remote = "https://github.com/bazelbuild/bazel-skylib.git",
23-
tag = "0.6.0",
23+
tag = "0.8.0",
2424
)
2525

2626
http_archive(
2727
name = "com_google_protobuf",
28-
sha256 = "2c8f8614fb1be709d68abaab6b4791682aa7db2048012dd4642d3a50b4f67cb3",
29-
strip_prefix = "protobuf-0038ff49af882463c2af9049356eed7df45c3e8e",
30-
urls = ["https://github.com/google/protobuf/archive/0038ff49af882463c2af9049356eed7df45c3e8e.zip"],
28+
sha256 = "0963c6ae20340ce41f225a99cacbcba8422cebe4f82937f3d9fa3f5dd7ae7342",
29+
strip_prefix = "protobuf-9f604ac5043e9ab127b99420e957504f2149adbe",
30+
urls = ["https://github.com/google/protobuf/archive/9f604ac5043e9ab127b99420e957504f2149adbe.zip"],
31+
)
32+
33+
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
34+
35+
protobuf_deps()
36+
37+
jdk_build_file_content = """
38+
filegroup(
39+
name = "jdk",
40+
srcs = glob(["**/*"]),
41+
visibility = ["//visibility:public"],
42+
)
43+
filegroup(
44+
name = "java",
45+
srcs = ["bin/java"],
46+
visibility = ["//visibility:public"],
47+
)
48+
"""
49+
50+
http_archive(
51+
name = "jdk8-linux",
52+
build_file_content = jdk_build_file_content,
53+
sha256 = "dd28d6d2cde2b931caf94ac2422a2ad082ea62f0beee3bf7057317c53093de93",
54+
strip_prefix = "jdk8u212-b03",
55+
url = "https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u212-b03/OpenJDK8U-jdk_x64_linux_hotspot_8u212b03.tar.gz",
56+
)
57+
58+
http_archive(
59+
name = "jdk8-osx",
60+
build_file_content = jdk_build_file_content,
61+
sha256 = "3d80857e1bb44bf4abe6d70ba3bb2aae412794d335abe46b26eb904ab6226fe0",
62+
strip_prefix = "jdk8u212-b03",
63+
url = "https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u212-b03/OpenJDK8U-jdk_x64_mac_hotspot_8u212b03.tar.gz",
3164
)
3265

3366
http_archive(

docs/stardoc/external.md

+16-10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
<!-- Generated with Stardoc: http://skydoc.bazel.build -->
2+
3+
<a name="#scala_import_external"></a>
4+
15
## scala_import_external
26

37
<pre>
@@ -14,22 +18,24 @@ scala_import_external(<a href="#scala_import_external-rule_load">rule_load</a>,
1418
<col class="col-description" />
1519
</colgroup>
1620
<tbody>
17-
<tr id="scala_import_external-rule_load>
21+
<tr id="scala_import_external-rule_load">
1822
<td><code>rule_load</code></td>
1923
<td>
20-
required.
24+
optional. default is <code>"load(\"@rules_scala_annex//rules:scala.bzl\", \"scala_import\")"</code>
2125
</td>
2226
</tr>
23-
<tr id="scala_import_external-kwargs>
27+
<tr id="scala_import_external-kwargs">
2428
<td><code>kwargs</code></td>
2529
<td>
26-
optional. default is <code>"load(\"@rules_scala_annex//rules:scala.bzl\", \"scala_import\")"</code>
30+
optional.
2731
</td>
2832
</tr>
2933
</tbody>
3034
</table>
3135

3236

37+
<a name="#scala_maven_import_external"></a>
38+
3339
## scala_maven_import_external
3440

3541
<pre>
@@ -46,28 +52,28 @@ scala_maven_import_external(<a href="#scala_maven_import_external-artifact">arti
4652
<col class="col-description" />
4753
</colgroup>
4854
<tbody>
49-
<tr id="scala_maven_import_external-artifact>
55+
<tr id="scala_maven_import_external-artifact">
5056
<td><code>artifact</code></td>
5157
<td>
5258
required.
5359
</td>
5460
</tr>
55-
<tr id="scala_maven_import_external-server_urls>
61+
<tr id="scala_maven_import_external-server_urls">
5662
<td><code>server_urls</code></td>
5763
<td>
5864
required.
5965
</td>
6066
</tr>
61-
<tr id="scala_maven_import_external-rule_load>
67+
<tr id="scala_maven_import_external-rule_load">
6268
<td><code>rule_load</code></td>
6369
<td>
64-
required.
70+
optional. default is <code>"load(\"@rules_scala_annex//rules:scala.bzl\", \"scala_import\")"</code>
6571
</td>
6672
</tr>
67-
<tr id="scala_maven_import_external-kwargs>
73+
<tr id="scala_maven_import_external-kwargs">
6874
<td><code>kwargs</code></td>
6975
<td>
70-
optional. default is <code>"load(\"@rules_scala_annex//rules:scala.bzl\", \"scala_import\")"</code>
76+
optional.
7177
</td>
7278
</tr>
7379
</tbody>

0 commit comments

Comments
 (0)