Skip to content

Commit

Permalink
Added bzlmod support to rust-analyzer tests
Browse files Browse the repository at this point in the history
  • Loading branch information
UebelAndre committed Dec 19, 2024
1 parent 0e2fbbf commit a3778c5
Show file tree
Hide file tree
Showing 25 changed files with 140 additions and 107 deletions.
6 changes: 3 additions & 3 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ use_repo(
"buildkite_config",
"generated_inputs_in_external_repo",
"libc",
"rtra",
"rtra__serde-1.0.216",
"rtra__serde_json-1.0.133",
"rules_rust_test_load_arbitrary_tool",
"rules_rust_toolchain_test_target_json",
"t3p",
"t3p__serde-1.0.215",
"t3p__serde_json-1.0.133",
)

bazel_dep(
Expand Down
11 changes: 0 additions & 11 deletions WORKSPACE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,3 @@ http_archive(
#
# load("@bazel_ci_rules//:rbe_repo.bzl", "rbe_preconfig")
# rbe_preconfig(name = "buildkite_config", toolchain = "ubuntu2004-bazel-java11")

http_archive(
name = "rules_testing",
sha256 = "02c62574631876a4e3b02a1820cb51167bb9cdcdea2381b2fa9d9b8b11c407c4",
strip_prefix = "rules_testing-0.6.0",
url = "https://github.com/bazelbuild/rules_testing/releases/download/v0.6.0/rules_testing-v0.6.0.tar.gz",
)

load("//test/3rdparty/crates:crates.bzl", test_crate_repositories = "crate_repositories")

test_crate_repositories()
2 changes: 2 additions & 0 deletions test/deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
load("//test/generated_inputs:external_repo.bzl", "generated_inputs_in_external_repo")
load("//test/load_arbitrary_tool:load_arbitrary_tool_test.bzl", "load_arbitrary_tool_test")
load("//test/rust_analyzer/3rdparty/crates:crates.bzl", rust_analyzer_test_crate_repositories = "crate_repositories")
load("//test/unit/toolchain:toolchain_test_utils.bzl", "rules_rust_toolchain_test_target_json_repository")

_LIBC_BUILD_FILE_CONTENT = """\
Expand Down Expand Up @@ -38,6 +39,7 @@ def rules_rust_test_deps(is_bzlmod = False):

direct_deps = load_arbitrary_tool_test()
direct_deps.extend(generated_inputs_in_external_repo())
direct_deps.extend(rust_analyzer_test_crate_repositories())

maybe(
http_archive,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("//crate_universe:defs.bzl", "crate", "crates_vendor")
load("@rules_rust//crate_universe:defs.bzl", "crate", "crates_vendor")

package(default_visibility = ["//visibility:public"])

Expand All @@ -14,10 +14,10 @@ crates_vendor(
version = "1",
),
},
# Short for 'test 3rdparty'. Keep this short to reduce the risk to
# bump into absolute path length issues on Windows. See:
# Short for 'rust_test_rust_analyzer'. Keep this short to reduce
# the risk to bump into absolute path length issues on Windows. See:
# https://github.com/bazelbuild/rules_rust/issues/1120
repository_name = "t3p",
repository_name = "rtra",
tags = ["manual"],
vendor_path = "crates",
)
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To
# regenerate this file, run the following:
#
# bazel run @@//test/3rdparty:crates_vendor
# bazel run @@//test/rust_analyzer/3rdparty:crates_vendor
###############################################################################

package(default_visibility = ["//visibility:public"])
Expand Down Expand Up @@ -33,12 +33,12 @@ filegroup(
# Workspace Member Dependencies
alias(
name = "serde",
actual = "@t3p__serde-1.0.215//:serde",
actual = "@rtra__serde-1.0.216//:serde",
tags = ["manual"],
)

alias(
name = "serde_json",
actual = "@t3p__serde_json-1.0.133//:serde_json",
actual = "@rtra__serde_json-1.0.133//:serde_json",
tags = ["manual"],
)
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To
# regenerate this file, run the following:
#
# bazel run @@//test/3rdparty:crates_vendor
# bazel run @@//test/rust_analyzer/3rdparty:crates_vendor
###############################################################################

load("@rules_rust//rust:defs.bzl", "rust_library")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To
# regenerate this file, run the following:
#
# bazel run @@//test/3rdparty:crates_vendor
# bazel run @@//test/rust_analyzer/3rdparty:crates_vendor
###############################################################################

load("@rules_rust//rust:defs.bzl", "rust_library")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To
# regenerate this file, run the following:
#
# bazel run @@//test/3rdparty:crates_vendor
# bazel run @@//test/rust_analyzer/3rdparty:crates_vendor
###############################################################################

load("@rules_rust//cargo:defs.bzl", "cargo_build_script")
Expand Down Expand Up @@ -83,8 +83,8 @@ rust_library(
}),
version = "1.0.92",
deps = [
"@t3p__proc-macro2-1.0.92//:build_script_build",
"@t3p__unicode-ident-1.0.14//:unicode_ident",
"@rtra__proc-macro2-1.0.92//:build_script_build",
"@rtra__unicode-ident-1.0.14//:unicode_ident",
],
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To
# regenerate this file, run the following:
#
# bazel run @@//test/3rdparty:crates_vendor
# bazel run @@//test/rust_analyzer/3rdparty:crates_vendor
###############################################################################

load("@rules_rust//rust:defs.bzl", "rust_library")
Expand Down Expand Up @@ -82,6 +82,6 @@ rust_library(
}),
version = "1.0.37",
deps = [
"@t3p__proc-macro2-1.0.92//:proc_macro2",
"@rtra__proc-macro2-1.0.92//:proc_macro2",
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To
# regenerate this file, run the following:
#
# bazel run @@//test/3rdparty:crates_vendor
# bazel run @@//test/rust_analyzer/3rdparty:crates_vendor
###############################################################################

load("@rules_rust//rust:defs.bzl", "rust_library")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To
# regenerate this file, run the following:
#
# bazel run @@//test/3rdparty:crates_vendor
# bazel run @@//test/rust_analyzer/3rdparty:crates_vendor
###############################################################################

load("@rules_rust//cargo:defs.bzl", "cargo_build_script")
Expand Down Expand Up @@ -38,7 +38,7 @@ rust_library(
crate_root = "src/lib.rs",
edition = "2018",
proc_macro_deps = [
"@t3p__serde_derive-1.0.215//:serde_derive",
"@rtra__serde_derive-1.0.216//:serde_derive",
],
rustc_flags = [
"--cap-lints=allow",
Expand Down Expand Up @@ -87,9 +87,9 @@ rust_library(
"@rules_rust//rust/platform:x86_64-unknown-none": [],
"//conditions:default": ["@platforms//:incompatible"],
}),
version = "1.0.215",
version = "1.0.216",
deps = [
"@t3p__serde-1.0.215//:build_script_build",
"@rtra__serde-1.0.216//:build_script_build",
],
)

Expand Down Expand Up @@ -144,7 +144,7 @@ cargo_build_script(
"noclippy",
"norustfmt",
],
version = "1.0.215",
version = "1.0.216",
visibility = ["//visibility:private"],
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To
# regenerate this file, run the following:
#
# bazel run @@//test/3rdparty:crates_vendor
# bazel run @@//test/rust_analyzer/3rdparty:crates_vendor
###############################################################################

load("@rules_rust//rust:defs.bzl", "rust_proc_macro")
Expand Down Expand Up @@ -80,10 +80,10 @@ rust_proc_macro(
"@rules_rust//rust/platform:x86_64-unknown-none": [],
"//conditions:default": ["@platforms//:incompatible"],
}),
version = "1.0.215",
version = "1.0.216",
deps = [
"@t3p__proc-macro2-1.0.92//:proc_macro2",
"@t3p__quote-1.0.37//:quote",
"@t3p__syn-2.0.90//:syn",
"@rtra__proc-macro2-1.0.92//:proc_macro2",
"@rtra__quote-1.0.37//:quote",
"@rtra__syn-2.0.90//:syn",
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To
# regenerate this file, run the following:
#
# bazel run @@//test/3rdparty:crates_vendor
# bazel run @@//test/rust_analyzer/3rdparty:crates_vendor
###############################################################################

load("@rules_rust//cargo:defs.bzl", "cargo_build_script")
Expand Down Expand Up @@ -84,11 +84,11 @@ rust_library(
}),
version = "1.0.133",
deps = [
"@t3p__itoa-1.0.14//:itoa",
"@t3p__memchr-2.7.4//:memchr",
"@t3p__ryu-1.0.18//:ryu",
"@t3p__serde-1.0.215//:serde",
"@t3p__serde_json-1.0.133//:build_script_build",
"@rtra__itoa-1.0.14//:itoa",
"@rtra__memchr-2.7.4//:memchr",
"@rtra__ryu-1.0.18//:ryu",
"@rtra__serde-1.0.216//:serde",
"@rtra__serde_json-1.0.133//:build_script_build",
],
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To
# regenerate this file, run the following:
#
# bazel run @@//test/3rdparty:crates_vendor
# bazel run @@//test/rust_analyzer/3rdparty:crates_vendor
###############################################################################

load("@rules_rust//rust:defs.bzl", "rust_library")
Expand Down Expand Up @@ -86,8 +86,8 @@ rust_library(
}),
version = "2.0.90",
deps = [
"@t3p__proc-macro2-1.0.92//:proc_macro2",
"@t3p__quote-1.0.37//:quote",
"@t3p__unicode-ident-1.0.14//:unicode_ident",
"@rtra__proc-macro2-1.0.92//:proc_macro2",
"@rtra__quote-1.0.37//:quote",
"@rtra__unicode-ident-1.0.14//:unicode_ident",
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To
# regenerate this file, run the following:
#
# bazel run @@//test/3rdparty:crates_vendor
# bazel run @@//test/rust_analyzer/3rdparty:crates_vendor
###############################################################################

load("@rules_rust//rust:defs.bzl", "rust_library")
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
load("@rules_rust//crate_universe/private:crates_vendor.bzl", "crates_vendor_remote_repository")

# buildifier: disable=bzl-visibility
load("//test/3rdparty/crates:defs.bzl", _crate_repositories = "crate_repositories")
load("//test/rust_analyzer/3rdparty/crates:defs.bzl", _crate_repositories = "crate_repositories")

def crate_repositories():
"""Generates repositories for vendored crates.
Expand All @@ -22,11 +22,11 @@ def crate_repositories():
"""
maybe(
crates_vendor_remote_repository,
name = "t3p",
build_file = Label("//test/3rdparty/crates:BUILD.bazel"),
defs_module = Label("//test/3rdparty/crates:defs.bzl"),
name = "rtra",
build_file = Label("//test/rust_analyzer/3rdparty/crates:BUILD.bazel"),
defs_module = Label("//test/rust_analyzer/3rdparty/crates:defs.bzl"),
)

direct_deps = [struct(repo = "t3p", is_dev_dep = False)]
direct_deps = [struct(repo = "rtra", is_dev_dep = False)]
direct_deps.extend(_crate_repositories())
return direct_deps
Loading

0 comments on commit a3778c5

Please sign in to comment.