-
Notifications
You must be signed in to change notification settings - Fork 445
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
939 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Ignore everything but the `BUILD` files within the vendored directories | ||
vendor/*/* | ||
!vendor/*/BUILD.bazel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
load("@rules_rust//crate_universe:defs.bzl", "crate", "crates_vendor") | ||
load("@rules_rust//rust:defs.bzl", "rust_binary", "rust_test") | ||
|
||
crates_vendor( | ||
name = "vendor", | ||
cargo_lockfile = ":Cargo.lock", | ||
manifests = [":Cargo.toml"], | ||
mode = "local", | ||
# We don't support wasi | ||
supported_platform_triples = [ | ||
"x86_64-unknown-linux-gnu", | ||
"aarch64-unknown-linux-gnu", | ||
"x86_64-apple-darwin", | ||
"x86_64-pc-windows-msvc", | ||
"x86_64-fuchsia", | ||
"aarch64-fuchsia", | ||
], | ||
vendor_path = "vendor", | ||
) | ||
|
||
rust_binary( | ||
name = "bin", | ||
srcs = ["src/main.rs"], | ||
deps = ["//vendor_local_patching/vendor:rand"], | ||
edition = "2021", | ||
) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[package] | ||
name = "my_third_party" | ||
version = "0.1.0" | ||
|
||
[dependencies] | ||
rand = "0.8.5" | ||
|
||
[patch.crates-io] | ||
wasi = { path = "empty_wasi" } |
7 changes: 7 additions & 0 deletions
7
examples/crate_universe/vendor_local_patching/empty_wasi/BUILD.bazel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
filegroup( | ||
name = "wasi", | ||
srcs = glob(["**/*.rs"]), | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
exports_files(["src/lib.rs"]) |
3 changes: 3 additions & 0 deletions
3
examples/crate_universe/vendor_local_patching/empty_wasi/Cargo.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[package] | ||
name = "wasi" | ||
version = "0.11.0+wasi-snapshot-preview1" |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
fn main() { | ||
println!("random number: {}", rand::random::<f32>()); | ||
} |
31 changes: 31 additions & 0 deletions
31
examples/crate_universe/vendor_local_patching/vendor/BUILD.bazel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
############################################################################### | ||
# @generated | ||
# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To | ||
# regenerate this file, run the following: | ||
# | ||
# bazel run @//vendor_local_patching:vendor | ||
############################################################################### | ||
|
||
package(default_visibility = ["//visibility:public"]) | ||
|
||
exports_files( | ||
[ | ||
"cargo-bazel.json", | ||
"defs.bzl", | ||
] + glob(["*.bazel"]), | ||
) | ||
|
||
filegroup( | ||
name = "srcs", | ||
srcs = glob([ | ||
"*.bazel", | ||
"*.bzl", | ||
]), | ||
) | ||
|
||
# Workspace Member Dependencies | ||
alias( | ||
name = "rand", | ||
actual = "//vendor_local_patching/vendor/rand-0.8.5:rand", | ||
tags = ["manual"], | ||
) |
41 changes: 41 additions & 0 deletions
41
examples/crate_universe/vendor_local_patching/vendor/cfg-if-1.0.0/BUILD.bazel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
############################################################################### | ||
# @generated | ||
# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To | ||
# regenerate this file, run the following: | ||
# | ||
# bazel run @//vendor_local_patching:vendor | ||
############################################################################### | ||
|
||
load("@rules_rust//rust:defs.bzl", "rust_library") | ||
|
||
package(default_visibility = ["//visibility:public"]) | ||
|
||
# licenses([ | ||
# "TODO", # MIT/Apache-2.0 | ||
# ]) | ||
|
||
rust_library( | ||
name = "cfg_if", | ||
srcs = glob(["**/*.rs"]), | ||
compile_data = glob( | ||
include = ["**"], | ||
exclude = [ | ||
"**/* *", | ||
"BUILD", | ||
"BUILD.bazel", | ||
"WORKSPACE", | ||
"WORKSPACE.bazel", | ||
], | ||
), | ||
crate_root = "src/lib.rs", | ||
edition = "2018", | ||
rustc_flags = ["--cap-lints=allow"], | ||
tags = [ | ||
"cargo-bazel", | ||
"crate-name=cfg-if", | ||
"manual", | ||
"noclippy", | ||
"norustfmt", | ||
], | ||
version = "1.0.0", | ||
) |
Oops, something went wrong.