Skip to content

Commit

Permalink
Fix bzl loads (#262)
Browse files Browse the repository at this point in the history
Migrating rules_rust for these incompatible changes:

bazelbuild/bazel#9006
bazelbuild/bazel#8922
bazelbuild/bazel#8743
  • Loading branch information
Marcel Hlopko authored Nov 6, 2019
1 parent 0e631fb commit ec436b5
Show file tree
Hide file tree
Showing 16 changed files with 23 additions and 16 deletions.
2 changes: 2 additions & 0 deletions bindgen/clang.BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
load("@rules_cc//cc:defs.bzl", "cc_library")

package(default_visibility = ["//visibility:public"])

sh_binary(
Expand Down
2 changes: 2 additions & 0 deletions bindgen/raze/libloading.BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ cargo-raze crate build file.
- Libloading has a CC dep that needs to be built.
"""

load("@rules_cc//cc:defs.bzl", "cc_library")

licenses([
"notice", # "ISC"
])
Expand Down
3 changes: 2 additions & 1 deletion examples/ffi/c_calling_rust/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
load("@io_bazel_rules_rust//rust:rust.bzl", "rust_binary", "rust_library", "rust_test")
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
load("@io_bazel_rules_rust//rust:rust.bzl", "rust_library")

rust_library(
name = "rusty",
Expand Down
2 changes: 1 addition & 1 deletion examples/ffi/rust_calling_c/BUILD
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package(default_visibility = ["//ffi/rust_calling_c:__subpackages__"])

load("@io_bazel_rules_rust//rust:rust.bzl", "rust_binary", "rust_doc", "rust_library", "rust_test")
load("@io_bazel_rules_rust//rust:rust.bzl", "rust_doc", "rust_library", "rust_test")

rust_library(
name = "matrix",
Expand Down
2 changes: 2 additions & 0 deletions examples/ffi/rust_calling_c/c/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")

package(default_visibility = ["//ffi/rust_calling_c:__subpackages__"])

cc_library(
Expand Down
3 changes: 2 additions & 1 deletion examples/ffi/rust_calling_c/simple/BUILD
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
load("@io_bazel_rules_rust//rust:rust.bzl", "rust_binary", "rust_doc", "rust_library", "rust_test")
load("@rules_cc//cc:defs.bzl", "cc_library")
load("@io_bazel_rules_rust//rust:rust.bzl", "rust_binary", "rust_test")
load("@io_bazel_rules_rust//bindgen:bindgen.bzl", "rust_bindgen_library")

cc_library(
Expand Down
2 changes: 0 additions & 2 deletions examples/hello_runfiles/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ package(default_visibility = ["//visibility:public"])
load(
"@io_bazel_rules_rust//rust:rust.bzl",
"rust_binary",
"rust_library",
"rust_test",
)

rust_binary(
Expand Down
1 change: 0 additions & 1 deletion examples/hello_world/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ load(
"@io_bazel_rules_rust//rust:rust.bzl",
"rust_binary",
"rust_doc",
"rust_doc_test",
)

rust_binary(
Expand Down
2 changes: 2 additions & 0 deletions examples/proto/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
load("@rules_proto//proto:defs.bzl", "proto_library")

package(default_visibility = ["//proto:__subpackages__"])

proto_library(
Expand Down
1 change: 1 addition & 0 deletions examples/proto/helloworld/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
load("@rules_proto//proto:defs.bzl", "proto_library")
load("@io_bazel_rules_rust//proto:proto.bzl", "rust_grpc_library")
load("@io_bazel_rules_rust//rust:rust.bzl", "rust_test")

Expand Down
2 changes: 2 additions & 0 deletions proto/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
load("@rules_python//python:defs.bzl", "py_binary")

package(default_visibility = ["//visibility:public"])

load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
Expand Down
2 changes: 2 additions & 0 deletions proto/proto.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

load("@rules_proto//proto:defs.bzl", "ProtoInfo")

"""Rust Protobuf Rules
These build rules are used for building [protobufs][protobuf]/[gRPC][grpc] in [Rust][rust] with Bazel.
Expand Down
6 changes: 0 additions & 6 deletions test/BUILD
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
load(
"//rust:rust.bzl",
"rust_binary",
"rust_library",
"rust_test",
)
load(
"@bazel_tools//tools/build_rules:test_rules.bzl",
"rule_test",
Expand Down
1 change: 1 addition & 0 deletions test/proto/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
load("@rules_proto//proto:defs.bzl", "proto_library")
load("@io_bazel_rules_rust//proto:proto.bzl", "rust_proto_library")

proto_library(
Expand Down
2 changes: 2 additions & 0 deletions wasm_bindgen/raze/overrides/backtrace-sys-0.1.29.BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
load("@rules_cc//cc:defs.bzl", "cc_library")

package(default_visibility = ["//ext/public/rust/cargo:__subpackages__"])

licenses([
Expand Down
6 changes: 2 additions & 4 deletions wasm_bindgen/wasm_bindgen.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.

load("@io_bazel_rules_rust//rust:rust.bzl", "rust_library")
load("@io_bazel_rules_rust//rust:private/legacy_cc_starlark_api_shim.bzl", "get_libs_for_static_executable")
load("@io_bazel_rules_rust//rust:private/transitions.bzl", "wasm_bindgen_transition")

def _rust_wasm_bindgen_impl(ctx):
Expand Down Expand Up @@ -59,8 +57,8 @@ def _rust_wasm_bindgen_impl(ctx):
type_blacklisted_declarations = depset(),
es5_sources = depset([ctx.outputs.javascript_bindings]),
es6_sources = depset([ctx.outputs.javascript_bindings]),
transitive_es5_sources = depset(depset([ctx.outputs.javascript_bindings])),
transitive_es6_sources = depset(depset([ctx.outputs.javascript_bindings])),
transitive_es5_sources = depset(depset([ctx.outputs.javascript_bindings]).to_list()),
transitive_es6_sources = depset(depset([ctx.outputs.javascript_bindings]).to_list()),
),
)

Expand Down

0 comments on commit ec436b5

Please sign in to comment.