Skip to content

Commit 142c319

Browse files
committed
Reorganized examples
1 parent da4de3b commit 142c319

File tree

100 files changed

+46
-44
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+46
-44
lines changed

.bazelci/presubmit.yml

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -703,33 +703,53 @@ tasks:
703703
- "--apple_platform_type=ios"
704704
test_targets:
705705
- "//..."
706+
bzlmod_all_crate_deps:
707+
name: Cargo dependencies with bzlmod
708+
platform: ubuntu2204
709+
working_directory: examples/all_crate_deps
710+
build_targets:
711+
- "//..."
712+
bzlmod_all_deps_vendor:
713+
name: Vendored dependencies with bzlmod
714+
platform: ubuntu2204
715+
working_directory: examples/all_deps_vendor
716+
run_targets:
717+
- "//basic/3rdparty:crates_vendor"
718+
build_targets:
719+
- "//..."
720+
bzlmod_compile_opt:
721+
name: Compiler optimization with bzlmod
722+
platform: ubuntu2204
723+
working_directory: examples/compile_opt
724+
build_targets:
725+
- "//..."
706726
# TODO: https://github.com/bazelbuild/rules_rust/issues/2075
707-
# zig_cross_compiling:
708-
# name: Zig cross compiling test
727+
# cross_compile_zig:
728+
# name: Cross compile example with Zig
709729
# platform: ubuntu2204
710-
# working_directory: examples/zig_cross_compiling
730+
# working_directory: examples/cross_compile_zig
711731
# build_targets:
712732
# - "//..."
713-
musl_cross_compiling_macos_to_linux:
714-
name: Musl cross compiling test from macOS to Linux
733+
cross_compile_musl_macos_to_linux:
734+
name: Cross compile example Musl from macOS to Linux
715735
platform: macos_arm64
716-
working_directory: examples/musl_cross_compiling
736+
working_directory: examples/cross_compile_musl
717737
build_targets:
718738
- "//..."
719739
test_targets:
720740
- "//..."
721-
musl_cross_compiling_linux_to_linux:
722-
name: Musl cross compiling test from Linux to Linux
741+
cross_compile_musl_linux_to_linux:
742+
name: Cross Compile example Musl from Linux to Linux
723743
platform: ubuntu2204
724-
working_directory: examples/musl_cross_compiling
744+
working_directory: examples/cross_compile_musl
725745
build_targets:
726746
- "//..."
727747
test_targets:
728748
- "//..."
729-
nix_cross_compiling:
730-
name: Nix cross compiling test
749+
cross_compile_nix:
750+
name: Cross compile example with Nix
731751
platform: ubuntu2204
732-
working_directory: examples/nix_cross_compiling
752+
working_directory: examples/cross_compile_nix
733753
setup:
734754
- curl -L https://nixos.org/nix/install | bash
735755
- sudo cp ~/.nix-profile/bin/nix* /usr/local/bin/
@@ -739,38 +759,18 @@ tasks:
739759
- "//:nix_cross_compiling"
740760
test_targets:
741761
- "//..."
742-
bzlmod_all_crate_deps:
743-
name: Cargo dependencies with bzlmod
744-
platform: ubuntu2204
745-
working_directory: examples/all_crate_deps
746-
build_targets:
747-
- "//..."
748-
bzlmod_all_deps_vendor:
749-
name: Vendored dependencies with bzlmod
750-
platform: ubuntu2204
751-
working_directory: examples/all_deps_vendor
752-
run_targets:
753-
- "//basic/3rdparty:crates_vendor"
754-
build_targets:
755-
- "//..."
756-
bzlmod_compile_opt:
757-
name: Compiler optimization with bzlmod
758-
platform: ubuntu2204
759-
working_directory: examples/compile_opt
760-
build_targets:
761-
- "//..."
762-
bzlmod_cross_compile:
763-
name: Cross compilation with bzlmod
762+
cross_compile_llvm_linux:
763+
name: Cross compile example with LLVM on Linux
764764
platform: ubuntu2204
765-
working_directory: examples/cross_compile
765+
working_directory: examples/cross_compile_llvm
766766
build_targets:
767767
- "//:all"
768768
test_targets:
769769
- "//..."
770-
macos_bzlmod_cross_compile:
771-
name: Cross compilation with bzlmod on macOS
770+
cross_compile_llvm_macos:
771+
name: Cross compile example with LLVM on MacOS
772772
platform: macos_arm64
773-
working_directory: examples/cross_compile
773+
working_directory: examples/cross_compile_llvm
774774
build_targets:
775775
- "//:all"
776776
test_targets:

crate_universe/src/metadata/cargo_tree_resolver.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ impl TreeResolver {
490490
// it means we are forced to resolve the dependencies and features for those proc-macros on all platforms we care about,
491491
// even if they wouldn't be used in some platform when cfg == exec.
492492
//
493-
// This is tested by the "keyring" example in examples/musl_cross_compiling - the keyring crate uses proc-macros only on Linux,
493+
// This is tested by the "keyring" example in examples/cross_compile_musl - the keyring crate uses proc-macros only on Linux,
494494
// 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.
495495
fn copy_project_with_explicit_deps_on_all_transitive_proc_macros(
496496
&self,
File renamed without changes.
File renamed without changes.
File renamed without changes.

examples/cross_compile/MODULE.bazel renamed to examples/cross_compile_llvm/MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module(
2-
name = "hello_cross",
2+
name = "cross_compile_llvm_example",
33
version = "0.0.0",
44
)
55

0 commit comments

Comments
 (0)