Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 38 additions & 38 deletions .bazelci/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -703,33 +703,53 @@ tasks:
- "--apple_platform_type=ios"
test_targets:
- "//..."
bzlmod_all_crate_deps:
name: Cargo dependencies with bzlmod
platform: ubuntu2204
working_directory: examples/all_crate_deps
build_targets:
- "//..."
bzlmod_all_deps_vendor:
name: Vendored dependencies with bzlmod
platform: ubuntu2204
working_directory: examples/all_deps_vendor
run_targets:
- "//basic/3rdparty:crates_vendor"
build_targets:
- "//..."
bzlmod_compile_opt:
name: Compiler optimization with bzlmod
platform: ubuntu2204
working_directory: examples/compile_opt
build_targets:
- "//..."
# TODO: https://github.com/bazelbuild/rules_rust/issues/2075
# zig_cross_compiling:
# name: Zig cross compiling test
# cross_compile_zig:
# name: Cross compile example with Zig
# platform: ubuntu2204
# working_directory: examples/zig_cross_compiling
# working_directory: examples/cross_compile_zig
# build_targets:
# - "//..."
musl_cross_compiling_macos_to_linux:
name: Musl cross compiling test from macOS to Linux
cross_compile_musl_macos_to_linux:
name: Cross compile example Musl from macOS to Linux
platform: macos_arm64
working_directory: examples/musl_cross_compiling
working_directory: examples/cross_compile_musl
build_targets:
- "//..."
test_targets:
- "//..."
musl_cross_compiling_linux_to_linux:
name: Musl cross compiling test from Linux to Linux
cross_compile_musl_linux_to_linux:
name: Cross compile example Musl from Linux to Linux
platform: ubuntu2204
working_directory: examples/musl_cross_compiling
working_directory: examples/cross_compile_musl
build_targets:
- "//..."
test_targets:
- "//..."
nix_cross_compiling:
name: Nix cross compiling test
cross_compile_nix:
name: Cross compile example with Nix
platform: ubuntu2204
working_directory: examples/nix_cross_compiling
working_directory: examples/cross_compile_nix
setup:
- curl -L https://nixos.org/nix/install | bash
- sudo cp ~/.nix-profile/bin/nix* /usr/local/bin/
Expand All @@ -739,38 +759,18 @@ tasks:
- "//:nix_cross_compiling"
test_targets:
- "//..."
bzlmod_all_crate_deps:
name: Cargo dependencies with bzlmod
platform: ubuntu2204
working_directory: examples/all_crate_deps
build_targets:
- "//..."
bzlmod_all_deps_vendor:
name: Vendored dependencies with bzlmod
platform: ubuntu2204
working_directory: examples/all_deps_vendor
run_targets:
- "//basic/3rdparty:crates_vendor"
build_targets:
- "//..."
bzlmod_compile_opt:
name: Compiler optimization with bzlmod
platform: ubuntu2204
working_directory: examples/compile_opt
build_targets:
- "//..."
bzlmod_cross_compile:
name: Cross compilation with bzlmod
cross_compile_llvm_linux:
name: Cross compile example with LLVM on Linux
platform: ubuntu2204
working_directory: examples/cross_compile
working_directory: examples/cross_compile_llvm
build_targets:
- "//:all"
test_targets:
- "//..."
macos_bzlmod_cross_compile:
name: Cross compilation with bzlmod on macOS
cross_compile_llvm_macos:
name: Cross compile example with LLVM on MacOS
platform: macos_arm64
working_directory: examples/cross_compile
working_directory: examples/cross_compile_llvm
build_targets:
- "//:all"
test_targets:
Expand Down
2 changes: 1 addition & 1 deletion crate_universe/src/metadata/cargo_tree_resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ impl TreeResolver {
// it means we are forced to resolve the dependencies and features for those proc-macros on all platforms we care about,
// even if they wouldn't be used in some platform when cfg == exec.
//
// This is tested by the "keyring" example in examples/musl_cross_compiling - the keyring crate uses proc-macros only on Linux,
// This is tested by the "keyring" example in examples/cross_compile_musl - the keyring crate uses proc-macros only on Linux,
// and if we don't have this fake root injection, cross-compiling from Darwin to Linux won't work because features don't get correctly resolved for the exec=darwin case.
fn copy_project_with_explicit_deps_on_all_transitive_proc_macros(
&self,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module(
name = "hello_cross",
name = "cross_compile_llvm_example",
version = "0.0.0",
)

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module(
name = "musl_cross_compiling_example",
name = "cross_compile_musl_example",
version = "0.0.0",
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module(
name = "rules_rust_examples_nix",
name = "cross_compile_nix_example",
version = "0.0.0",
)

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
workspace(name = "cross_compile_zig_example")

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

BAZEL_ZIG_CC_VERSION = "v0.9.2"
Expand Down
4 changes: 2 additions & 2 deletions util/repin_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ for d in examples/crate_universe/vendor_*/; do
(cd "${d}" && CARGO_BAZEL_REPIN=true bazel run :crates_vendor)
done

for d in examples/crate_universe* examples/musl_cross_compiling test/integration/no_std
for d in examples/crate_universe* examples/cross_compile_musl test/integration/no_std
do
(cd "${d}" && CARGO_BAZEL_REPIN=true bazel query //... >/dev/null)
done

# `nix_cross_compiling` special cased as `//...` will invoke Nix.
(cd examples/nix_cross_compiling && CARGO_BAZEL_REPIN=true bazel query @crate_index//... >/dev/null)
(cd examples/cross_compile_nix && CARGO_BAZEL_REPIN=true bazel query @crate_index//... >/dev/null)