From 0288b72cf6c8df7b545dbc29fdb0b471df6e3d80 Mon Sep 17 00:00:00 2001 From: Vsevolod Tolstopyatov Date: Mon, 5 Jun 2023 12:49:29 +0200 Subject: [PATCH] Update BlockHound version to be compatible with JDK 17 (#3771) * Also, exclude integration from docs, it shouldn't be there Fixes #3701 --- gradle.properties | 5 +---- kotlinx-coroutines-debug/README.md | 2 +- kotlinx-coroutines-debug/build.gradle | 7 +++++++ .../src/CoroutinesBlockHoundIntegration.kt | 5 ++++- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/gradle.properties b/gradle.properties index 296c43cd4e..075f05aa67 100644 --- a/gradle.properties +++ b/gradle.properties @@ -24,7 +24,7 @@ javafx_version=17.0.2 javafx_plugin_version=0.0.8 binary_compatibility_validator_version=0.12.0 kover_version=0.7.0-Beta -blockhound_version=1.0.2.RELEASE +blockhound_version=1.0.8.RELEASE jna_version=5.9.0 # Android versions @@ -49,9 +49,6 @@ jsdom_global_version=3.0.2 kotlin.incremental.multiplatform=true kotlin.native.ignoreDisabledTargets=true -# Site generation -jekyll_version=4.0 - # JS IR backend sometimes crashes with out-of-memory # TODO: Remove once KT-37187 is fixed org.gradle.jvmargs=-Xmx3g diff --git a/kotlinx-coroutines-debug/README.md b/kotlinx-coroutines-debug/README.md index a5dcc76253..2fe2eaacb0 100644 --- a/kotlinx-coroutines-debug/README.md +++ b/kotlinx-coroutines-debug/README.md @@ -16,7 +16,7 @@ of coroutines hierarchy referenced by a [Job] or [CoroutineScope] instances usin This module also provides an automatic [BlockHound](https://github.com/reactor/BlockHound) integration that detects when a blocking operation was called in a coroutine context that prohibits it. In order to use it, please follow the BlockHound [quick start guide]( -https://github.com/reactor/BlockHound/blob/1.0.2.RELEASE/docs/quick_start.md). +https://github.com/reactor/BlockHound/blob/1.0.8.RELEASE/docs/quick_start.md). ### Using in your project diff --git a/kotlinx-coroutines-debug/build.gradle b/kotlinx-coroutines-debug/build.gradle index 340c1d21dc..42d0b8d0f0 100644 --- a/kotlinx-coroutines-debug/build.gradle +++ b/kotlinx-coroutines-debug/build.gradle @@ -33,6 +33,13 @@ java { disableAutoTargetJvm() } +// This is required for BlockHound tests to work, see https://github.com/Kotlin/kotlinx.coroutines/issues/3701 +tasks.withType(Test).configureEach { + if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_13)) { + jvmArgs += ["-XX:+AllowRedefinitionToAddDeleteMethods"] + } +} + jar { setEnabled(false) } diff --git a/kotlinx-coroutines-debug/src/CoroutinesBlockHoundIntegration.kt b/kotlinx-coroutines-debug/src/CoroutinesBlockHoundIntegration.kt index 06f702861b..99f2b190ba 100644 --- a/kotlinx-coroutines-debug/src/CoroutinesBlockHoundIntegration.kt +++ b/kotlinx-coroutines-debug/src/CoroutinesBlockHoundIntegration.kt @@ -1,5 +1,5 @@ /* - * Copyright 2016-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. + * Copyright 2016-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. */ @file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER") @@ -10,6 +10,9 @@ import kotlinx.coroutines.scheduling.* import reactor.blockhound.* import reactor.blockhound.integration.* +/** + * @suppress + */ public class CoroutinesBlockHoundIntegration : BlockHoundIntegration { override fun applyTo(builder: BlockHound.Builder): Unit = with(builder) {