Skip to content

Conversation

@code-perspective
Copy link
Owner

WIP
This pull request updates the WORKSPACE file to address dependency management issues and improve repository initialization. The key changes include adding support for Python rules, loading additional dependencies, and reordering initialization calls to resolve errors.

Dependency Management Enhancements:

  • Added rules_python to the WORKSPACE file to resolve an AttributeError related to pkgutil.ImpImporter. This includes specifying the version and SHA256 checksum for the Python rules archive.
  • Loaded additional dependencies using grpc_extra_deps and xls_pip_install_deps to address missing package errors related to @xls_pip_deps_markupsafe.

…grpc_extra_deps and xls_pip_install_deps for corresponding errors mentioned in the comment
@code-perspective
Copy link
Owner Author

Still running into a similar error which (I think) needs python 3.11 version. because pkgutil was removed from python 3.12

ERROR: /usr/local/google/home/gshruthi/.cache/bazel/_bazel_gshruthi/88459525e83498a4c011792c2bbba5c6/external/com_google_xls/xls/ir/BUILD:808:10: @com_google_xls//xls/ir:render_specification_against_template depends on @xls_pip_deps_jinja2//:pkg in repository @xls_pip_deps_jinja2 which failed to fetch. no such package '@xls_pip_deps_jinja2//': whl_library xls_pip_deps_jinja2 failed: (Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in _run_code
File "/usr/local/google/home/gshruthi/.cache/bazel/_bazel_gshruthi/88459525e83498a4c011792c2bbba5c6/external/rules_python/python/pip_install/tools/wheel_installer/wheel_installer.py", line 32, in
from python.pip_install.tools.wheel_installer import namespace_pkgs, wheel
File "/usr/local/google/home/gshruthi/.cache/bazel/_bazel_gshruthi/88459525e83498a4c011792c2bbba5c6/external/rules_python/python/pip_install/tools/wheel_installer/wheel.py", line 20, in
import pkg_resources
File "/usr/local/google/home/gshruthi/.cache/bazel/_bazel_gshruthi/88459525e83498a4c011792c2bbba5c6/external/pypi__setuptools/pkg_resources/init.py", line 2178, in
register_finder(pkgutil.ImpImporter, find_on_path)
^^^^^^^^^^^^^^^^^^^
AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?

@code-perspective
Copy link
Owner Author

Ted's patches to get xls to build after adding as external dependency seems to work! https://github.com/ted-xie/xls_as_external_dep/tree/main

bazel run //transpiler/examples/simple_sum:simple_sum_cleartext_testbench works

changes in commit b62bbbb

@code-perspective
Copy link
Owner Author

bazel run //transpiler/examples/simple_sum:simple_sum_interpreted_openfhe_testbench causes a linker error

ERROR: /usr/local/google/home/gshruthi/projects/fully-homomorphic-encryption/transpiler/examples/simple_sum/BUILD:95:10: Linking transpiler/examples/simple_sum/simple_sum_interpreted_openfhe_testbench failed: (Exit 1): cc_wrapper.sh failed: error executing CppLink command (from target //transpiler/examples/simple_sum:simple_sum_interpreted_openfhe_testbench) external/toolchains_llvm~~llvm~llvm_toolchain/bin/cc_wrapper.sh @bazel-out/k8-opt/bin/transpiler/examples/simple_sum/simple_sum_interpreted_openfhe_testbench-2.params

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
ld.lld: error: undefined symbol: lbcrypto::BinFHEContext::EvalBinGate(lbcrypto::BINGATE, std::__1::shared_ptr<lbcrypto::LWECiphertextImpl const> const&, std::__1::shared_ptr<lbcrypto::LWECiphertextImpl const> const&, bool) const
>>> referenced by openfhe_runner.cc
>>>               bazel-out/k8-opt/bin/transpiler/_objs/openfhe_runner/openfhe_runner.pic.o:(fully_homomorphic_encryption::transpiler::OpenFheRunner::OpenFheOperations::And(std::__1::shared_ptr<lbcrypto::LWECiphertextImpl>, std::__1::shared_ptr<lbcrypto::LWECiphertextImpl>))
>>> referenced by openfhe_runner.cc
>>>               bazel-out/k8-opt/bin/transpiler/_objs/openfhe_runner/openfhe_runner.pic.o:(fully_homomorphic_encryption::transpiler::OpenFheRunner::OpenFheOperations::Or(std::__1::shared_ptr<lbcrypto::LWECiphertextImpl>, std::__1::shared_ptr<lbcrypto::LWECiphertextImpl>))

@code-perspective
Copy link
Owner Author

Yosys also seems to break:
Building: bazel build transpiler/examples/ifte:ifte_tfhe_netlist

Throws this error:

ERROR: One of the output paths 'bazel-out/k8-opt-exec-ST-d57f47055a04/bin/external/abc/abc' (belonging to @@abc//:abc) and 'bazel-out/k8-opt-exec-ST-d57f47055a04/bin/external/abc/abc/bin/abc' (belonging to @@abc//:abc) is a prefix of the other. These actions cannot be simultaneously present; please rename one of the output files or build just one of them
ERROR: One of the output paths 'bazel-out/k8-opt-exec-ST-d57f47055a04/bin/external/yosys/yosys' (belonging to @@yosys//:yosys) and 'bazel-out/k8-opt-exec-ST-d57f47055a04/bin/external/yosys/yosys/bin/yosys' (belonging to @@yosys//:yosys) is a prefix of the other. These actions cannot be simultaneously present; please rename one of the output files or build just one of them
Target //transpiler/examples/ifte:ifte_tfhe_netlist failed to build
Use --verbose_failures to see the command lines of failed build steps.
ERROR: com.google.devtools.build.lib.actions.ArtifactPrefixConflictException: One of the output paths 'bazel-out/k8-opt-exec-ST-d57f47055a04/bin/external/yosys/yosys' (belonging to @@yosys//:yosys) and 'bazel-out/k8-opt-exec-ST-d57f47055a04/bin/external/yosys/yosys/bin/yosys' (belonging to @@yosys//:yosys) is a prefix of the other. These actions cannot be simultaneously present; please rename one of the output files or build just one of them

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant