Skip to content

Commit 981890e

Browse files
committed
Update Travis to use Bazel 0.16.0 and also test against HEAD.
RELNOTES: rules_swift now requires Bazel 0.16.0. PiperOrigin-RevId: 206803918
1 parent dc03bf5 commit 981890e

File tree

5 files changed

+20
-6
lines changed

5 files changed

+20
-6
lines changed

.travis.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,20 @@ matrix:
1717
dist: trusty
1818
sudo: required
1919
env:
20-
- BAZEL=0.14.1 SWIFT_VERSION=4.1.2 TARGETS="//examples/... -//examples/apple/..."
20+
- BAZEL=0.16.0 SWIFT_VERSION=4.1.2 CC=clang TARGETS="//examples/... -//examples/apple/..."
21+
- os: linux
22+
dist: trusty
23+
sudo: required
24+
env:
25+
- BAZEL=HEAD SWIFT_VERSION=4.1.2 CC=clang TARGETS="//examples/... -//examples/apple/..."
26+
- os: osx
27+
osx_image: xcode9.3
28+
env:
29+
- BAZEL=0.16.0 TARGETS=//examples/...
2130
- os: osx
2231
osx_image: xcode9.3
2332
env:
24-
- BAZEL=0.14.1 TARGETS=//examples/...
33+
- BAZEL=HEAD TARGETS=//examples/...
2534

2635
before_install:
2736
- .travis/install.sh

swift/internal/swift_protoc_gen_aspect.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ swift_protoc_gen_aspect = aspect(
462462
"_mkdir_and_run": attr.label(
463463
cfg = "host",
464464
default = Label(
465-
"@build_bazel_rules_swift@bazel_tools//tools/mkdir_and_run",
465+
"@build_bazel_rules_swift//tools/mkdir_and_run",
466466
),
467467
executable = True,
468468
),

swift/internal/swift_toolchain.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ load(
2828
"paths",
2929
"selects",
3030
)
31-
load("//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain")
31+
load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain")
3232

3333
def _default_linker_opts(
3434
cc_toolchain,

swift/repositories.bzl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ def _create_linux_toolchain(repository_ctx):
2020
Args:
2121
repository_ctx: The repository rule context.
2222
"""
23+
if repository_ctx.os.environ.get("CC") != "clang":
24+
fail("ERROR: rules_swift uses Bazel's CROSSTOOL to link, but Swift " +
25+
"requires that the driver used is clang. Please set `CC=clang` in " +
26+
"your environment before invoking Bazel.")
27+
2328
path_to_swiftc = repository_ctx.which("swiftc")
2429
path_to_clang = repository_ctx.which("clang")
2530
root = path_to_swiftc.dirname.dirname
@@ -80,7 +85,7 @@ def _swift_autoconfiguration_impl(repository_ctx):
8085
_create_linux_toolchain(repository_ctx)
8186

8287
_swift_autoconfiguration = repository_rule(
83-
environ = ["PATH"],
88+
environ = ["CC", "PATH"],
8489
implementation=_swift_autoconfiguration_impl,
8590
)
8691

tools/BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ filegroup(
77
name = "for_bazel_tests",
88
testonly = 1,
99
srcs = glob(["**"]) + [
10-
"@build_bazel_rules_swift@bazel_tools//tools/mkdir_and_run:for_bazel_tests",
10+
"@build_bazel_rules_swift//tools/mkdir_and_run:for_bazel_tests",
1111
],
1212
visibility = [
1313
"//:__pkg__",

0 commit comments

Comments
 (0)