-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use hermetic python #240
Use hermetic python #240
Conversation
I'm not sure what is causing the CI failures and I don't have the access to the logs. @proppy, @QuantamHD could you please paste those for me? |
|
f9c7107
to
17db21c
Compare
Remove cpython toolchain and embedded_python_interpreter. Use provided hermetic python interpreter from rules_python instead Signed-off-by: Pawel Czarnecki <pczarnecki@antmicro.com>
Signed-off-by: Pawel Czarnecki <pczarnecki@antmicro.com>
Signed-off-by: Pawel Czarnecki <pczarnecki@antmicro.com>
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't we be using:
toolchain="@rules_python//python:current_py_toolchain"
and
${PYTHON3}
as recommended in https://rules-python.readthedocs.io/en/latest/getting-started.html#toolchain-usage-in-other-rules ?
@@ -81,6 +82,7 @@ def _gds_write_impl(ctx): | |||
gds_allow_empty_args + | |||
" --out {}".format(final_gds.path), | |||
tools = depset([ctx.executable._gds_write]), | |||
toolchain = "//python:current_py_toolchain", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't we be using:
toolchain="@rules_python//python:current_py_toolchain"
as recommended in https://rules-python.readthedocs.io/en/latest/getting-started.html#toolchain-usage-in-other-rules ?
Fixes #209
This PR removes
cpython toolchain
andembedded_python_interpreter
. It replaces those with python interpreter taken from rules_python which is a proper way of handling hermetic python toolchain.Additional modifications take into account explicit calls to python in rules like
cocotb
orgds_write
.Those modifications are also required to allow the usage of
gds_write
rule in XLS repository (see google/xls#1031)CC @proppy