Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions src/codechecker.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ load(
)
load(
"common.bzl",
"python_path",
"python_toolchain_type",
"version_specific_attributes",
)
Expand Down Expand Up @@ -104,7 +103,6 @@ def _codechecker_impl(ctx):
substitutions = {
"{Mode}": "Run",
"{Verbosity}": "DEBUG",
"{PythonPath}": python_path(ctx), # "/usr/bin/env python3",
"{codechecker_bin}": CODECHECKER_BIN_PATH,
"{compile_commands}": ctx.outputs.codechecker_commands.path,
"{codechecker_skipfile}": ctx.outputs.codechecker_skipfile.path,
Expand Down Expand Up @@ -233,7 +231,6 @@ def _codechecker_test_impl(ctx):
substitutions = {
"{Mode}": "Test",
"{Verbosity}": "INFO",
"{PythonPath}": python_path(ctx), # "/usr/bin/env python3",
"{codechecker_bin}": CODECHECKER_BIN_PATH,
"{codechecker_files}": codechecker_files.short_path,
"{Severities}": " ".join(ctx.attr.severities),
Expand Down
2 changes: 1 addition & 1 deletion src/codechecker_script.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!{PythonPath}
#!/usr/bin/env python3

# Copyright 2023 Ericsson AB
#
Expand Down
17 changes: 0 additions & 17 deletions src/common.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -50,23 +50,6 @@ def python_toolchain_type():
return "@bazel_tools//tools/python:toolchain_type"
return "@rules_python//python:toolchain_type"

def python_path(ctx):
"""
Returns version specific Python path
"""
py_toolchain = ctx.toolchains[python_toolchain_type()]
if hasattr(py_toolchain, "py3_runtime_info"):
py_runtime_info = py_toolchain.py3_runtime_info
python_path = py_runtime_info.interpreter
elif hasattr(py_toolchain, "py3_runtime"):
py_runtime = py_toolchain.py3_runtime
python_path = py_runtime.interpreter_path
else:
fail("The resolved Python toolchain does not provide a Python3 runtime.")
if not python_path:
fail("The resolved Python toolchain does not provide a Python3 interpreter.")
return python_path

def warning(ctx, msg):
"""
Prints message if the debug tag is enabled.
Expand Down
1 change: 0 additions & 1 deletion src/per_file.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ def _create_wrapper_script(ctx, options, compile_commands_json, config_file):
output = ctx.outputs.per_file_script,
is_executable = True,
substitutions = {
"{PythonPath}": ctx.attr._python_runtime[PyRuntimeInfo].interpreter_path,
"{compile_commands_json}": compile_commands_json.path,
"{codechecker_args}": options_str,
"{config_file}": config_file.path,
Expand Down
2 changes: 1 addition & 1 deletion src/per_file_script.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!{PythonPath}
#!/usr/bin/env python3

# Copyright 2023 Ericsson AB
#
Expand Down
Loading