lowRISC / lowRISC/opentitan

[Python Package] Python dependency errors when using bazel - possible Solution

Open
#27,363 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
SystemVerilog
Stars
3.6k
Forks
1.1k
Avg merge
2d 22h
Merged PRs (30d)
141

Description

### Description

We’re encountering an issue with bazel, specifically with ot_python dependencies, when working on a newly cloned OpenTitan repo. The issue can be also be replicated after a bazel clean --expunge command on the current working repo. see also https://github.com/lowRISC/opentitan/issues/24028

The screenshot of the error is attached for reference.

![Image](https://github.com/user-attachments/assets/e5097ec9-33a5-4392-8cd1-58de9c14a821)

**Ways to re-create the error:**

1. Create a new clone of OpenTitan.
2. Checkout to one of the production branches.
3. Run any bazel command.

**Temporary Fixes that we have discovered so far:**

1. Run _**bazel info output_base**_ to get the actual HASH of the repo.
2. Copy the attached .py files (wheel and bazel), which are present here as .txt files because of github reasons, to ~/.cache/bazel/_bazel_//external/rules_python/python/pip_in stall/extract_wheels/lib/

[bazel.txt](https://github.com/user-attachments/files/20607589/bazel.txt)
[wheel.txt](https://github.com/user-attachments/files/20607588/wheel.txt)

The respective files are from an older version which do not raise this error. It is to be noted that this is a temporary fix since the .cache folder could be deleted.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the dependency error on a fresh OpenTitan clone or after `bazel clean --expunge`, following the listed production-branch steps. Compare the attached `bazel.txt` and `wheel.txt` files with the versions under the Bazel cache, and consider the issue resolved when a normal Bazel command works without manually copying cached files.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.