Skip to content

Commit

Permalink
Upgrade Bazel -> 5.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
sgammon committed Oct 15, 2022
1 parent ec3f195 commit 2adcc1e
Show file tree
Hide file tree
Showing 8 changed files with 149 additions and 112 deletions.
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.2.0
5.3.1
33 changes: 26 additions & 7 deletions .github/workflows/buf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,12 @@ jobs:
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # renovate: tag=v2

# 2: Setup Buf.
- uses: bufbuild/buf-setup-action@v0.3.1
- uses: bufbuild/buf-setup-action@v1.8.0
with:
version: '0.54.1'
github_token: ${{ github.token }}

# 3: Run linter.
- uses: bufbuild/[email protected]
with:
github_token: ${{ github.token }}

proto-breaking:
runs-on: ubuntu-latest
Expand All @@ -28,16 +26,37 @@ jobs:
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # renovate: tag=v2

# 2: Setup Buf.
- uses: bufbuild/buf-setup-action@v0.3.1
- uses: bufbuild/buf-setup-action@v1.8.0
with:
version: '0.54.1'
github_token: ${{ github.token }}

# 3: Run break detector.
- uses: bufbuild/[email protected]
env:
BUF_INPUT_HTTPS_USERNAME: ${{ github.actor }}
BUF_INPUT_HTTPS_PASSWORD: ${{ github.token }}
with:
against: 'https://github.com/CookiesCo/OpenCannabis.git#branch=dev'
against: 'https://github.com/OpenCannabis/Specification.git#branch=dev'
buf_token: ${{ secrets.BUF_TOKEN }}
buf_input_https_username: ${{ github.actor }}
buf_input_https_password: ${{ github.token }}

proto-push:
runs-on: ubuntu-latest
name: "Buf: Push"
needs: [proto-lint, proto-breaking]
steps:
# 1: Pull code.
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # renovate: tag=v2

# 2: Setup Buf.
- uses: bufbuild/[email protected]
with:
github_token: ${{ github.token }}

# 3: Push to BSR.
- name: 'Model: Push to BSR'
uses: bufbuild/buf-push-action@v1
with:
buf_token: ${{ secrets.BUF_TOKEN }}

49 changes: 33 additions & 16 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,22 @@ http_archive(
urls = ["https://github.com/grpc/grpc/archive/v%s.zip" % GRPC_VERSION],
)

http_archive(
name = "com_github_grpc_grpc_web",
strip_prefix = "grpc-web-b0ea9c7c45d6f9ea5338fc61a81b47f589a91259",
sha256 = "a7ae33e32b95049f11373b62019b742464576a17c602fa6b2457926749d58a1c",
urls = ["https://github.com/grpc/grpc-web/archive/b0ea9c7c45d6f9ea5338fc61a81b47f589a91259.tar.gz"],
)

http_archive(
name = "io_bazel_rules_go",
sha256 = "099a9fb96a376ccbbb7d291ed4ecbdfd42f6bc822ab77ae6f1b5cb9e914e94fa",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.35.0/rules_go-v0.35.0.zip",
"https://github.com/bazelbuild/rules_go/releases/download/v0.35.0/rules_go-v0.35.0.zip",
],
)

http_archive(
name = "io_grpc_proto",
sha256 = "f081eba5884bf09051d27664aede4fc22bbaa77da477735d745bcef17bd088f1",
Expand Down Expand Up @@ -94,7 +110,6 @@ buildbuddy_deps()
load("@io_buildbuddy_buildbuddy_toolchain//:rules.bzl", "buildbuddy")
buildbuddy(name = "buildbuddy_toolchain")


load("@gust//defs:build.bzl", "install_dependencies")
load("@//config:build.bzl", app_dependencies = "install_dependencies")
load("@gust//defs:config.bzl", "CHROMIUM", "FIREFOX", "SAUCE", "GRAALVM_VERSION", "GRAALVM_JDK_VERSION", "K8S_VERSION")
Expand All @@ -117,7 +132,7 @@ switched_rules_by_language(
java = True,
nodejs = False,
php = False,
python = True,
python = False,
ruby = False,
)

Expand Down Expand Up @@ -149,6 +164,15 @@ rules_proto_dependencies()

rules_proto_toolchains()

#
# Go
#
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")

go_rules_dependencies()
go_register_toolchains(version = "1.19.1")
gazelle_dependencies()

#
# Extensions
Expand All @@ -168,8 +192,8 @@ http_archive(
## NodeJS
http_archive(
name = "build_bazel_rules_nodejs",
sha256 = "8a7c981217239085f78acc9898a1f7ba99af887c1996ceb3b4504655383a2c3c",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/4.0.0/rules_nodejs-4.0.0.tar.gz"],
sha256 = "c911b5bd8aee8b0498cc387cacdb5f917098ce477fb4182db07b0ef8a9e045c0",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/4.7.1/rules_nodejs-4.7.1.tar.gz"],
)

load(
Expand Down Expand Up @@ -386,14 +410,6 @@ stardoc_repositories()
load("@build_stack_rules_proto//swift:deps.bzl", "swift_proto_library")
swift_proto_library()

## Go
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")

go_rules_dependencies()
go_register_toolchains()
gazelle_dependencies()

## Protoc-Gen-Doc
load("@protoc_gen_doc//defs:deps.bzl", protoc_gen_doc_dependencies="go_dependencies")
protoc_gen_doc_dependencies()
Expand Down Expand Up @@ -426,15 +442,16 @@ npm_bazel_labs_dependencies()
## JarJar
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")

git_repository(
http_archive(
name = "com_github_johnynek_bazel_jar_jar",
shallow_since = "1594234634 -1000",
commit = "171f268569384c57c19474b04aebe574d85fde0d",
remote = "git://github.com/johnynek/bazel_jar_jar.git",
sha256 = "97c5f862482a05f385bd8f9d28a9bbf684b0cf3fae93112ee96f3fb04d34b193",
strip_prefix = "bazel_jar_jar-171f268569384c57c19474b04aebe574d85fde0d",
urls = ["https://github.com/OpenCannabis/bazel_jar_jar/archive/171f268569384c57c19474b04aebe574d85fde0d.tar.gz"],
)

load(
"@com_github_johnynek_bazel_jar_jar//:jar_jar.bzl",
"jar_jar_repositories",
)
jar_jar_repositories()

5 changes: 3 additions & 2 deletions config/versions.bzl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

PROTOBUF_VERSION = "3.15.3"
GRPC_VERSION = "1.38.1"
NODE_VERSION = "14.15.0"
YARN_VERSION = "1.22.4"
NODE_VERSION = "17.4.0"
YARN_VERSION = "1.22.17"

49 changes: 25 additions & 24 deletions opencannabis/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -80,28 +80,29 @@ pkg_tar(
srcs = ["//opencannabis/%s:%s-doc" % (n, n) for n in MODULES if n not in DOC_SKIP],
)

buf_image(
name = "image_bin",
out = "OpenCannabis.buf.bin",
config = "//:buf.yaml",
protos = [
":OpenCannabis",
],
)

buf_image(
name = "image_json",
out = "OpenCannabis.buf.json",
config = "//:buf.yaml",
protos = [
":OpenCannabis",
],
extra_args = [
"--log-level=debug",
],
)
#buf_image(
# name = "image_bin",
# out = "OpenCannabis.buf.bin",
# config = "//:buf.yaml",
# protos = [
# ":OpenCannabis",
# ],
#)

#buf_image(
# name = "image_json",
# out = "OpenCannabis.buf.json",
# config = "//:buf.yaml",
# protos = [
# ":OpenCannabis",
# ],
# extra_args = [
# "--log-level=debug",
# ],
#)

#alias(
# name = "image",
# actual = ":image_bin",
#)

alias(
name = "image",
actual = ":image_bin",
)
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
},
"devDependencies": {
"@bazel/bazelisk": "1.10.1",
"@bazel/jasmine": "4.0.0",
"@bazel/labs": "4.0.0",
"@bazel/rollup": "4.0.0",
"@bazel/jasmine": "4.6.2",
"@bazel/labs": "4.6.2",
"@bazel/rollup": "4.6.2",
"@bazel/source-map-support": "latest",
"@bazel/terser": "4.0.0",
"@bazel/typescript": "4.0.0",
"@bazel/worker": "4.0.0",
"@bazel/terser": "4.6.2",
"@bazel/typescript": "4.6.2",
"@bazel/worker": "4.6.2",
"jasmine": "3.9.0",
"jasmine-core": "3.9.0",
"rollup": "2.56.3",
Expand Down
4 changes: 1 addition & 3 deletions tools/bazel.rc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
# Base Settings
##

run --incompatible_restrict_string_escapes=false
run --incompatible_strict_action_env
run --workspace_status_command=./tools/bazel_stamp_vars.sh

Expand All @@ -19,9 +18,9 @@ build --java_toolchain=@bazel_tools//tools/jdk:toolchain_java11
build --host_java_toolchain=@bazel_tools//tools/jdk:toolchain_java11
build --protocopt=--experimental_allow_proto3_optional

build --incompatible_java_common_parameters=false
build --strategy=sandboxed
build --enable_platform_specific_config
build --incompatible_restrict_string_escapes=false
build --watchfs
build --symlink_prefix=dist/
build --nolegacy_external_runfiles
Expand Down Expand Up @@ -63,7 +62,6 @@ build --ios_simulator_version=14.2
build --ios_simulator_device="iPhone 12 Pro"
build --apple_generate_dsym=true
build --apple_bitcode=embedded
build --enable_apple_binary_native_protos=true

##
# Development
Expand Down
Loading

0 comments on commit 2adcc1e

Please sign in to comment.