Skip to content
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

wheels: fix missing yosys-abc/share directory #4643

Merged
merged 1 commit into from
Oct 9, 2024
Merged

Conversation

donn
Copy link
Contributor

@donn donn commented Oct 9, 2024

What are the reasons/motivation for this change?

Due to an oversight on my part, #4534 does not copy either yosys-abc or the share directory. While Yosys technically still runs, it is unusable for anything non-trivial.

Explain how this is achieved.

  • misc/__init__.py:
    • checks if there's a yosys-abc in the same directory - if yes, sets the variable sys._pyosys_abc
    • checks if there's a share in the same directory - if yes, sets the variable sys._pyosys_share_dirname
  • yosys.cc::init_share_dirname: check for sys._pyosys_share_dirname at the highest priority if Python is enabled
  • yosys.cc::init_abc_executable_name: check for sys._pyosys_abc, use it at at the highest priority if Python is enabled
  • Makefile: add new target, share, to only create the extra targets
  • setup.py: compile libyosys.so, yosys-abc and share, and copy them all as part of the pyosys build
  • test/arch/ecp5/add_sub.py: ported add_sub.ys to Python to act as a test for the share directory and abc with Python wheels, used in CI

If applicable, please suggest to reviewers how they can test the change.

pip install -i https://test.pypi.org/simple/ pyosys==0.46.0

@donn donn changed the title wheels: fix missing share/yosys-abc directories wheels: fix missing yosys-abc/share directory Oct 9, 2024
* `misc/__init__.py`:
  * checks if there's a `yosys-abc` in the same directory - if yes, sets the variable `sys._pyosys_abc`
  * checks if there's a `share` in the same directory - if yes, sets the variable `sys._pyosys_share_dirname`
* `yosys.cc::init_share_dirname`: check for `sys._pyosys_share_dirname`, use it at the highest priority if Python is enabled
* `yosys.cc::init_abc_executable_name`: check for `sys._pyosys_abc`, use it at at the highest priority if Python is enabled
* `Makefile`: add new target, `share`, to only create the extra targets
* `setup.py`: compile libyosys.so, yosys-abc and share, and copy them all as part of the pyosys build
* `test/arch/ecp5/add_sub.py`: ported `add_sub.ys` to Python to act as a test for the share directory and abc with Python wheels, used in CI
@donn donn marked this pull request as ready for review October 9, 2024 15:29
@donn donn requested a review from mmicko as a code owner October 9, 2024 15:29
Copy link
Member

@mmicko mmicko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Synth passes works as expected now on isolated environment. Thanks

@mmicko mmicko merged commit ecec156 into YosysHQ:main Oct 9, 2024
24 checks passed
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.

2 participants