From 9a2d1c669379b4322e4fe235c366796c704e7ccf Mon Sep 17 00:00:00 2001 From: Anna Skrodzka <56291558+anna-skrodzka@users.noreply.github.com> Date: Sat, 9 Nov 2024 16:39:00 +0100 Subject: [PATCH] Fix WORKSPACE in tests (#56) * maven_dependencies added to WORKSPACE * io_bazel_rules_scala to rules_scala3 * zinc_3_3_migration to zinc_3_migration * Dependencies.scala added * 3rdparty BUILD files modified * get rid of @annex_test * workspace.bzl modified * deps BUILD file mofified * binary tests fixed * compat tests fixed (almost) * compile/logger tests fixed * compile/srcjar tests fixed * compile/xml tests fixed * compile/logger tests fixed * /dependencies tests fixed * /deployjar tests fixed * plugins/kind-projector tests fixed * plugins/outputs tests fixed * /providers tests fixed * repl/simple tests fixed * /resources tests fixed * scala/scalaimport tests fixed * /scala3 tests fixed * strategy/worker_extra_flag tests fixed * /tagging tests fixed * munit updated * compile/log_level deleted (no need) * neverlink tests fixed * compile/error tests fixed * scala_deps.bzl edited * WORKSPACE edited * scalacopts/rule test fixed * format/scalafmt tests fixed * plugins/classpath tests fixed * test-frameworks/munit/test fixed * test-frameworks/munit/test fixed * WORKSPACE * WORKSPACE * WORKSPACE edited * WORKSPACE edited * c++ version added * remote_java_tools (experimental) * java_runtime added * return --------- Co-authored-by: anna-skrodzka --- .bazelrc_shared | 2 ++ tests/BUILD | 14 -------------- tests/WORKSPACE | 30 ++++++++++++++++++++++++++++-- 3 files changed, 30 insertions(+), 16 deletions(-) diff --git a/.bazelrc_shared b/.bazelrc_shared index 9cb4b9ee..8eb0b7b9 100644 --- a/.bazelrc_shared +++ b/.bazelrc_shared @@ -1,6 +1,8 @@ common --announce_rc common --color=yes +build --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 + build --host_platform=@rules_nixpkgs_core//platforms:host build --experimental_strict_action_env diff --git a/tests/BUILD b/tests/BUILD index 016c52c2..efe0d791 100644 --- a/tests/BUILD +++ b/tests/BUILD @@ -1,4 +1,3 @@ -#load("@bazel_tools//tools/jdk:default_java_toolchain.bzl", "default_java_toolchain") load("@rules_proto//proto:defs.bzl", "proto_library") load("@rules_scala3//deps:scala_deps.bzl", "scala_deps") @@ -37,16 +36,3 @@ proto_library( "@com_google_protobuf//:descriptor_proto", ], ) - -#default_java_toolchain( -# name = "toolchain_hostjdk16", -# configuration = dict( -# java_runtime = "@bazel_tools//tools/jdk:jdk", -# jvm_opts = ["-Xbootclasspath/p:$(location @remote_java_tools//:javac_jar)"], -# tools = ["@remote_java_tools//:javac_jar"], -# ), -# java_runtime = "@bazel_tools//tools/jdk:current_host_java_runtime", -# source_version = "16", -# target_version = "16", -# toolchain_definition = False, -#) diff --git a/tests/WORKSPACE b/tests/WORKSPACE index 87b7e635..a9a3aa65 100644 --- a/tests/WORKSPACE +++ b/tests/WORKSPACE @@ -11,11 +11,35 @@ http_archive( url = "https://github.com/bazelbuild/rules_jvm_external/archive/{}.tar.gz".format(rules_jvm_external_tag), ) -protobuf_tag = "28.2" +bazel_skylib_tag = "1.5.0" + +http_archive( + name = "bazel_skylib", + sha256 = "cd55a062e763b9349921f0f5db8c3933288dc8ba4f76dd9416aac68acee3cb94", + urls = [ + "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/{tag}/bazel-skylib-{tag}.tar.gz".format(tag = bazel_skylib_tag), + "https://github.com/bazelbuild/bazel-skylib/releases/download/{tag}/bazel-skylib-{tag}.tar.gz".format(tag = bazel_skylib_tag), + ], +) + +rules_python_version = "0.37.2" + +http_archive( + name = "rules_python", + sha256 = "c6fb25d0ba0246f6d5bd820dd0b2e66b339ccc510242fd4956b9a639b548d113", + strip_prefix = "rules_python-" + rules_python_version, + url = "https://github.com/bazelbuild/rules_python/archive/refs/tags/{0}.tar.gz".format(rules_python_version), +) + +load("@rules_python//python:repositories.bzl", "py_repositories") + +py_repositories() + +protobuf_tag = "28.3" http_archive( name = "com_google_protobuf", - sha256 = "b2340aa47faf7ef10a0328190319d3f3bee1b24f426d4ce8f4253b6f27ce16db", + sha256 = "7c3ebd7aaedd86fa5dc479a0fda803f602caaf78d8aff7ce83b89e1b8ae7442a", strip_prefix = "protobuf-" + protobuf_tag, url = "https://github.com/protocolbuffers/protobuf/archive/v{}.tar.gz".format(protobuf_tag), ) @@ -96,6 +120,8 @@ load("//3rdparty:workspace.bzl", "maven_dependencies") maven_dependencies() +register_toolchains("@rules_scala3//rules/scala_proto:scalapb_scala_proto_toolchain") + bind( name = "default_scala", actual = "@rules_scala3//scala:zinc_3_3",