Skip to content

Commit

Permalink
Revert "Add support for Bazel LTS version 3.0.0 (bazelbuild#639)"
Browse files Browse the repository at this point in the history
This reverts commit 73f62de.
  • Loading branch information
fejta committed Apr 30, 2021
1 parent 0e5a97f commit 2c63098
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 90 deletions.
31 changes: 16 additions & 15 deletions .bazelci/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildifier:
# TODO (suvanjan): Re-enable once issues are fixed.
warnings: "attr-cfg,attr-license,attr-non-empty,attr-output-default,attr-single-file,confusing-name,constant-glob,ctx-actions,ctx-args,depset-iteration,depset-union,dict-concatenation,duplicated-name,filetype,function-docstring,git-repository,http-archive,integer-division,load,load-on-top,module-docstring,name-conventions,native-build,native-package,no-effect,out-of-order-load,output-group,package-name,package-on-top,positional-args,redefined-variable,repository-name,same-origin-load,string-iteration,unreachable,unsorted-dict-items,unused-variable"
platforms:
ubuntu1804:
ubuntu1604:
build_targets:
- "--"
- "..."
Expand All @@ -18,7 +18,7 @@ platforms:
- "-//images/gcloud-bazel:gcloud-layer"
test_targets:
- "..."
ubuntu2004:
ubuntu1804:
build_targets:
- "--"
- "..."
Expand All @@ -29,6 +29,12 @@ platforms:
test_targets:
- "..."
macos:
shell_commands:
# create a python2 symlink
# see https://github.com/bazelbuild/continuous-integration/issues/854
# TODO(nlopezgi): remove once issue above is fixed
- mkdir /tmp/bin
- ln -s /usr/bin/python2.7 /tmp/bin/python2
build_targets:
- "--"
- "..."
Expand All @@ -38,20 +44,15 @@ platforms:
- "-//images/gcloud-bazel:gcloud-layer"
build_flags:
- "--verbose_failures"
# add the python2 symlink to the PATH
# see https://github.com/bazelbuild/continuous-integration/issues/854
# TODO(nlopezgi): remove once issue above is fixed
- "--action_env=PATH=/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/tmp/bin/"
test_targets:
- "..."
test_flags:
- "--verbose_failures"
min_supported_version:
name: "Minimum Supported Version"
bazel: "2.2.0"
platform: ubuntu1604
build_targets:
- "--"
- "..."
- "-//images/gcloud-bazel:gcloud_push"
- "-//images/gcloud-bazel:gcloud_installer"
- "-//images/gcloud-bazel:gcloud_install"
- "-//images/gcloud-bazel:gcloud-layer"
test_targets:
- "..."
# add the python2 symlink to the PATH
# see https://github.com/bazelbuild/continuous-integration/issues/854
# TODO(nlopezgi): remove once issue above is fixed
- "--action_env=PATH=/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/tmp/bin/"
16 changes: 13 additions & 3 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,19 @@ load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()

# Only needed if using the packaging rules.
load("@rules_python//python:pip.bzl", "pip_install")
load("@rules_python//python:pip.bzl", "pip3_import", "pip_repositories")

pip_install(
pip_repositories()

pip3_import(
name = "py_deps",
requirements = "//:requirements.txt",
)

load("@py_deps//:requirements.bzl", "pip_install")

pip_install()

http_archive(
name = "com_github_grpc_grpc",
sha256 = "f880ebeb2ccf0e47721526c10dd97469200e40b5f101a0d9774eb69efa0bd07a",
Expand All @@ -81,11 +87,15 @@ load("@com_github_grpc_grpc//bazel:grpc_extra_deps.bzl", "grpc_extra_deps")

grpc_extra_deps()

pip_install(
pip3_import(
name = "grpc_python_dependencies",
requirements = "@com_github_grpc_grpc//:requirements.bazel.txt",
)

load("@grpc_python_dependencies//:requirements.bzl", _grpc_pip_install = "pip_install")

_grpc_pip_install()

# upb_deps and apple_rules_dependencies are needed for grpc
load("@upb//bazel:workspace_deps.bzl", "upb_deps")

Expand Down
113 changes: 49 additions & 64 deletions k8s/k8s.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,21 @@
"""Rules for manipulation of K8s constructs."""

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
load("//toolchains/kubectl:kubectl_configure.bzl", "kubectl_configure")
load(":with-defaults.bzl", _k8s_defaults = "k8s_defaults")

k8s_defaults = _k8s_defaults

_com_github_yaml_pyyaml_build_file = """\
load("@rules_python//python:defs.bzl", "py_binary", "py_library")
def k8s_repositories():
"""Download dependencies of k8s rules."""

excludes = native.existing_rules().keys()

if "com_github_yaml_pyyaml" not in excludes:
# Used by utilities for roundtripping yaml.
http_archive(
name = "com_github_yaml_pyyaml",
build_file_content = """
py_library(
name = "yaml",
srcs = glob(["lib/yaml/*.py"]),
Expand All @@ -40,21 +46,11 @@ py_library(
],
visibility = ["//visibility:public"],
)
"""

# buildifier: disable=unnamed-macro
def k8s_repositories():
"""Download dependencies of k8s rules."""

# Used by utilities for roundtripping yaml.
maybe(
http_archive,
name = "com_github_yaml_pyyaml",
build_file_content = _com_github_yaml_pyyaml_build_file,
sha256 = "e9df8412ddabc9c21b4437ee138875b95ebb32c25f07f962439e16005152e00e",
strip_prefix = "pyyaml-5.1.2",
urls = ["https://github.com/yaml/pyyaml/archive/5.1.2.zip"],
)
""",
sha256 = "e9df8412ddabc9c21b4437ee138875b95ebb32c25f07f962439e16005152e00e",
strip_prefix = "pyyaml-5.1.2",
urls = ["https://github.com/yaml/pyyaml/archive/5.1.2.zip"],
)

# Register the default kubectl toolchain targets for supported platforms
# note these work with the autoconfigured toolchain
Expand All @@ -64,49 +60,38 @@ def k8s_repositories():
"@io_bazel_rules_k8s//toolchains/kubectl:kubectl_osx_toolchain",
"@io_bazel_rules_k8s//toolchains/kubectl:kubectl_windows_toolchain",
)

maybe(
http_archive,
name = "io_bazel_rules_go",
sha256 = "52d0a57ea12139d727883c2fef03597970b89f2cc2a05722c42d1d7d41ec065b",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.24.13/rules_go-v0.24.13.tar.gz",
"https://github.com/bazelbuild/rules_go/releases/download/v0.24.13/rules_go-v0.24.13.tar.gz",
],
)

maybe(
http_archive,
name = "bazel_gazelle",
sha256 = "222e49f034ca7a1d1231422cdb67066b885819885c356673cb1f72f748a3c9d4",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.22.3/bazel-gazelle-v0.22.3.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.22.3/bazel-gazelle-v0.22.3.tar.gz",
],
)

maybe(
http_archive,
name = "io_bazel_rules_docker",
sha256 = "f4a39a410da7e497a7ccd19e28c69c93a851d6adb76798355a0c8ba9855e9b75",
strip_prefix = "rules_docker-e15c9ebf203b7fa708e69ff5f1cdcf427d7edf6f",
# `master` as of 2021-02-04
urls = [
"https://github.com/bazelbuild/rules_docker/archive/e15c9ebf203b7fa708e69ff5f1cdcf427d7edf6f.zip",
],
)

maybe(
http_archive,
name = "bazel_skylib",
sha256 = "7ac0fa88c0c4ad6f5b9ffb5e09ef81e235492c873659e6bb99efb89d11246bcb",
strip_prefix = "bazel-skylib-1.0.3",
urls = ["https://github.com/bazelbuild/bazel-skylib/archive/1.0.3.tar.gz"],
)

# WORKSPACE target to configure the kubectl tool
maybe(
kubectl_configure,
name = "k8s_config",
build_srcs = False,
)
if "io_bazel_rules_go" not in excludes:
http_archive(
name = "io_bazel_rules_go",
sha256 = "ac03931e56c3b229c145f1a8b2a2ad3e8d8f1af57e43ef28a26123362a1e3c7e",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.24.4/rules_go-v0.24.4.tar.gz",
"https://github.com/bazelbuild/rules_go/releases/download/v0.24.4/rules_go-v0.24.4.tar.gz",
],
)
if "bazel_gazelle" not in excludes:
http_archive(
name = "bazel_gazelle",
sha256 = "b85f48fa105c4403326e9525ad2b2cc437babaa6e15a3fc0b1dbab0ab064bc7c",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.22.2/bazel-gazelle-v0.22.2.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.22.2/bazel-gazelle-v0.22.2.tar.gz",
],
)
if "io_bazel_rules_docker" not in excludes:
http_archive(
name = "io_bazel_rules_docker",
sha256 = "6287241e033d247e9da5ff705dd6ef526bac39ae82f3d17de1b69f8cb313f9cd",
strip_prefix = "rules_docker-0.14.3",
urls = ["https://github.com/bazelbuild/rules_docker/releases/download/v0.14.3/rules_docker-v0.14.3.tar.gz"],
)
if "bazel_skylib" not in excludes:
http_archive(
name = "bazel_skylib",
sha256 = "7ac0fa88c0c4ad6f5b9ffb5e09ef81e235492c873659e6bb99efb89d11246bcb",
strip_prefix = "bazel-skylib-1.0.3",
urls = ["https://github.com/bazelbuild/bazel-skylib/archive/1.0.3.tar.gz"],
)
if "k8s_config" not in excludes:
# WORKSPACE target to configure the kubectl tool
kubectl_configure(name = "k8s_config", build_srcs = False)
17 changes: 9 additions & 8 deletions k8s/k8s_go_deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"""Macro to load Go package dependencies of Go binaries in this repository."""

load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
load(
"@io_bazel_rules_docker//repositories:go_repositories.bzl",
rules_docker_go_deps = "go_deps",
Expand All @@ -37,10 +36,12 @@ def deps():
rules_docker_repositories()
rules_docker_go_deps()

maybe(
go_repository,
name = "com_github_google_go_cmp",
importpath = "github.com/google/go-cmp",
sum = "h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg=",
version = "v0.3.1",
)
excludes = native.existing_rules().keys()

if "com_github_google_go_cmp" not in excludes:
go_repository(
name = "com_github_google_go_cmp",
importpath = "github.com/google/go-cmp",
sum = "h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg=",
version = "v0.3.1",
)

0 comments on commit 2c63098

Please sign in to comment.