Skip to content

Commit

Permalink
Cleanup WORKSPACE. (#61)
Browse files Browse the repository at this point in the history
Signed-off-by: Piotr Sikora <[email protected]>
  • Loading branch information
PiotrSikora authored Dec 5, 2020
1 parent 42572fb commit 802cab2
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
~/.cargo/.crates2.json
~/.cargo/bin
~/.cargo/registry
key: ${{ hashFiles('WORKSPACE', '.bazelrc', '.bazelversion', 'bazel/cargo/Cargo.lock') }}
key: ${{ hashFiles('WORKSPACE', '.bazelrc', '.bazelversion', 'bazel/cargo/Cargo.lock', 'bazel/dependencies.bzl', 'bazel/repositories.bzl') }}

- name: Build (wasm32-unknown-unknown)
run: bazelisk --bazelrc=/dev/null build --platforms=@io_bazel_rules_rust//rust/platform:wasm //...
Expand Down
21 changes: 4 additions & 17 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,22 +1,9 @@
workspace(name = "proxy_wasm_rust_sdk")

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@proxy_wasm_rust_sdk//bazel:repositories.bzl", "proxy_wasm_rust_sdk_repositories")

http_archive(
name = "io_bazel_rules_rust",
sha256 = "17dbf791f4dab0fd4496ce5345af35e9ce2f6d011c1c8423436da517d019a3ea",
strip_prefix = "rules_rust-2f97db595b05b1ee8cc44bde5bdf03c00bd169fb",
url = "https://github.com/bazelbuild/rules_rust/archive/2f97db595b05b1ee8cc44bde5bdf03c00bd169fb.tar.gz",
)
proxy_wasm_rust_sdk_repositories()

load("@io_bazel_rules_rust//rust:repositories.bzl", "rust_repositories")
load("@proxy_wasm_rust_sdk//bazel:dependencies.bzl", "proxy_wasm_rust_sdk_dependencies")

rust_repositories()

load("@io_bazel_rules_rust//:workspace.bzl", "rust_workspace")

rust_workspace()

load("//bazel/cargo:crates.bzl", "raze_fetch_remote_crates")

raze_fetch_remote_crates()
proxy_wasm_rust_sdk_dependencies()
Empty file added bazel/BUILD
Empty file.
20 changes: 20 additions & 0 deletions bazel/dependencies.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

load("@io_bazel_rules_rust//rust:repositories.bzl", "rust_repositories")
load("@proxy_wasm_rust_sdk//bazel/cargo:crates.bzl", "raze_fetch_remote_crates")

def proxy_wasm_rust_sdk_dependencies():
rust_repositories()
raze_fetch_remote_crates()
23 changes: 23 additions & 0 deletions bazel/repositories.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

def proxy_wasm_rust_sdk_repositories():
http_archive(
name = "io_bazel_rules_rust",
sha256 = "5cb2fbcc3debebc7b68f5f66c1b7ef741bdcca87c70594de688d4518538c36c8",
strip_prefix = "rules_rust-aa7c6938cf1cc2973bc065c7532f89874bf09818",
url = "https://github.com/bazelbuild/rules_rust/archive/aa7c6938cf1cc2973bc065c7532f89874bf09818.tar.gz",
)

0 comments on commit 802cab2

Please sign in to comment.