-
Notifications
You must be signed in to change notification settings - Fork 440
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move examples into their own workspaces
This is more clear, as they don't need to round-trip via two .bzl files, so the examples are self-contained. However, we'll need to work out how to make them build on CI.
- Loading branch information
1 parent
3a00856
commit 299f4e9
Showing
14 changed files
with
178 additions
and
110 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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
docs | ||
examples | ||
examples/crate_universe | ||
examples/cargo_manifest_dir/external_crate |
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
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
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
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,32 @@ | ||
local_repository( | ||
name = "rules_rust", | ||
path = "../../..", | ||
) | ||
|
||
load("@rules_rust//rust:repositories.bzl", "rust_repositories") | ||
|
||
rust_repositories() | ||
|
||
load("@rules_rust//cargo:repositories.bzl", "crate_universe_deps") | ||
|
||
crate_universe_deps() | ||
|
||
load("@rules_rust//cargo:workspace.bzl", "crate", "crate_universe") | ||
|
||
crate_universe( | ||
name = "rust_deps", | ||
packages = [ | ||
crate.spec( | ||
name = "lazy_static", | ||
semver = "=1.4", | ||
), | ||
], | ||
supported_targets = [ | ||
"x86_64-apple-darwin", | ||
"x86_64-unknown-linux-gnu", | ||
], | ||
) | ||
|
||
load("@rust_deps//:defs.bzl", "pinned_rust_install") | ||
|
||
pinned_rust_install() |
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
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,55 @@ | ||
local_repository( | ||
name = "rules_rust", | ||
path = "../../..", | ||
) | ||
|
||
local_repository( | ||
name = "examples", | ||
path = "../../../examples", | ||
) | ||
|
||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | ||
|
||
http_archive( | ||
name = "openssl", | ||
strip_prefix = "openssl-OpenSSL_1_1_1d", | ||
urls = ["https://github.com/openssl/openssl/archive/OpenSSL_1_1_1d.tar.gz"], | ||
sha256 = "23011a5cc78e53d0dc98dfa608c51e72bcd350aa57df74c5d5574ba4ffb62e74", | ||
build_file = "@examples//third_party/openssl:BUILD.openssl.bazel", | ||
) | ||
|
||
load("@rules_rust//rust:repositories.bzl", "rust_repositories") | ||
|
||
rust_repositories() | ||
|
||
load("@rules_rust//cargo:repositories.bzl", "crate_universe_deps") | ||
|
||
crate_universe_deps() | ||
|
||
load("@rules_rust//cargo:workspace.bzl", "crate", "crate_universe") | ||
|
||
crate_universe( | ||
name = "rust_deps", | ||
cargo_toml_files = ["//:Cargo.toml"], | ||
overrides = { | ||
"openssl-sys": crate.override( | ||
extra_build_script_env_vars = { | ||
"OPENSSL_DIR": "../openssl/openssl", | ||
}, | ||
extra_bazel_deps = { | ||
"cfg(all())": ["@openssl//:openssl"], | ||
}, | ||
extra_build_script_bazel_data_deps = { | ||
"cfg(all())": ["@openssl//:openssl"], | ||
}, | ||
), | ||
}, | ||
supported_targets = [ | ||
"x86_64-apple-darwin", | ||
"x86_64-unknown-linux-gnu", | ||
], | ||
) | ||
|
||
load("@rust_deps//:defs.bzl", "pinned_rust_install") | ||
|
||
pinned_rust_install() |
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
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,27 @@ | ||
local_repository( | ||
name = "rules_rust", | ||
path = "../../..", | ||
) | ||
|
||
load("@rules_rust//rust:repositories.bzl", "rust_repositories") | ||
|
||
rust_repositories() | ||
|
||
load("@rules_rust//cargo:repositories.bzl", "crate_universe_deps") | ||
|
||
crate_universe_deps() | ||
|
||
load("@rules_rust//cargo:workspace.bzl", "crate", "crate_universe") | ||
|
||
crate_universe( | ||
name = "rust_deps", | ||
cargo_toml_files = ["//:Cargo.toml"], | ||
supported_targets = [ | ||
"x86_64-apple-darwin", | ||
"x86_64-unknown-linux-gnu", | ||
], | ||
) | ||
|
||
load("@rust_deps//:defs.bzl", "pinned_rust_install") | ||
|
||
pinned_rust_install() |
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
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,34 @@ | ||
local_repository( | ||
name = "rules_rust", | ||
path = "../../..", | ||
) | ||
|
||
load("@rules_rust//rust:repositories.bzl", "rust_repositories") | ||
|
||
rust_repositories() | ||
|
||
load("@rules_rust//cargo:repositories.bzl", "crate_universe_deps") | ||
|
||
crate_universe_deps() | ||
|
||
load("@rules_rust//cargo:workspace.bzl", "crate", "crate_universe") | ||
|
||
crate_universe( | ||
name = "rust_deps", | ||
cargo_toml_files = ["//:Cargo.toml"], | ||
lockfile = "//:lockfile.lock", | ||
packages = [ | ||
crate.spec( | ||
name = "libc", | ||
semver = "=0.2.76", | ||
), | ||
], | ||
supported_targets = [ | ||
"x86_64-apple-darwin", | ||
"x86_64-unknown-linux-gnu", | ||
], | ||
) | ||
|
||
load("@rust_deps//:defs.bzl", "pinned_rust_install") | ||
|
||
pinned_rust_install() |
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
Oops, something went wrong.