Skip to content

Commit

Permalink
Moved cargo_build_script test into appropriate dir. (bazelbuild#3024)
Browse files Browse the repository at this point in the history
  • Loading branch information
UebelAndre authored Nov 28, 2024
1 parent 43e5279 commit 4e54d34
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 66 deletions.
5 changes: 0 additions & 5 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,3 @@ use_repo(
"t3p__serde-1.0.214",
"t3p__serde_json-1.0.132",
)

register_toolchains(
"//test/foreign_toolchain_make_variables:toolchain_for_test",
dev_dependency = True,
)
2 changes: 0 additions & 2 deletions WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,3 @@ http_archive(
load("//test/3rdparty/crates:crates.bzl", test_crate_repositories = "crate_repositories")

test_crate_repositories()

register_toolchains("//test/foreign_toolchain_make_variables:toolchain_for_test")
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
load("//cargo:defs.bzl", "cargo_build_script")
load(":toolchain.bzl", "dummy_env_var_toolchain")

cargo_build_script(
name = "bs",
srcs = ["build.rs"],
build_script_env = {
"FROM_TOOLCHAIN": "$(FROM_TOOLCHAIN)",
"MODIFIED_FROM_TOOLCHAIN": "modified$(FROM_TOOLCHAIN)",
},
edition = "2021",
toolchains = [":dummy_env_var_toolchain"],
)

dummy_env_var_toolchain(
name = "dummy_env_var_toolchain",
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
"""Utilties for testing forwarding Make variables from toolchains."""

def _dummy_env_var_toolchain_impl(_ctx):
make_variables = platform_common.TemplateVariableInfo({
"ALSO_FROM_TOOLCHAIN": "absent",
"FROM_TOOLCHAIN": "present",
})

return [
platform_common.ToolchainInfo(
make_variables = make_variables,
),
make_variables,
]

dummy_env_var_toolchain = rule(
implementation = _dummy_env_var_toolchain_impl,
)
25 changes: 0 additions & 25 deletions test/foreign_toolchain_make_variables/BUILD.bazel

This file was deleted.

34 changes: 0 additions & 34 deletions test/foreign_toolchain_make_variables/toolchain.bzl

This file was deleted.

0 comments on commit 4e54d34

Please sign in to comment.