Skip to content

Comments

python: Add pypi package infrastructure to bazel#8336

Merged
maliberty merged 15 commits intoThe-OpenROAD-Project:masterfrom
QuantamHD:python_siwg
Sep 17, 2025
Merged

python: Add pypi package infrastructure to bazel#8336
maliberty merged 15 commits intoThe-OpenROAD-Project:masterfrom
QuantamHD:python_siwg

Conversation

@QuantamHD
Copy link
Collaborator

There is now infrastructure to build python wheels that we could upload to pypi. This rule can be built with

bazelisk build -c opt --features=thin_lto //openroad:openroad_wheel

This is a precursor to removing the -python option from the OpenROAD binary, and adopting a more standard pypi distribution.

This will require CI changes to build the wheel on manylinux Docker images.

Signed-off-by: Ethan Mahintorabi ethanmoon@google.com

maliberty and others added 4 commits September 10, 2025 21:43
Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
There is now infrastructure to build python wheels
that we could upload to pypi. This rule can be built
with `bazelisk build -c opt --features=thin_lto //openroad:openroad_wheel`.

This is a precursor to removing the -python option from the OpenROAD
binary, and adopting a more standard pypi distribution.

This will require CI changes to build the wheel on manylinux Docker
images.

Signed-off-by: Ethan Mahintorabi <ethanmoon@google.com>
@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@maliberty
Copy link
Member

@vvbandeira please review/comment re:
This will require CI changes to build the wheel on manylinux Docker images.

@maliberty
Copy link
Member

Is --features=thin_lto required?

@QuantamHD
Copy link
Collaborator Author

It's not required, but it helps with wheel size a lot. By default pypi caps each wheel at 100MB, and we're 345MB without LTO+Opt and 45MB with LTO+Opt. I can try to see what it's like with just opt.

@donn
Copy link
Contributor

donn commented Sep 15, 2025

Hi Ethan, could I ask you to run this CI on GitHub so arm64 and macOS wheels are built as well?

Here's the runner info:

https://github.com/YosysHQ/yosys/blob/09742e27f797cba49dacca1cdbebd546d9d782c3/.github/workflows/wheels.yml#L14

@maliberty
Copy link
Member

We do not support mac as we have no hardware on which to debug issues. Our CI runs on Jenkins/GCP not GHA so I don't see that request as possible.

@donn
Copy link
Contributor

donn commented Sep 15, 2025

Then I would kindly ask you to leave the embedded interpreter as-is. Or at least a setup.py/pyproject.toml to independently build the requisite wheels outside of Bazel.

Signed-off-by: Ethan Mahintorabi <ethanmoon@google.com>
Signed-off-by: Ethan Mahintorabi <ethanmoon@google.com>
@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Signed-off-by: Ethan Mahintorabi <ethanmoon@google.com>
@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@maliberty
Copy link
Member

If you (@donn) can do all the bring up and support to get it going we will take the changes. Mac remains a best-effort platform and I can't guarantee resources to work on it.

We will not gate the move to Bazel on mac support and may remove -python when Linux platforms are working.

@donn
Copy link
Contributor

donn commented Sep 16, 2025

Is the long-term plan to move all building to Bazel?

Signed-off-by: Ethan Mahintorabi <ethanmoon@google.com>
@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@QuantamHD
Copy link
Collaborator Author

Yes, we're going to drop cmake as soon as we're able. Python being the last major hurtle

Signed-off-by: Ethan Mahintorabi <ethanmoon@google.com>
@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Signed-off-by: Ethan Mahintorabi <ethanmoon@google.com>
@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Signed-off-by: Ethan Mahintorabi <ethanmoon@google.com>
@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@gadfort
Copy link
Collaborator

gadfort commented Sep 16, 2025

It's not required, but it helps with wheel size a lot. By default pypi caps each wheel at 100MB, and we're 345MB without LTO+Opt and 45MB with LTO+Opt. I can try to see what it's like with just opt.

they also cap projects at 10GB (you can request more), so that would get used up fairly quickly. @QuantamHD at what interval would you be expecting it be uploaded?

@QuantamHD
Copy link
Collaborator Author

QuantamHD commented Sep 16, 2025

Google is a PSF sponsor so I think we could get that bumped pretty easily. I'm imagining weekly or perhaps once every 2 weeks. Even at the 10GB limit we're looking at about 4 years of weekly releases or 8 years of twice a month releases.

Signed-off-by: Ethan Mahintorabi <ethanmoon@google.com>
@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@maliberty
Copy link
Member

I'm surprised LTO shrinks the size that much. How does it impact build time?

@QuantamHD
Copy link
Collaborator Author

I'm surprised LTO shrinks the size that much. How does it impact build time?

Maybe 30 seconds?

Signed-off-by: Ethan Mahintorabi <ethanmoon@google.com>
@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@oharboe
Copy link
Collaborator

oharboe commented Sep 17, 2025

🥳

@QuantamHD
Copy link
Collaborator Author

@maliberty This is good to go as is. I think there's a bit more work in setting up the CI, but I would like to do that in a separate PR.

@maliberty maliberty merged commit 4596638 into The-OpenROAD-Project:master Sep 17, 2025
11 checks passed
@QuantamHD QuantamHD deleted the python_siwg branch September 18, 2025 06:57
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.

6 participants