rules_jvm_external icon indicating copy to clipboard operation
rules_jvm_external copied to clipboard

Sprious warning regarding use of deprecated constraint host_windows_x64_constraint

Open kdowney-lot49 opened this issue 7 months ago • 1 comments

For all my Maven dependencies I see warnings like this:

WARNING: /home/vscode/.cache/bazel/_bazel_vscode/6f2a854b6c242f1bc1275d52318b5ceb/external/rules_jvm_external++maven+maven/BUILD:223:10: in _copy_file rule @@rules_jvm_external++maven+maven//:junit_junit_sources_4_13_2_extension: target '@@rules_jvm_external++maven+maven//:junit_junit_sources_4_13_2_extension' depends on deprecated target '@@bazel_tools//src/conditions:host_windows_x64_constraint': No longer used by Bazel and will be removed in the future. Migrate to toolchains or define your own version of this setting.

Bazel version in use:

$ bazel --version
bazel 8.3.1

Rules in use:

bazel_dep(name = "platforms", version = "1.0.0")
bazel_dep(name = "rules_jvm_external", version = "6.8")
bazel_dep(name = "rules_java", version = "8.14.0")

Maven install from MODULE.bazel

maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
maven.install(
    artifacts = [
        "junit:junit:4.12",
        "com.google.guava:guava:28.0-jre",
    ],
    fetch_sources = True,
    repositories = [
        "https://jcenter.bintray.com/",
    ],
    lock_file = "//:maven_install.json",
    known_contributing_modules = ["", "protobuf"],
    strict_visibility = True,
)

kdowney-lot49 avatar Jul 26 '25 20:07 kdowney-lot49

In #1424, @AustinSchuh said that this is caused by (quote) "pulling in an old bazel_skylib".

bazel mod graph shows these versions. In my project, where I'm also seeing this error, I had [email protected].

Adding bazel_dep(name = "bazel_skylib", version = "1.8.1") to my MODULE.bazel bumped it

That seems to have made this go away, for me.

@joca-bt FYI re. your (dupe) #1429.

vorburger avatar Sep 14 '25 23:09 vorburger