-
Notifications
You must be signed in to change notification settings - Fork 399
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an end-to-end test to make sure building zstd for iOS works
- Loading branch information
Showing
11 changed files
with
727 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
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 |
---|---|---|
|
@@ -2,3 +2,4 @@ android | |
cargo_manifest_dir/external_crate | ||
crate_universe | ||
ios | ||
ios_build |
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 @@ | ||
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,65 @@ | ||
load("@rules_rust//rust:defs.bzl", "rust_static_library") | ||
|
||
rust_static_library( | ||
name = "ios_build_lib", | ||
srcs = glob(["**/*.rs"]), | ||
edition = "2018", | ||
deps = [ | ||
"@ios_build//:zstd", | ||
], | ||
) | ||
|
||
filegroup( | ||
name = "lib", | ||
srcs = ["ios_build_lib"], | ||
) | ||
|
||
sh_test( | ||
name = "check_arch", | ||
srcs = ["check_arch.sh"], | ||
args = ["$(location :lib)"], | ||
data = [":lib"], | ||
) | ||
|
||
platform( | ||
name = "macos_x86_64", | ||
constraint_values = [ | ||
"@platforms//cpu:x86_64", | ||
"@platforms//os:macos", | ||
], | ||
) | ||
|
||
platform( | ||
name = "macos_arm64", | ||
constraint_values = [ | ||
"@platforms//cpu:arm64", | ||
"@platforms//os:macos", | ||
], | ||
) | ||
|
||
platform( | ||
name = "ios_x86_64", | ||
constraint_values = [ | ||
"@platforms//cpu:x86_64", | ||
"@platforms//os:ios", | ||
"@build_bazel_apple_support//constraints:simulator", | ||
], | ||
) | ||
|
||
platform( | ||
name = "ios_sim_arm64", | ||
constraint_values = [ | ||
"@platforms//cpu:arm64", | ||
"@platforms//os:ios", | ||
"@build_bazel_apple_support//constraints:simulator", | ||
], | ||
) | ||
|
||
platform( | ||
name = "ios_arm64", | ||
constraint_values = [ | ||
"@platforms//cpu:arm64", | ||
"@platforms//os:ios", | ||
"@build_bazel_apple_support//constraints:device", | ||
], | ||
) |
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,63 @@ | ||
# This file is automatically @generated by Cargo. | ||
# It is not intended for manual editing. | ||
version = 3 | ||
|
||
[[package]] | ||
name = "cc" | ||
version = "1.0.73" | ||
source = "registry+https://github.com/rust-lang/crates.io-index" | ||
checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" | ||
dependencies = [ | ||
"jobserver", | ||
] | ||
|
||
[[package]] | ||
name = "ios_build" | ||
version = "0.1.0" | ||
dependencies = [ | ||
"zstd", | ||
] | ||
|
||
[[package]] | ||
name = "jobserver" | ||
version = "0.1.25" | ||
source = "registry+https://github.com/rust-lang/crates.io-index" | ||
checksum = "068b1ee6743e4d11fb9c6a1e6064b3693a1b600e7f5f5988047d98b3dc9fb90b" | ||
dependencies = [ | ||
"libc", | ||
] | ||
|
||
[[package]] | ||
name = "libc" | ||
version = "0.2.134" | ||
source = "registry+https://github.com/rust-lang/crates.io-index" | ||
checksum = "329c933548736bc49fd575ee68c89e8be4d260064184389a5b77517cddd99ffb" | ||
|
||
[[package]] | ||
name = "zstd" | ||
version = "0.11.2+zstd.1.5.2" | ||
source = "registry+https://github.com/rust-lang/crates.io-index" | ||
checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" | ||
dependencies = [ | ||
"zstd-safe", | ||
] | ||
|
||
[[package]] | ||
name = "zstd-safe" | ||
version = "5.0.2+zstd.1.5.2" | ||
source = "registry+https://github.com/rust-lang/crates.io-index" | ||
checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" | ||
dependencies = [ | ||
"libc", | ||
"zstd-sys", | ||
] | ||
|
||
[[package]] | ||
name = "zstd-sys" | ||
version = "2.0.1+zstd.1.5.2" | ||
source = "registry+https://github.com/rust-lang/crates.io-index" | ||
checksum = "9fd07cbbc53846d9145dbffdf6dd09a7a0aa52be46741825f5c97bdd4f73f12b" | ||
dependencies = [ | ||
"cc", | ||
"libc", | ||
] |
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 = "ios_build" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
zstd = "0.11.2" |
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,64 @@ | ||
workspace(name = "examples") | ||
|
||
local_repository( | ||
name = "rules_rust", | ||
path = "../../", | ||
) | ||
|
||
load("@rules_rust//rust:repositories.bzl", "rules_rust_dependencies", "rust_register_toolchains") | ||
|
||
rules_rust_dependencies() | ||
|
||
rust_register_toolchains( | ||
edition = "2018", | ||
extra_target_triples = [ | ||
"aarch64-apple-ios-sim", | ||
"x86_64-apple-ios", | ||
], | ||
) | ||
|
||
load("@rules_rust//crate_universe:repositories.bzl", "crate_universe_dependencies") | ||
|
||
crate_universe_dependencies(bootstrap = True) | ||
|
||
load("@rules_rust//crate_universe:defs.bzl", "crates_repository", "splicing_config") | ||
|
||
crates_repository( | ||
name = "ios_build", | ||
cargo_lockfile = "//:Cargo.Bazel.lock", | ||
# `generator` is not necessary in official releases. | ||
# See load satement for `cargo_bazel_bootstrap`. | ||
generator = "@cargo_bazel_bootstrap//:cargo-bazel", | ||
lockfile = "//:cargo-bazel-lock.json", | ||
manifests = ["//:Cargo.toml"], | ||
splicing_config = splicing_config( | ||
resolver_version = "2", | ||
), | ||
) | ||
|
||
load( | ||
"@ios_build//:defs.bzl", | ||
ios_build_crate_repositories = "crate_repositories", | ||
) | ||
|
||
ios_build_crate_repositories() | ||
|
||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | ||
|
||
# Used for Bazel CI | ||
http_archive( | ||
name = "bazelci_rules", | ||
sha256 = "eca21884e6f66a88c358e580fd67a6b148d30ab57b1680f62a96c00f9bc6a07e", | ||
strip_prefix = "bazelci_rules-1.0.0", | ||
url = "https://github.com/bazelbuild/continuous-integration/releases/download/rules-1.0.0/bazelci_rules-1.0.0.tar.gz", | ||
) | ||
|
||
load("@bazelci_rules//:rbe_repo.bzl", "rbe_preconfig") | ||
|
||
# Creates a default toolchain config for RBE. | ||
# Use this as is if you are using the rbe_ubuntu16_04 container, | ||
# otherwise refer to RBE docs. | ||
rbe_preconfig( | ||
name = "buildkite_config", | ||
toolchain = "ubuntu1804-bazel-java11", | ||
) |
Oops, something went wrong.