Skip to content

Commit

Permalink
cocotb: use hermetic python
Browse files Browse the repository at this point in the history
Signed-off-by: Pawel Czarnecki <[email protected]>
  • Loading branch information
lpawelcz committed Oct 19, 2023
1 parent c3f696c commit 557031f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cocotb/cocotb.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,12 @@ def _get_test_command(ctx, verilog_files, vhdl_files):
seed_args = " --seed {}".format(ctx.attr.seed) if ctx.attr.seed != "" else ""

test_module_args = _pymodules_to_argstring(ctx.files.test_module, "test_module")
python_interpreter = ctx.toolchains["@bazel_tools//tools/python:toolchain_type"].py3_runtime.interpreter.path

command = (
"PATH={}:$PATH ".format(_get_path_to_set(ctx)) +
"python {}".format(ctx.executable.cocotb_wrapper.short_path) +
"{}".format(python_interpreter) +
" {}".format(ctx.executable.cocotb_wrapper.short_path) +
" --sim {}".format(ctx.attr.sim_name) +
" --hdl_library {}".format(ctx.attr.hdl_library) +
" --hdl_toplevel {}".format(ctx.attr.hdl_toplevel) +
Expand Down

0 comments on commit 557031f

Please sign in to comment.