Skip to content

Commit

Permalink
Move Bazel to //bazel. (#29)
Browse files Browse the repository at this point in the history
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
  • Loading branch information
PiotrSikora authored Aug 15, 2020
1 parent b2ad59c commit f352a8d
Show file tree
Hide file tree
Showing 24 changed files with 48 additions and 48 deletions.
16 changes: 8 additions & 8 deletions .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', 'cargo/Cargo.lock') }}
key: ${{ hashFiles('WORKSPACE', '.bazelrc', '.bazelversion', 'bazel/cargo/Cargo.lock') }}

- name: Build
run: bazelisk build //...
Expand All @@ -73,10 +73,10 @@ jobs:
- name: Format (cargo raze)
run: |
cargo install cargo-raze --version 0.3.8
cp -p cargo/Cargo.lock .
rm -rf cargo/
cargo raze --output=cargo
mv Cargo.lock cargo/
cp -p bazel/cargo/Cargo.lock .
rm -rf bazel/cargo/
cargo raze --output=bazel/cargo
mv Cargo.lock bazel/cargo/
git diff --exit-code
stable:
Expand Down Expand Up @@ -155,10 +155,10 @@ jobs:
- name: Run cargo outdated
run: cargo outdated --exit-code 1

- name: Check freshness of cargo/Cargo.lock
- name: Check freshness of bazel/cargo/Cargo.lock
run: |
cargo generate-lockfile
mv Cargo.lock cargo/
mv Cargo.lock bazel/cargo/
git diff --exit-code
audit:
Expand All @@ -169,5 +169,5 @@ jobs:

- name: Run cargo audit
run: |
cp -p cargo/Cargo.lock .
cp -p bazel/cargo/Cargo.lock .
cargo audit
6 changes: 3 additions & 3 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ rust_library(
edition = "2018",
visibility = ["//visibility:public"],
deps = [
"//cargo:hashbrown",
"//cargo:log",
"//cargo:wee_alloc",
"//bazel/cargo:hashbrown",
"//bazel/cargo:log",
"//bazel/cargo:wee_alloc",
],
)
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ opt-level = 3
panic = "abort"

[raze]
workspace_path = "//cargo"
workspace_path = "//bazel/cargo"
target = "wasm32-unknown-unknown"
genmode = "Remote"

Expand Down
2 changes: 1 addition & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ load("@io_bazel_rules_rust//:workspace.bzl", "bazel_version")

bazel_version(name = "bazel_version")

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

raze_fetch_remote_crates()
File renamed without changes.
File renamed without changes.
30 changes: 15 additions & 15 deletions cargo/crates.bzl → bazel/cargo/crates.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def raze_fetch_remote_crates():
type = "tar.gz",
sha256 = "e8fd72866655d1904d6b0997d0b07ba561047d070fbe29de039031c641b61217",
strip_prefix = "ahash-0.3.8",
build_file = Label("//cargo/remote:ahash-0.3.8.BUILD"),
build_file = Label("//bazel/cargo/remote:ahash-0.3.8.BUILD"),
)

_new_http_archive(
Expand All @@ -31,7 +31,7 @@ def raze_fetch_remote_crates():
type = "tar.gz",
sha256 = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d",
strip_prefix = "autocfg-1.0.0",
build_file = Label("//cargo/remote:autocfg-1.0.0.BUILD"),
build_file = Label("//bazel/cargo/remote:autocfg-1.0.0.BUILD"),
)

_new_http_archive(
Expand All @@ -40,7 +40,7 @@ def raze_fetch_remote_crates():
type = "tar.gz",
sha256 = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822",
strip_prefix = "cfg-if-0.1.10",
build_file = Label("//cargo/remote:cfg-if-0.1.10.BUILD"),
build_file = Label("//bazel/cargo/remote:cfg-if-0.1.10.BUILD"),
)

_new_http_archive(
Expand All @@ -49,7 +49,7 @@ def raze_fetch_remote_crates():
type = "tar.gz",
sha256 = "942f72db697d8767c22d46a598e01f2d3b475501ea43d0db4f16d90259182d0b",
strip_prefix = "chrono-0.4.15",
build_file = Label("//cargo/remote:chrono-0.4.15.BUILD"),
build_file = Label("//bazel/cargo/remote:chrono-0.4.15.BUILD"),
)

_new_http_archive(
Expand All @@ -58,7 +58,7 @@ def raze_fetch_remote_crates():
type = "tar.gz",
sha256 = "e91b62f79061a0bc2e046024cb7ba44b08419ed238ecbd9adbd787434b9e8c25",
strip_prefix = "hashbrown-0.8.2",
build_file = Label("//cargo/remote:hashbrown-0.8.2.BUILD"),
build_file = Label("//bazel/cargo/remote:hashbrown-0.8.2.BUILD"),
)

_new_http_archive(
Expand All @@ -67,7 +67,7 @@ def raze_fetch_remote_crates():
type = "tar.gz",
sha256 = "a2f02823cf78b754822df5f7f268fb59822e7296276d3e069d8e8cb26a14bd10",
strip_prefix = "libc-0.2.74",
build_file = Label("//cargo/remote:libc-0.2.74.BUILD"),
build_file = Label("//bazel/cargo/remote:libc-0.2.74.BUILD"),
)

_new_http_archive(
Expand All @@ -76,7 +76,7 @@ def raze_fetch_remote_crates():
type = "tar.gz",
sha256 = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b",
strip_prefix = "log-0.4.11",
build_file = Label("//cargo/remote:log-0.4.11.BUILD"),
build_file = Label("//bazel/cargo/remote:log-0.4.11.BUILD"),
)

_new_http_archive(
Expand All @@ -85,7 +85,7 @@ def raze_fetch_remote_crates():
type = "tar.gz",
sha256 = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3",
strip_prefix = "memory_units-0.4.0",
build_file = Label("//cargo/remote:memory_units-0.4.0.BUILD"),
build_file = Label("//bazel/cargo/remote:memory_units-0.4.0.BUILD"),
)

_new_http_archive(
Expand All @@ -94,7 +94,7 @@ def raze_fetch_remote_crates():
type = "tar.gz",
sha256 = "8d59457e662d541ba17869cf51cf177c0b5f0cbf476c66bdc90bf1edac4f875b",
strip_prefix = "num-integer-0.1.43",
build_file = Label("//cargo/remote:num-integer-0.1.43.BUILD"),
build_file = Label("//bazel/cargo/remote:num-integer-0.1.43.BUILD"),
)

_new_http_archive(
Expand All @@ -103,7 +103,7 @@ def raze_fetch_remote_crates():
type = "tar.gz",
sha256 = "ac267bcc07f48ee5f8935ab0d24f316fb722d7a1292e2913f0cc196b29ffd611",
strip_prefix = "num-traits-0.2.12",
build_file = Label("//cargo/remote:num-traits-0.2.12.BUILD"),
build_file = Label("//bazel/cargo/remote:num-traits-0.2.12.BUILD"),
)

_new_http_archive(
Expand All @@ -112,7 +112,7 @@ def raze_fetch_remote_crates():
type = "tar.gz",
sha256 = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438",
strip_prefix = "time-0.1.43",
build_file = Label("//cargo/remote:time-0.1.43.BUILD"),
build_file = Label("//bazel/cargo/remote:time-0.1.43.BUILD"),
)

_new_http_archive(
Expand All @@ -121,7 +121,7 @@ def raze_fetch_remote_crates():
type = "tar.gz",
sha256 = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e",
strip_prefix = "wee_alloc-0.4.5",
build_file = Label("//cargo/remote:wee_alloc-0.4.5.BUILD"),
build_file = Label("//bazel/cargo/remote:wee_alloc-0.4.5.BUILD"),
)

_new_http_archive(
Expand All @@ -130,7 +130,7 @@ def raze_fetch_remote_crates():
type = "tar.gz",
sha256 = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419",
strip_prefix = "winapi-0.3.9",
build_file = Label("//cargo/remote:winapi-0.3.9.BUILD"),
build_file = Label("//bazel/cargo/remote:winapi-0.3.9.BUILD"),
)

_new_http_archive(
Expand All @@ -139,7 +139,7 @@ def raze_fetch_remote_crates():
type = "tar.gz",
sha256 = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6",
strip_prefix = "winapi-i686-pc-windows-gnu-0.4.0",
build_file = Label("//cargo/remote:winapi-i686-pc-windows-gnu-0.4.0.BUILD"),
build_file = Label("//bazel/cargo/remote:winapi-i686-pc-windows-gnu-0.4.0.BUILD"),
)

_new_http_archive(
Expand All @@ -148,6 +148,6 @@ def raze_fetch_remote_crates():
type = "tar.gz",
sha256 = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f",
strip_prefix = "winapi-x86_64-pc-windows-gnu-0.4.0",
build_file = Label("//cargo/remote:winapi-x86_64-pc-windows-gnu-0.4.0.BUILD"),
build_file = Label("//bazel/cargo/remote:winapi-x86_64-pc-windows-gnu-0.4.0.BUILD"),
)

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ DO NOT EDIT! Replaced on runs of cargo-raze
package(default_visibility = [
# Public for visibility by "@raze__crate__version//" targets.
#
# Prefer access through "//cargo", which limits external
# Prefer access through "//bazel/cargo", which limits external
# visibility to explicit Cargo.toml dependencies.
"//visibility:public",
])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ DO NOT EDIT! Replaced on runs of cargo-raze
package(default_visibility = [
# Public for visibility by "@raze__crate__version//" targets.
#
# Prefer access through "//cargo", which limits external
# Prefer access through "//bazel/cargo", which limits external
# visibility to explicit Cargo.toml dependencies.
"//visibility:public",
])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ DO NOT EDIT! Replaced on runs of cargo-raze
package(default_visibility = [
# Public for visibility by "@raze__crate__version//" targets.
#
# Prefer access through "//cargo", which limits external
# Prefer access through "//bazel/cargo", which limits external
# visibility to explicit Cargo.toml dependencies.
"//visibility:public",
])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ DO NOT EDIT! Replaced on runs of cargo-raze
package(default_visibility = [
# Public for visibility by "@raze__crate__version//" targets.
#
# Prefer access through "//cargo", which limits external
# Prefer access through "//bazel/cargo", which limits external
# visibility to explicit Cargo.toml dependencies.
"//visibility:public",
])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ DO NOT EDIT! Replaced on runs of cargo-raze
package(default_visibility = [
# Public for visibility by "@raze__crate__version//" targets.
#
# Prefer access through "//cargo", which limits external
# Prefer access through "//bazel/cargo", which limits external
# visibility to explicit Cargo.toml dependencies.
"//visibility:public",
])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ DO NOT EDIT! Replaced on runs of cargo-raze
package(default_visibility = [
# Public for visibility by "@raze__crate__version//" targets.
#
# Prefer access through "//cargo", which limits external
# Prefer access through "//bazel/cargo", which limits external
# visibility to explicit Cargo.toml dependencies.
"//visibility:public",
])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ DO NOT EDIT! Replaced on runs of cargo-raze
package(default_visibility = [
# Public for visibility by "@raze__crate__version//" targets.
#
# Prefer access through "//cargo", which limits external
# Prefer access through "//bazel/cargo", which limits external
# visibility to explicit Cargo.toml dependencies.
"//visibility:public",
])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ DO NOT EDIT! Replaced on runs of cargo-raze
package(default_visibility = [
# Public for visibility by "@raze__crate__version//" targets.
#
# Prefer access through "//cargo", which limits external
# Prefer access through "//bazel/cargo", which limits external
# visibility to explicit Cargo.toml dependencies.
"//visibility:public",
])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ DO NOT EDIT! Replaced on runs of cargo-raze
package(default_visibility = [
# Public for visibility by "@raze__crate__version//" targets.
#
# Prefer access through "//cargo", which limits external
# Prefer access through "//bazel/cargo", which limits external
# visibility to explicit Cargo.toml dependencies.
"//visibility:public",
])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ DO NOT EDIT! Replaced on runs of cargo-raze
package(default_visibility = [
# Public for visibility by "@raze__crate__version//" targets.
#
# Prefer access through "//cargo", which limits external
# Prefer access through "//bazel/cargo", which limits external
# visibility to explicit Cargo.toml dependencies.
"//visibility:public",
])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ DO NOT EDIT! Replaced on runs of cargo-raze
package(default_visibility = [
# Public for visibility by "@raze__crate__version//" targets.
#
# Prefer access through "//cargo", which limits external
# Prefer access through "//bazel/cargo", which limits external
# visibility to explicit Cargo.toml dependencies.
"//visibility:public",
])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ DO NOT EDIT! Replaced on runs of cargo-raze
package(default_visibility = [
# Public for visibility by "@raze__crate__version//" targets.
#
# Prefer access through "//cargo", which limits external
# Prefer access through "//bazel/cargo", which limits external
# visibility to explicit Cargo.toml dependencies.
"//visibility:public",
])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ DO NOT EDIT! Replaced on runs of cargo-raze
package(default_visibility = [
# Public for visibility by "@raze__crate__version//" targets.
#
# Prefer access through "//cargo", which limits external
# Prefer access through "//bazel/cargo", which limits external
# visibility to explicit Cargo.toml dependencies.
"//visibility:public",
])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ DO NOT EDIT! Replaced on runs of cargo-raze
package(default_visibility = [
# Public for visibility by "@raze__crate__version//" targets.
#
# Prefer access through "//cargo", which limits external
# Prefer access through "//bazel/cargo", which limits external
# visibility to explicit Cargo.toml dependencies.
"//visibility:public",
])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ DO NOT EDIT! Replaced on runs of cargo-raze
package(default_visibility = [
# Public for visibility by "@raze__crate__version//" targets.
#
# Prefer access through "//cargo", which limits external
# Prefer access through "//bazel/cargo", which limits external
# visibility to explicit Cargo.toml dependencies.
"//visibility:public",
])
Expand Down
10 changes: 5 additions & 5 deletions examples/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ rust_binary(
out_binary = True,
deps = [
"//:proxy_wasm",
"//cargo:chrono",
"//cargo:log",
"//bazel/cargo:chrono",
"//bazel/cargo:log",
],
)

Expand All @@ -21,7 +21,7 @@ rust_binary(
out_binary = True,
deps = [
"//:proxy_wasm",
"//cargo:log",
"//bazel/cargo:log",
],
)

Expand All @@ -33,7 +33,7 @@ rust_binary(
out_binary = True,
deps = [
"//:proxy_wasm",
"//cargo:log",
"//bazel/cargo:log",
],
)

Expand All @@ -45,6 +45,6 @@ rust_binary(
out_binary = True,
deps = [
"//:proxy_wasm",
"//cargo:log",
"//bazel/cargo:log",
],
)

0 comments on commit f352a8d

Please sign in to comment.