Repository navigation
[hotfix] Fix onnxruntime build failure on macOS x86_64 - #525
Conversation
|
@alnzng Please add the following content to your PR description and select a checkbox: |
|
@wenjin272 Can you help take a look this PR? |
|
This PR has the dependency on this PR: #526 |
| "anthropic>=0.64.0", | ||
| "chromadb==1.0.21", | ||
| "onnxruntime<1.24.1;python_version<'3.11'", | ||
| "onnxruntime>=1.24.1;python_version>='3.11'", |
There was a problem hiding this comment.
Actually, I didn't add onnxruntime>=1.24.1 for python 3.11 initially, but I found for python 3.11 in macOS & arm, uv will also use onnxruntime==1.23.2, even if onnxruntime==1.24.1 is available. So I finally add a minimum version requirement for onnxruntime in python 3.11.
But the minimum version requirement indeed break the build in macos & x86_64. Do you have any good solutions?
There was a problem hiding this comment.
uv will also use onnxruntime==1.23.2, even if onnxruntime==1.24.1 is available.
@wenjin272 Did you notice this in your local env or CI? Have you tried to remove .env folder and uv lock to start with a fresh build?
I currently don't have ARM version Python installed on my (Company)laptop, I can check if installing ARM version Python is accpetable in my side.
There was a problem hiding this comment.
It looks like all CI passed without this onnxruntime issue, seems we are good?
The current failed CI test seems to be not related to this change, it failed in maven test phrase: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.5.2:test (default-test) on project flink-agents-end-to-end-tests-resource-cross-language:
There was a problem hiding this comment.
uv will also use onnxruntime==1.23.2, even if onnxruntime==1.24.1 is available.
@wenjin272 Did you notice this in your local env or CI? Have you tried to remove
.envfolder and uv lock to start with a fresh build?I currently don't have ARM version Python installed on my (Company)laptop, I can check if installing ARM version Python is accpetable in my side.
I noticed this both in my local env and CI, even if I remove the uv lock or try uv sync --upgrade.
For example, in ut test for python 3.11 on macos for this pr: https://github.com/apache/flink-agents/actions/runs/21851853229/job/63068025146?pr=525, the installed onnxruntime is 1.23.2

It actually won't cause any failure, but may be unexpected.
There was a problem hiding this comment.
It actually won't cause any failure, but may be unexpected.
@wenjin272 You are right on onnxruntime==1.23.2 is automatically resolved and picked up by uv. I think this is because of uv's universal resolver no longer needs to fork based on current constraints:
- Python <3.11: onnxruntime<1.24.1 (from pyproject.toml)
- Python >=3.11: onnxruntime with no version pin (from chromadb)
Since 1.23.2 satisfies both, uv unifies on a single version rather than forking. I would say this is expected from uv perspective, and the version 1.23.2 should work well with all Python versions we supported today.
Note: that the root cause here is upstream: chromadb declares https://github.com/chroma-core/chroma/blob/main/pyproject.toml#L10 with no upper bound and no platform markers. This means chromadb is unaware that newer onnxruntime releases may drop support for certain platforms (like macOS x86_64 in 1.24.1). Ideally, chromadb should handle this with appropriate version bounds or environment markers so that downstream projects don't need to independently work around these compatibility gaps.
I don't see a hard blocker that we had to to remove the support on macOS x86_64. That said, I think we should continue to support macOS x86_64. There are still users(like us internally) replies on the builds from macOS x86_64.
@wenjin272 @xintongsong WDYT?
There was a problem hiding this comment.
Thanks for the nice discussion. Here are my two cents.
- We should definitely support both x86 and arm on macos
- IIUC, the two objective constraints that we need to strictly follow:
- onnxruntime 1.24.1 does not support python 3.10
- onnxruntime 1.24.1 does not support x86 on macos
- There's no strong demand for using onnxruntime 1.24.1+ on python 3.11
Based on these, I think the changes @alnzng proposed in this PR make sense. WDYT, @wenjin272?
There was a problem hiding this comment.
Thanks for the nice discussion. Here are my two cents.
- We should definitely support both x86 and arm on macos
- IIUC, the two objective constraints that we need to strictly follow:
- onnxruntime 1.24.1 does not support python 3.10
- onnxruntime 1.24.1 does not support x86 on macos
- There's no strong demand for using onnxruntime 1.24.1+ on python 3.11
Based on these, I think the changes @alnzng proposed in this PR make sense. WDYT, @wenjin272?
make sense
092910b to
4f0367b
Compare
|
Ported to release-0.2 in dc81f79 |
Linked issue: #xxx
Purpose of change
Recently we added
onnxruntime>=1.24.1requirement for Python 3.11+, butonnxruntimedropped macOS x86_64 wheel support since1.24.1(release notes).This cause build failure when Python 3.11+ is built for x86_64:
Since
onnxruntimeis transitive dependency fromchromadb, I think no need to pin minimum version. We can just letchromadbpull the compatible version.Changes:
onnxruntime>=1.24.1floor for Python 3.11required-environmentsfromdarwin + arm64todarwinsouv lockconsider all macOSarchitecture
uv lockstep in build script beforeuv syncto make sure lockfile is regeneratedTests
Run
./tools/build.shon MacOS laptopAPI
N / A
Documentation
doc-neededdoc-not-neededdoc-included