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 <[email protected]>
  • Loading branch information
fviernau committed Jul 3, 2024
1 parent 81af6f8 commit 254f05a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 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,16 @@ 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,
environment = environment.toMutableMap().apply {
// Disable the optional wrapper script under `tools/bazel`, to ensure the --version option works.
put("BAZELISK_SKIP_WRAPPER", "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 254f05a

Please sign in to comment.