Skip to content

Commit

Permalink
fix(bazel): Always disable the wrapper script
Browse files Browse the repository at this point in the history
Fixes #8828.

Signed-off-by: Frank Viernau <frank_viernau@epam.com>
  • Loading branch information
fviernau authored and sschuberth committed Jul 3, 2024
1 parent 17ff138 commit 6aaa408
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions plugins/package-managers/bazel/src/main/kotlin/Bazel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ import org.ossreviewtoolkit.model.config.AnalyzerConfiguration
import org.ossreviewtoolkit.model.config.RepositoryConfiguration
import org.ossreviewtoolkit.model.orEmpty
import org.ossreviewtoolkit.utils.common.CommandLineTool
import org.ossreviewtoolkit.utils.common.ProcessCapture
import org.ossreviewtoolkit.utils.common.collectMessages
import org.ossreviewtoolkit.utils.common.encodeHex
import org.ossreviewtoolkit.utils.common.withoutPrefix
Expand Down Expand Up @@ -77,6 +78,14 @@ class Bazel(

override fun command(workingDir: File?) = "bazel"

override fun run(vararg args: CharSequence, workingDir: File?, environment: Map<String, String>): ProcessCapture =
super.run(
args = args,
workingDir = workingDir,
// Disable the optional wrapper script under `tools/bazel`, to ensure the --version option works.
environment = environment + mapOf("BAZELISK_SKIP_WRAPPER" to "true")
)

override fun transformVersion(output: String) = output.removePrefix("bazel ")

// Bazel 6.0 already supports bzlmod but it is not enabled by default.
Expand Down

0 comments on commit 6aaa408

Please sign in to comment.