diff --git a/.bazelrc b/.bazelrc index 08181f2c3..c1e4db408 100644 --- a/.bazelrc +++ b/.bazelrc @@ -6,9 +6,6 @@ build --enable_platform_specific_config build -c opt # Ensure that paths of files printed by our examples are valid. build --nozip_undeclared_test_outputs -# Improve caching for builds involving multiple configurations and work around -# the Bazel issue fixed by https://github.com/bazelbuild/bazel/pull/17158. -build --experimental_output_directory_naming_scheme=diff_against_baseline # C/C++ # GCC is supported on a best-effort basis. @@ -19,10 +16,6 @@ build:ci --features=layering_check build:macos --apple_crosstool_top=@local_config_apple_cc//:toolchain build:macos --crosstool_top=@local_config_apple_cc//:toolchain build:macos --host_crosstool_top=@local_config_apple_cc//:toolchain -# Workaround for https://github.com/bazelbuild/bazel/issues/17956 -# Compiling the Java tools from source fails due to a missing include in zlib. -build:macos --per_file_copt='external/remote_java_tools/java_tools/zlib[~/].*\.c@-std=c90' -build:macos --host_per_file_copt='external/remote_java_tools/java_tools/zlib[~/].*\.c@-std=c90' # Java # Always build for Java 8, even with a newer JDK. This ensures that all diff --git a/.bazelversion b/.bazelversion index bd0a60636..19997e028 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -8482c7cf494686eb7498cec6ee58dad03b07ef0d +0573eee38d7d3b695267dfd125ab8e08d83a2640 diff --git a/WORKSPACE.bazel b/WORKSPACE.bazel index ab0ed1cf7..ae28bfc45 100644 --- a/WORKSPACE.bazel +++ b/WORKSPACE.bazel @@ -12,10 +12,10 @@ jazzer_init() http_archive( name = "com_google_protobuf", patches = ["//third_party:protobuf-disable-layering_check.patch"], - sha256 = "930c2c3b5ecc6c9c12615cf5ad93f1cd6e12d0aba862b572e076259970ac3a53", - strip_prefix = "protobuf-3.21.12", + sha256 = "ddf8c9c1ffccb7e80afd183b3bd32b3b62f7cc54b106be190bf49f2bc09daab5", + strip_prefix = "protobuf-23.2", # Keep in sync with com_google_protobuf_protobuf_java in repositories.bzl. - urls = ["https://github.com/protocolbuffers/protobuf/archive/v3.21.12.tar.gz"], + urls = ["https://github.com/protocolbuffers/protobuf/releases/download/v23.2/protobuf-23.2.tar.gz"], ) http_archive( @@ -110,15 +110,15 @@ http_file( http_file( name = "jacocoagent", downloaded_file_path = "jacocoagent.jar", - sha256 = "67de51e9ca1db044f3a3d10613518befb02e8eee1015f2ff6d56cfb9d4506546", - urls = ["https://repo1.maven.org/maven2/org/jacoco/org.jacoco.agent/0.8.8/org.jacoco.agent-0.8.8-runtime.jar"], + sha256 = "191734a0b7ef97606e6a09ae584c4acab47eb30fcb4c555d3d440d4e0d71d73d", + urls = ["https://repo1.maven.org/maven2/org/jacoco/org.jacoco.agent/0.8.9/org.jacoco.agent-0.8.9-runtime.jar"], ) http_file( name = "jacococli", downloaded_file_path = "jacococli.jar", - sha256 = "c449591174982bbc003d1290003fcbc7b939215436922d2f0f25239d110d531a", - urls = ["https://repo1.maven.org/maven2/org/jacoco/org.jacoco.cli/0.8.8/org.jacoco.cli-0.8.8-nodeps.jar"], + sha256 = "29c7754338512599f742ebfedd095c9c93800fefbce407500eceb16f0ed5a20d", + urls = ["https://repo1.maven.org/maven2/org/jacoco/org.jacoco.cli/0.8.9/org.jacoco.cli-0.8.9-nodeps.jar"], ) load("@contrib_rules_jvm//:repositories.bzl", "contrib_rules_jvm_deps") @@ -287,9 +287,9 @@ cc_library( visibility = ["//visibility:public"], ) """, - sha256 = "fd299fd72c5cf664259d9bd43a72cb74dc6a8b9604d107fe2d2e90885aeb7c16", - strip_prefix = "libprotobuf-mutator-1.1", - urls = ["https://github.com/google/libprotobuf-mutator/archive/refs/tags/v1.1.tar.gz"], + sha256 = "21bfdfef25554fa2e30aec2a9f9b58f4a17c1d8c8593763fa94a6dd74b226594", + strip_prefix = "libprotobuf-mutator-3b28530531b154a748fe9884bc9219b4966f0754", + urls = ["https://github.com/google/libprotobuf-mutator/archive/3b28530531b154a748fe9884bc9219b4966f0754.tar.gz"], ) http_file( diff --git a/repositories.bzl b/repositories.bzl index 464516149..df1338f08 100644 --- a/repositories.bzl +++ b/repositories.bzl @@ -42,8 +42,8 @@ def jazzer_dependencies(android = False): maybe( http_archive, name = "io_bazel_rules_kotlin", - sha256 = "fd92a98bd8a8f0e1cdcb490b93f5acef1f1727ed992571232d33de42395ca9b3", - url = "https://github.com/bazelbuild/rules_kotlin/releases/download/v1.7.1/rules_kotlin_release.tgz", + sha256 = "01293740a16e474669aba5b5a1fe3d368de5832442f164e4fbfc566815a8bc3a", + url = "https://github.com/bazelbuild/rules_kotlin/releases/download/v1.8/rules_kotlin_release.tgz", ) maybe( @@ -57,17 +57,17 @@ def jazzer_dependencies(android = False): maybe( http_archive, name = "build_bazel_apple_support", - sha256 = "effa003b7bdb7c72b32f00092fe6deb7acf54c682c18ee1fd6bbbe9f8cf8c08b", - strip_prefix = "apple_support-40306d1599fdb7924c4bbd63a0cdb766f120ec69", - url = "https://github.com/bazelbuild/apple_support/archive/40306d1599fdb7924c4bbd63a0cdb766f120ec69.tar.gz", + sha256 = "ce80afe548fd71ef27b48cb48a283ca21256a0900caec3c7ed9416241e000bfe", + strip_prefix = "apple_support-dab92884a6f031e63ac263e5de8a02f13ac42508", + url = "https://github.com/bazelbuild/apple_support/archive/dab92884a6f031e63ac263e5de8a02f13ac42508.tar.gz", ) maybe( http_archive, name = "com_google_absl", - sha256 = "4208129b49006089ba1d6710845a45e31c59b0ab6bff9e5788a87f55c5abd602", - strip_prefix = "abseil-cpp-20220623.0", - url = "https://github.com/abseil/abseil-cpp/archive/refs/tags/20220623.0.tar.gz", + sha256 = "5366d7e7fa7ba0d915014d387b66d0d002c03236448e1ba9ef98122c13b35c36", + strip_prefix = "abseil-cpp-20230125.3", + url = "https://github.com/abseil/abseil-cpp/archive/refs/tags/20230125.3.tar.gz", ) maybe( @@ -91,9 +91,9 @@ def jazzer_dependencies(android = False): http_archive, build_file = Label("//third_party:classgraph.BUILD"), name = "com_github_classgraph_classgraph", - sha256 = "600f0f8f321dd0a3b55a51409c9e96f4274a92a2660f8a8abdb3da6ed83147f4", - strip_prefix = "classgraph-classgraph-4.8.149", - url = "https://github.com/classgraph/classgraph/archive/refs/tags/classgraph-4.8.149.tar.gz", + sha256 = "39a594834ec24ef8f604485e4ee54b8b6dfe0b0ee5020e70601a9dab538d5c9e", + strip_prefix = "classgraph-classgraph-4.8.160", + url = "https://github.com/classgraph/classgraph/archive/refs/tags/classgraph-4.8.160.tar.gz", ) maybe( @@ -107,8 +107,8 @@ def jazzer_dependencies(android = False): maybe( http_jar, name = "net_bytebuddy_byte_buddy_agent", - sha256 = "fbd1ab3db43c6c78b8804908cb95b656517f5c82e7fde8d255d8bdceef412d70", - url = "https://repo1.maven.org/maven2/net/bytebuddy/byte-buddy-agent/1.14.4/byte-buddy-agent-1.14.4.jar", + sha256 = "55f19862b870f5d85890ba5386b1b45e9bbc88d5fe1f819abe0c788b4929fa6b", + url = "https://repo1.maven.org/maven2/net/bytebuddy/byte-buddy-agent/1.14.5/byte-buddy-agent-1.14.5.jar", ) maybe( @@ -156,9 +156,9 @@ def jazzer_dependencies(android = False): maybe( http_jar, name = "com_google_protobuf_protobuf_java", - sha256 = "3f3edbda9286246080f3eaf561dd6b0d5a2b1f1008f6909115c8609ceae9df87", + sha256 = "18a057f5e0f828daa92b71c19df91f6bcc2aad067ca2cdd6b5698055ca7bcece", # Keep in sync with com_google_protobuf in WORKSPACE. - url = "https://repo1.maven.org/maven2/com/google/protobuf/protobuf-java/3.21.12/protobuf-java-3.21.12.jar", + url = "https://repo1.maven.org/maven2/com/google/protobuf/protobuf-java/3.23.2/protobuf-java-3.23.2.jar", ) maybe( diff --git a/src/main/java/com/code_intelligence/jazzer/agent/RuntimeInstrumentor.kt b/src/main/java/com/code_intelligence/jazzer/agent/RuntimeInstrumentor.kt index e9f57b173..57410f306 100644 --- a/src/main/java/com/code_intelligence/jazzer/agent/RuntimeInstrumentor.kt +++ b/src/main/java/com/code_intelligence/jazzer/agent/RuntimeInstrumentor.kt @@ -143,7 +143,7 @@ class RuntimeInstrumentor( } instrumentation.redefineModule( module, - /* extraReads */ setOf(RuntimeInstrumentor::class.java.module), + setOf(RuntimeInstrumentor::class.java.module), // extraReads emptyMap(), emptyMap(), emptySet(), diff --git a/third_party/protobuf-disable-layering_check.patch b/third_party/protobuf-disable-layering_check.patch index 460c9efe9..69d3449a5 100644 --- a/third_party/protobuf-disable-layering_check.patch +++ b/third_party/protobuf-disable-layering_check.patch @@ -1,13 +1,249 @@ -diff --git BUILD.bazel BUILD.bazel -index 0f6e41e3a..2cf73afe8 100644 ---- BUILD.bazel -+++ BUILD.bazel -@@ -16,6 +16,8 @@ load( - "py_proto_library", +commit 0cb6965869ab94858d9b843ab5d94f7deaea5dc8 +Author: Fabian Meumertzheim +Date: Mon Jun 12 16:12:02 2023 +0200 + + Disable layering_check + + protobuf misses a sizeable number of dependency declarations, which + means that `layering_check` has to be disabled for it. + + Generated with: + ``` + buildozer 'add features -layering_check' //src/...:__pkg__ + ``` + + Contains only the changes to `package` directives. + +diff --git src/BUILD.bazel src/BUILD.bazel +index 0de1a4eb1..b7e405147 100644 +--- src/BUILD.bazel ++++ src/BUILD.bazel +@@ -7,6 +7,8 @@ load("@rules_pkg//:mappings.bzl", "pkg_filegroup", "pkg_files", "strip_prefix") + load("@upb//cmake:build_defs.bzl", "staleness_test") + load("//conformance:defs.bzl", "conformance_test") + ++package(features = ["-layering_check"]) ++ + pkg_files( + name = "dist_files", + srcs = glob(["**"]), +diff --git src/google/protobuf/BUILD.bazel src/google/protobuf/BUILD.bazel +index 77ed2309f..8c38fb872 100644 +--- src/google/protobuf/BUILD.bazel ++++ src/google/protobuf/BUILD.bazel +@@ -13,6 +13,7 @@ package( + "//:__pkg__", # "public" targets are alias rules in //. + "//json:__subpackages__", + ], ++ features = ["-layering_check"], ) + proto_library( +diff --git src/google/protobuf/compiler/BUILD.bazel src/google/protobuf/compiler/BUILD.bazel +index a2171c806..8dcd34667 100644 +--- src/google/protobuf/compiler/BUILD.bazel ++++ src/google/protobuf/compiler/BUILD.bazel +@@ -13,6 +13,8 @@ load("@rules_proto//proto:defs.bzl", "proto_library") + load("//build_defs:arch_tests.bzl", "aarch64_test", "x86_64_test") + load("//build_defs:cpp_opts.bzl", "COPTS", "LINK_OPTS") + ++package(features = ["-layering_check"]) ++ + proto_library( + name = "plugin_proto", + srcs = ["plugin.proto"], +diff --git src/google/protobuf/compiler/allowlists/BUILD.bazel src/google/protobuf/compiler/allowlists/BUILD.bazel +index 569a142fc..0a90b312f 100644 +--- src/google/protobuf/compiler/allowlists/BUILD.bazel ++++ src/google/protobuf/compiler/allowlists/BUILD.bazel +@@ -1,7 +1,10 @@ + load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test") + load("//build_defs:cpp_opts.bzl", "COPTS") + +-package(default_visibility = ["//visibility:private"]) ++package( ++ default_visibility = ["//visibility:private"], ++ features = ["-layering_check"], ++) + + cc_library( + name = "allowlist", +diff --git src/google/protobuf/compiler/cpp/BUILD.bazel src/google/protobuf/compiler/cpp/BUILD.bazel +index ac1184d32..deacbf582 100644 +--- src/google/protobuf/compiler/cpp/BUILD.bazel ++++ src/google/protobuf/compiler/cpp/BUILD.bazel +@@ -7,6 +7,8 @@ load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix") + load("@rules_proto//proto:defs.bzl", "proto_library") + load("//build_defs:cpp_opts.bzl", "COPTS") + ++package(features = ["-layering_check"]) ++ + cc_library( + name = "names", + hdrs = ["names.h"], +diff --git src/google/protobuf/compiler/csharp/BUILD.bazel src/google/protobuf/compiler/csharp/BUILD.bazel +index 96b8dcbc0..a2d549f26 100644 +--- src/google/protobuf/compiler/csharp/BUILD.bazel ++++ src/google/protobuf/compiler/csharp/BUILD.bazel +@@ -6,6 +6,8 @@ load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test") + load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix") + load("//build_defs:cpp_opts.bzl", "COPTS") + ++package(features = ["-layering_check"]) ++ + cc_library( + name = "names", + hdrs = ["names.h"], +diff --git src/google/protobuf/compiler/java/BUILD.bazel src/google/protobuf/compiler/java/BUILD.bazel +index 94573892c..c94f472d6 100644 +--- src/google/protobuf/compiler/java/BUILD.bazel ++++ src/google/protobuf/compiler/java/BUILD.bazel +@@ -6,6 +6,8 @@ load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test") + load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix") + load("//build_defs:cpp_opts.bzl", "COPTS") + +package(features = ["-layering_check"]) + + cc_library( + name = "names", + hdrs = ["names.h"], +diff --git src/google/protobuf/compiler/objectivec/BUILD.bazel src/google/protobuf/compiler/objectivec/BUILD.bazel +index f78990394..6c534219a 100644 +--- src/google/protobuf/compiler/objectivec/BUILD.bazel ++++ src/google/protobuf/compiler/objectivec/BUILD.bazel +@@ -6,6 +6,8 @@ load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test") + load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix") + load("//build_defs:cpp_opts.bzl", "COPTS") + ++package(features = ["-layering_check"]) ++ + cc_library( + name = "names", + hdrs = ["names.h"], +diff --git src/google/protobuf/compiler/php/BUILD.bazel src/google/protobuf/compiler/php/BUILD.bazel +index fe9e75c2c..a569a1c9d 100644 +--- src/google/protobuf/compiler/php/BUILD.bazel ++++ src/google/protobuf/compiler/php/BUILD.bazel +@@ -6,6 +6,8 @@ load("@rules_cc//cc:defs.bzl", "cc_library") + load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix") + load("//build_defs:cpp_opts.bzl", "COPTS") + ++package(features = ["-layering_check"]) ++ + cc_library( + name = "names", + hdrs = ["names.h"], +diff --git src/google/protobuf/compiler/python/BUILD.bazel src/google/protobuf/compiler/python/BUILD.bazel +index 5d26e0ce9..ce017acf1 100644 +--- src/google/protobuf/compiler/python/BUILD.bazel ++++ src/google/protobuf/compiler/python/BUILD.bazel +@@ -6,6 +6,8 @@ load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test") + load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix") + load("//build_defs:cpp_opts.bzl", "COPTS") + ++package(features = ["-layering_check"]) ++ + cc_library( + name = "python", + srcs = [ +diff --git src/google/protobuf/compiler/ruby/BUILD.bazel src/google/protobuf/compiler/ruby/BUILD.bazel +index 520b69194..1e437e7bc 100644 +--- src/google/protobuf/compiler/ruby/BUILD.bazel ++++ src/google/protobuf/compiler/ruby/BUILD.bazel +@@ -6,6 +6,8 @@ load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test") + load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix") + load("//build_defs:cpp_opts.bzl", "COPTS") + ++package(features = ["-layering_check"]) ++ + cc_library( + name = "ruby", + srcs = ["ruby_generator.cc"], +diff --git src/google/protobuf/compiler/rust/BUILD.bazel src/google/protobuf/compiler/rust/BUILD.bazel +index 7c1f5b856..4a10038d1 100644 +--- src/google/protobuf/compiler/rust/BUILD.bazel ++++ src/google/protobuf/compiler/rust/BUILD.bazel +@@ -5,6 +5,8 @@ + load("@rules_cc//cc:defs.bzl", "cc_library") + load("//build_defs:cpp_opts.bzl", "COPTS") + ++package(features = ["-layering_check"]) ++ + cc_library( + name = "rust", + srcs = ["generator.cc"], +diff --git src/google/protobuf/io/BUILD.bazel src/google/protobuf/io/BUILD.bazel +index 8f39625c2..fc2f8e002 100644 +--- src/google/protobuf/io/BUILD.bazel ++++ src/google/protobuf/io/BUILD.bazel +@@ -6,6 +6,7 @@ load("//build_defs:cpp_opts.bzl", "COPTS") + + package( + default_visibility = ["//visibility:public"], ++ features = ["-layering_check"], + ) + + cc_library( +diff --git src/google/protobuf/json/BUILD.bazel src/google/protobuf/json/BUILD.bazel +index d6019f939..83caca985 100644 +--- src/google/protobuf/json/BUILD.bazel ++++ src/google/protobuf/json/BUILD.bazel +@@ -1,10 +1,13 @@ + load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test") + load("//build_defs:cpp_opts.bzl", "COPTS") + +-package(default_visibility = [ +- "//pkg:__pkg__", +- "//src/google/protobuf/json:__pkg__", +-]) ++package( ++ default_visibility = [ ++ "//pkg:__pkg__", ++ "//src/google/protobuf/json:__pkg__", ++ ], ++ features = ["-layering_check"], ++) + licenses(["notice"]) - exports_files(["LICENSE"]) +diff --git src/google/protobuf/stubs/BUILD.bazel src/google/protobuf/stubs/BUILD.bazel +index c8fc3e9d0..9521f5103 100644 +--- src/google/protobuf/stubs/BUILD.bazel ++++ src/google/protobuf/stubs/BUILD.bazel +@@ -7,6 +7,7 @@ load("//build_defs:cpp_opts.bzl", "COPTS", "LINK_OPTS") + + package( + default_visibility = ["//:__subpackages__"], ++ features = ["-layering_check"], + ) + + cc_library( +diff --git src/google/protobuf/testing/BUILD.bazel src/google/protobuf/testing/BUILD.bazel +index 572c1f9f4..d10435cce 100644 +--- src/google/protobuf/testing/BUILD.bazel ++++ src/google/protobuf/testing/BUILD.bazel +@@ -5,7 +5,10 @@ load("@rules_cc//cc:defs.bzl", "cc_library") + load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix") + load("//build_defs:cpp_opts.bzl", "COPTS", "LINK_OPTS") + +-package(default_visibility = ["//:__subpackages__"]) ++package( ++ default_visibility = ["//:__subpackages__"], ++ features = ["-layering_check"], ++) + + cc_library( + name = "testing", +diff --git src/google/protobuf/util/BUILD.bazel src/google/protobuf/util/BUILD.bazel +index 3afe464cf..03a3045b3 100644 +--- src/google/protobuf/util/BUILD.bazel ++++ src/google/protobuf/util/BUILD.bazel +@@ -7,6 +7,8 @@ load("@rules_pkg//:mappings.bzl", "pkg_files", "strip_prefix") + load("@rules_proto//proto:defs.bzl", "proto_library") + load("//build_defs:cpp_opts.bzl", "COPTS") + ++package(features = ["-layering_check"]) ++ + cc_library( + name = "delimited_message_util", + srcs = ["delimited_message_util.cc"],