Skip to content

Build dm-tree against Python 3.13#123

Merged
copybara-service[bot] merged 1 commit intogoogle-deepmind:masterfrom
daskol:build/py313
Jan 23, 2025
Merged

Build dm-tree against Python 3.13#123
copybara-service[bot] merged 1 commit intogoogle-deepmind:masterfrom
daskol:build/py313

Conversation

@daskol
Copy link
Contributor

@daskol daskol commented Jan 16, 2025

Resolve #119.

The original issue is caused by missing include of cstdint in gcc14 stdlib (see abseil/abseil-cpp#1187). In this PR, abseil is updated to the minimal version with the missing include. Other changes fix handling of -j option and revise build matrix.

Also, it turns out that Ninja Multi-Config build is broken.

@daskol daskol marked this pull request as ready for review January 16, 2025 00:24
@daskol
Copy link
Contributor Author

daskol commented Jan 16, 2025

@superbobry Take a look at this pull request which is concurrent with #120.

@daskol
Copy link
Contributor Author

daskol commented Jan 16, 2025

@superbobry Trigger build once again please. It turns out that actions/upload-artifact@v2 has been deprecated and is not available anymore (relevant #122).

@daskol
Copy link
Contributor Author

daskol commented Jan 17, 2025

@superbobry Now, I have tested CI workflows beforehand in my fork (see this run as an example).

It turns out that manual specification of link dependencies does not behave well. I have replaced ExternalProject with FetchContent and bumped CMake up to 3.24 in order to build with system pybind11 or abseil-cpp if needed. Thus pybind11 and abseil-cpp are handled in the similar way now.

Also, I have replaced GIT with URL in order to eliminate an implicit dependency on git. Some users, e.g. CI in google-deepmind/chex#375, can fallback on building from sdist. In this case, package installation will additionally require git. In fact, we could eliminate yet another one dependency which is cmake. We could move it to build-system according to PEP-517/518. Then only one natural dependency on C++ compiler would remain (but it is out of scope this PR).

In workflow declaration, I have replaced multiple per-architecture wheel building jobs with a single build matrix on target platform (operating system) and added py3.13 threaded (cp313t) although it is unclear to me whether it works correctly in free-threading mode.

BTW The commit with FetchContent occasionally fixed multi-config build with Ninja. This is aligned with CI failure and missing symbols in resulting binaries.

@daskol
Copy link
Contributor Author

daskol commented Jan 21, 2025

@superbobry Trigger pipeline once again. It should be working now.

@superbobry
Copy link
Collaborator

Sorry for the silence and thank you for working on this @daskol. Trying now.

@superbobry
Copy link
Collaborator

Can you squash the commit please? Our import bot can't do that automatically yet, sadly.

Squashed commit history is the following.

- Bump `abseil-cpp` to fix building issue

  See abseil/abseil-cpp#1187 for details.
- Build with vendored `abseil-cpp` by default
- Forward number of jobs options as is
- Actualize build matrix of Python interpreters
- Bump `actions/upload-artifact` up to v4.6.0
- Build all wheels within single matrix job
- Use `FetchContent` module to manage external dependencies
@daskol
Copy link
Contributor Author

daskol commented Jan 22, 2025

Sorry, this is probably because of "Allow edits and access to secrets by maintainers" checkbox but I'm not sure. I ticked it right now and squashed commits anyway.

copybara-service bot pushed a commit that referenced this pull request Jan 23, 2025
FUTURE_COPYBARA_INTEGRATE_REVIEW=#123 from daskol:build/py313 367a6f0
PiperOrigin-RevId: 718762075
@copybara-service copybara-service bot mentioned this pull request Jan 23, 2025
copybara-service bot pushed a commit that referenced this pull request Jan 23, 2025
FUTURE_COPYBARA_INTEGRATE_REVIEW=#123 from daskol:build/py313 367a6f0
PiperOrigin-RevId: 718762075
Comment on lines +54 to +57
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.22.0
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse

Choose a reason for hiding this comment

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

Use GitHub Action which can be managed by dependabot.

Suggested change
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.22.0
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
- name: Build wheels
uses: pypa/cibuildwheel@v2.22

copybara-service bot pushed a commit that referenced this pull request Jan 23, 2025
FUTURE_COPYBARA_INTEGRATE_REVIEW=#123 from daskol:build/py313 367a6f0
PiperOrigin-RevId: 718762075
@copybara-service copybara-service bot merged commit c2c3660 into google-deepmind:master Jan 23, 2025
5 of 6 checks passed
@daskol daskol deleted the build/py313 branch January 23, 2025 10:48
@daskol
Copy link
Contributor Author

daskol commented Jan 23, 2025

@superbobry Thank you for your time and effort! Are you planning on publishing new release on GitHub or PyPI?

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.

Build failure on Python 3.13

3 participants