-
Notifications
You must be signed in to change notification settings - Fork 439
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Platform transition added to Rust binary rules.
- Loading branch information
1 parent
0a4c4df
commit 7f62a13
Showing
7 changed files
with
364 additions
and
211 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
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 |
---|---|---|
@@ -1,150 +1,29 @@ | ||
load("@bazel_skylib//rules:build_test.bzl", "build_test") | ||
load("//bazel:transitions.bzl", "platform_transition_binary") | ||
|
||
# Disabled targets need the user to supply a sysroot in `flake.nix` first. | ||
|
||
build_test( | ||
name = "nix_cross_compiling", | ||
targets = [ | ||
# ":cc_binary_aarch64-apple-darwin", | ||
# ":cc_binary_aarch64-apple-ios", | ||
":cc_binary_aarch64-linux-android", | ||
":cc_binary_aarch64-unknown-linux-gnu", | ||
":cc_binary_wasm32-unknown-unknown", | ||
":cc_binary_wasm32-wasi", | ||
# ":cc_binary_x86_64-apple-darwin", | ||
# ":cc_binary_x86_64-pc-windows-msvc", | ||
":cc_binary_x86_64-unknown-linux-gnu", | ||
":cc_binary_x86_64-unknown-nixos-gnu", | ||
# ":rust_binary_aarch64-apple-darwin", | ||
# ":rust_binary_aarch64-apple-ios", | ||
":rust_binary_aarch64-linux-android", | ||
":rust_binary_aarch64-unknown-linux-gnu", | ||
":rust_binary_wasm32-unknown-unknown", | ||
":rust_binary_wasm32-wasi", | ||
# ":rust_binary_x86_64-apple-darwin", | ||
# ":rust_binary_x86_64-pc-windows-msvc", | ||
":rust_binary_x86_64-unknown-linux-gnu", | ||
":rust_binary_x86_64-unknown-nixos-gnu", | ||
# "//cc_binary:cc_binary_aarch64-apple-darwin", | ||
# "//cc_binary:cc_binary_aarch64-apple-ios", | ||
"//cc_binary:cc_binary_aarch64-linux-android", | ||
"//cc_binary:cc_binary_aarch64-unknown-linux-gnu", | ||
"//cc_binary:cc_binary_wasm32-unknown-unknown", | ||
"//cc_binary:cc_binary_wasm32-wasi", | ||
# "//cc_binary:cc_binary_x86_64-apple-darwin", | ||
# "//cc_binary:cc_binary_x86_64-pc-windows-msvc", | ||
"//cc_binary:cc_binary_x86_64-unknown-linux-gnu", | ||
"//cc_binary:cc_binary_x86_64-unknown-nixos-gnu", | ||
# "//rust_binary:rust_binary_aarch64-apple-darwin", | ||
# "//rust_binary:rust_binary_aarch64-apple-ios", | ||
"//rust_binary:rust_binary_aarch64-linux-android", | ||
"//rust_binary:rust_binary_aarch64-unknown-linux-gnu", | ||
"//rust_binary:rust_binary_wasm32-unknown-unknown", | ||
"//rust_binary:rust_binary_wasm32-wasi", | ||
# "//rust_binary:rust_binary_x86_64-apple-darwin", | ||
# "//rust_binary:rust_binary_x86_64-pc-windows-msvc", | ||
"//rust_binary:rust_binary_x86_64-unknown-linux-gnu", | ||
"//rust_binary:rust_binary_x86_64-unknown-nixos-gnu", | ||
], | ||
) | ||
|
||
# platform_transition_binary( | ||
# name = "cc_binary_aarch64-apple-darwin", | ||
# binary = "//cc_binary", | ||
# target_platform = "//bazel/platforms:aarch64-apple-darwin", | ||
# ) | ||
|
||
# platform_transition_binary( | ||
# name = "cc_binary_aarch64-apple-ios", | ||
# binary = "//cc_binary", | ||
# target_platform = "//bazel/platforms:aarch64-apple-ios", | ||
# ) | ||
|
||
platform_transition_binary( | ||
name = "cc_binary_aarch64-linux-android", | ||
binary = "//cc_binary", | ||
target_platform = "//bazel/platforms:aarch64-linux-android", | ||
) | ||
|
||
platform_transition_binary( | ||
name = "cc_binary_aarch64-unknown-linux-gnu", | ||
binary = "//cc_binary", | ||
target_platform = "//bazel/platforms:aarch64-unknown-linux-gnu", | ||
) | ||
|
||
platform_transition_binary( | ||
name = "cc_binary_wasm32-unknown-unknown", | ||
binary = "//cc_binary", | ||
target_platform = "//bazel/platforms:wasm32-unknown-unknown", | ||
) | ||
|
||
platform_transition_binary( | ||
name = "cc_binary_wasm32-wasi", | ||
binary = "//cc_binary", | ||
target_platform = "//bazel/platforms:wasm32-wasi", | ||
) | ||
|
||
# platform_transition_binary( | ||
# name = "cc_binary_x86_64-apple-darwin", | ||
# binary = "//cc_binary", | ||
# target_platform = "//bazel/platforms:x86_64-apple-darwin", | ||
# ) | ||
|
||
# platform_transition_binary( | ||
# name = "cc_binary_x86_64-pc-windows-msvc", | ||
# binary = "//cc_binary", | ||
# target_platform = "//bazel/platforms:x86_64-pc-windows-msvc", | ||
# ) | ||
|
||
platform_transition_binary( | ||
name = "cc_binary_x86_64-unknown-linux-gnu", | ||
binary = "//cc_binary", | ||
target_platform = "//bazel/platforms:x86_64-unknown-linux-gnu", | ||
) | ||
|
||
platform_transition_binary( | ||
name = "cc_binary_x86_64-unknown-nixos-gnu", | ||
binary = "//cc_binary", | ||
target_platform = "//bazel/platforms:x86_64-unknown-nixos-gnu", | ||
) | ||
|
||
# platform_transition_binary( | ||
# name = "rust_binary_aarch64-apple-darwin", | ||
# binary = "//rust_binary", | ||
# target_platform = "//bazel/platforms:aarch64-apple-darwin", | ||
# ) | ||
|
||
# platform_transition_binary( | ||
# name = "rust_binary_aarch64-apple-ios", | ||
# binary = "//rust_binary", | ||
# target_platform = "//bazel/platforms:aarch64-apple-ios", | ||
# ) | ||
|
||
platform_transition_binary( | ||
name = "rust_binary_aarch64-linux-android", | ||
binary = "//rust_binary", | ||
target_platform = "//bazel/platforms:aarch64-linux-android", | ||
) | ||
|
||
platform_transition_binary( | ||
name = "rust_binary_aarch64-unknown-linux-gnu", | ||
binary = "//rust_binary", | ||
target_platform = "//bazel/platforms:aarch64-unknown-linux-gnu", | ||
) | ||
|
||
platform_transition_binary( | ||
name = "rust_binary_wasm32-unknown-unknown", | ||
binary = "//rust_binary", | ||
target_platform = "//bazel/platforms:wasm32-unknown-unknown", | ||
) | ||
|
||
platform_transition_binary( | ||
name = "rust_binary_wasm32-wasi", | ||
binary = "//rust_binary", | ||
target_platform = "//bazel/platforms:wasm32-wasi", | ||
) | ||
|
||
# platform_transition_binary( | ||
# name = "rust_binary_x86_64-apple-darwin", | ||
# binary = "//rust_binary", | ||
# target_platform = "//bazel/platforms:x86_64-apple-darwin", | ||
# ) | ||
|
||
# platform_transition_binary( | ||
# name = "rust_binary_x86_64-pc-windows-msvc", | ||
# binary = "//rust_binary", | ||
# target_platform = "//bazel/platforms:x86_64-pc-windows-msvc", | ||
# ) | ||
|
||
platform_transition_binary( | ||
name = "rust_binary_x86_64-unknown-linux-gnu", | ||
binary = "//rust_binary", | ||
target_platform = "//bazel/platforms:x86_64-unknown-linux-gnu", | ||
) | ||
|
||
platform_transition_binary( | ||
name = "rust_binary_x86_64-unknown-nixos-gnu", | ||
binary = "//rust_binary", | ||
target_platform = "//bazel/platforms:x86_64-unknown-nixos-gnu", | ||
) |
52 changes: 29 additions & 23 deletions
52
examples/nix_cross_compiling/bazel/cargo/cargo-bazel-lock.json
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
Oops, something went wrong.