Skip to content

Remove bundled openfhe from PyPI wheel#3058

Merged
copybara-service[bot] merged 1 commit into
google:mainfrom
j2kun:stop-shipping-openfhe
Jun 22, 2026
Merged

Remove bundled openfhe from PyPI wheel#3058
copybara-service[bot] merged 1 commit into
google:mainfrom
j2kun:stop-shipping-openfhe

Conversation

@j2kun

@j2kun j2kun commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

This change modifies the PyPI distribution of HEIR to no longer build and ship OpenFHE. The user must now provide a self-provided OpenFHE installation (shared libs and heaers) via environment variables.

As a consequence, we updated the CI to:

  1. Not run frontend tests in bazel
  2. After the main bazel build/test, add new steps that install openfhe, pip install -e ., and runs pytest to evaluate the frontend tests outside of bazel.

I also discovered that more recent manylinux containers have a sanctioned clang, so I updated the cibuildwheel container to use 2_34. We may be able to go back to supporting 2_28 after the hermetic LLVM lands, because I believe they have hermetic glibc that you can pick explicitly.

part of #3047

@j2kun j2kun changed the title Remove bundled openfhe from PYPI wheel Remove bundled openfhe from PyPI wheel Jun 11, 2026
@j2kun j2kun added ci:wheels and removed ci:wheels labels Jun 11, 2026
@j2kun j2kun force-pushed the stop-shipping-openfhe branch from e4d730d to c165d8c Compare June 12, 2026 18:56
@j2kun j2kun added ci:wheels and removed ci:wheels labels Jun 12, 2026
@j2kun j2kun force-pushed the stop-shipping-openfhe branch from 212f8de to a6c741a Compare June 13, 2026 01:37
@j2kun j2kun added ci:wheels and removed ci:wheels labels Jun 13, 2026
@j2kun j2kun added ci:wheels and removed ci:wheels labels Jun 15, 2026
@j2kun j2kun added ci:wheels and removed ci:wheels labels Jun 15, 2026
@j2kun

j2kun commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator Author

Miraculously, it works. I will give this code a bit of a cleanup tomorrow and then we can merge it in, which unblocks hermetic LLVM (and buildbuddy)

@j2kun j2kun force-pushed the stop-shipping-openfhe branch from 4388391 to f0de467 Compare June 17, 2026 19:16
@j2kun j2kun requested review from AlexanderViand and removed request for AlexanderViand June 17, 2026 19:20
@j2kun j2kun force-pushed the stop-shipping-openfhe branch 2 times, most recently from 4fdf13a to 38f07ff Compare June 17, 2026 21:22
@j2kun j2kun added ci:wheels and removed ci:wheels labels Jun 17, 2026
@j2kun j2kun requested a review from AlexanderViand June 17, 2026 23:20
@j2kun

j2kun commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator Author

@AlexanderViand this should be ready now.

@j2kun j2kun force-pushed the stop-shipping-openfhe branch from 1797de5 to cebb498 Compare June 17, 2026 23:31
if "openfhe" in name and not any(
x in name for x in ["core", "pke", "binfhe"]
):
return [str(p.resolve())]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

do we want to return a list of all the possible resolved p's? (core, pke, and binfhe)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done

This change modifies the PyPI distribution of HEIR to no longer build
and ship OpenFHE. The user must now provide a self-provided OpenFHE
installation (shared libs and heaers) via environment variables.

As a consequence, we updated the CI to:

1. Not run frontend tests in bazel
2. After the main bazel build/test, add new steps that install openfhe,
   `pip install -e .`, and runs `pytest` to evaluate the frontend
   tests outside of bazel.

I also discovered that more recent manylinux containers have
a sanctioned clang, so I updated the cibuildwheel container to use
2_34. We may be able to go back to supporting 2_28 after the hermetic
LLVM lands, because I believe they have hermetic glibc that you can
pick explicitly.
@j2kun j2kun force-pushed the stop-shipping-openfhe branch from cebb498 to e59bbc1 Compare June 18, 2026 21:44
@j2kun j2kun added the pull_ready Indicates whether a PR is ready to pull. The copybara worker will import for internal testing label Jun 18, 2026
@AlexanderViand AlexanderViand removed the pull_ready Indicates whether a PR is ready to pull. The copybara worker will import for internal testing label Jun 19, 2026

@AlexanderViand AlexanderViand left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Sorry to be annoying about this, but can we avoid bumping minimum python from 3.10 to 3.11 again? This is a strong preference of the xdsl folks and wasn't hard to achieve in the past.

Comment thread pyproject.toml
description = "The HEIR compiler"
readme = "README.md"
requires-python = ">=3.10"
requires-python = ">=3.11"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Do we really need this version bump?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Ah, I did that because we didn't actually test 3.10 or build any 3.10 wheels. I can put it back on Monday with a proper build.

Comment thread pyproject.toml
"torch>=2.8.0",
"setuptools>=80.9.0",
"cibuildwheel>=3.0.0",
"cibuildwheel>=4.0.0",

@AlexanderViand AlexanderViand Jun 19, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
"cibuildwheel>=4.0.0",
"cibuildwheel>=4.0.0" ; python_version >= '3.11'",

cibuildhweel 3+ does need python 3.11+ but since it's not a core dependency we can just gate it away.
(and maybe specify cibuildwheel>=2.0.0 ; python_version < 3.11 but I don't think that's even necessary

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Can't you use a newer cibuildwheel but build for an older python? I don't think there's a conflict here.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

You can build for really old target versions, but the package itself still requires a relatively new version to run on

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

So this suggestion is purely about making sure uv sync doesn't error on 3.10

if sys.version_info >= (3, 11):
from typing import TypeVarTuple, Unpack
else:
# TypeVarTuple/Unpack landed in typing in 3.11; use the backport on 3.10.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why drop the 3.10 compatibility shim here?

@copybara-service copybara-service Bot merged commit 4520067 into google:main Jun 22, 2026
28 checks passed
@j2kun

j2kun commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator Author

This got merged just as I was getting into work. I'll push another fix restoring 3.10

@j2kun

j2kun commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator Author

It may also be worth noting that Python 3.10 is EOL this October (about 4 months away), so the xdsl folks should consider upgrading.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants