Bug 2433881 - usd fails to build with Python 3.15: /builddir/build/BUILD/usd-25.11-build/OpenUSD-25.11/pxr/base/tf/pyIdentity.cpp:139:16: error: ‘PyWeakref_GetObject’ was not declared in this scope; did you mean ‘PyWeakref_GetRef’?
Summary: usd fails to build with Python 3.15: /builddir/build/BUILD/usd-25.11-build/Op...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: usd
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Luya Tshimbalanga
QA Contact:
URL:
Whiteboard:
: 2486005 (view as bug list)
Depends On:
Blocks: PYTHON3.15 F45FTBFS F45FailsToInstall 2502858
TreeView+ depends on / blocked
 
Reported: 2026-01-28 14:42 UTC by Karolina Surma
Modified: 2026-07-31 06:38 UTC (History)
10 users (show)

Fixed In Version: usd-26.08-2.fc45
Clone Of:
Environment:
Last Closed: 2026-07-31 06:38:23 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Replace PyWeakref_GetObject with PyWeakref_GetRef (4.23 KB, patch)
2026-07-28 08:46 UTC, Miro Hrončok
no flags Details | Diff
Fix TBB version detection (for tbb 2023) (2.80 KB, patch)
2026-07-28 08:48 UTC, Miro Hrončok
no flags Details | Diff
Revised patch (4.70 KB, application/mbox)
2026-07-29 22:27 UTC, Luya Tshimbalanga
no flags Details
Version of the suggested patch that actually applies to v26.08 (4.44 KB, text/plain)
2026-07-30 08:30 UTC, Ben Beasley
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github PixarAnimationStudios OpenUSD issues 3966 0 None open PyWeakref_GetObject removed in Python 3.15 2026-01-28 15:04:24 UTC

Description Karolina Surma 2026-01-28 14:42:32 UTC
usd fails to build with Python 3.15.0a5.

/builddir/build/BUILD/usd-25.11-build/OpenUSD-25.11/pxr/base/tf/pyIdentity.cpp: In member function ‘PyObject* pxrInternal_v0_25_11__pxrReserved__::Tf_PyIdHandle::Ptr() const’:
/builddir/build/BUILD/usd-25.11-build/OpenUSD-25.11/pxr/base/tf/pyIdentity.cpp:139:16: error: ‘PyWeakref_GetObject’ was not declared in this scope; did you mean ‘PyWeakref_GetRef’?
  139 |         return PyWeakref_GetObject(_weakRef);
      |                ^~~~~~~~~~~~~~~~~~~
      |                PyWeakref_GetRef

https://docs.python.org/3.15/whatsnew/3.15.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.15/fedora-rawhide-x86_64/10071420-usd/

For all our attempts to build usd with Python 3.15, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.15/package/usd/

Testing and mass rebuild of packages is happening in copr.
You can follow these instructions to test locally in mock if your package builds with Python 3.15:
https://copr.fedorainfracloud.org/coprs/g/python/python3.15/

Let us know here if you have any questions.

Python 3.15 is planned to be included in Fedora 45.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.15.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires),
so if this package is required a lot, it's important for us to get it fixed soon.

We'd appreciate help from the people who know this package best,
but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Ben Beasley 2026-01-28 15:04:25 UTC
Reported upstream in https://github.com/PixarAnimationStudios/OpenUSD/issues/3966.

Comment 2 Karolina Surma 2026-06-06 18:26:02 UTC
*** Bug 2486005 has been marked as a duplicate of this bug. ***

Comment 3 Ben Beasley 2026-06-07 05:53:00 UTC
I’m personally not currently planning to attempt a patch for this. What would otherwise be a rather straightforward change to switch from PyWeakref_GetrRef to PyWeakref_GetRef and adjust the reference counting to deal with a strong refereence rather than a borrowed one is clouded by the involvement of (a fork of) boost::python. I would have to read a lot of undocumented Boost code to make sure I got the reference-counting right, and I’m just not up for it.

(There is more compatibility trouble down the road, particularly https://github.com/PixarAnimationStudios/OpenUSD/issues/4078 with OneTBB 2023.)

Comment 4 Fedora Fails To Install 2026-06-14 07:12:14 UTC
Hello,

Please note that this comment was generated automatically by https://forge.fedoraproject.org/releng/tooling/src/branch/main/release-process/bug-filing/follow-policy/follow_policy.py
If you feel that this output has mistakes, please open an issue at https://forge.fedoraproject.org/releng/tickets/issues

This package fails to install and maintainers are advised to take one of the following actions:

 - Fix this bug and close this bugzilla once the update makes it to the repository.
   (The same script that posted this comment will eventually close this bugzilla
   when the fixed package reaches the repository, so you don't have to worry about it.)

or

 - Move this bug to ASSIGNED if you plan on fixing this, but simply haven't done so yet.

or

 - Orphan the package if you no longer plan to maintain it.


If you do not take one of these actions, the process at https://docs.fedoraproject.org/en-US/fesco/Fails_to_build_from_source_Fails_to_install/#_package_removal_for_long_standing_ftbfs_and_fti_bugs will continue.
This package may be orphaned in 7+ weeks.
This is the first reminder (step 3) from the policy.

Don't hesitate to ask for help on https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/ if you are unsure how to fix this bug.

Comment 5 Fedora Fails To Install 2026-07-05 20:24:49 UTC
Hello,

Please note that this comment was generated automatically by https://forge.fedoraproject.org/releng/tooling/src/branch/main/release-process/bug-filing/follow-policy/follow_policy.py
If you feel that this output has mistakes, please open an issue at https://forge.fedoraproject.org/releng/tickets/issues

This package fails to install and maintainers are advised to take one of the following actions:

 - Fix this bug and close this bugzilla once the update makes it to the repository.
   (The same script that posted this comment will eventually close this bugzilla
   when the fixed package reaches the repository, so you don't have to worry about it.)

or

 - Move this bug to ASSIGNED if you plan on fixing this, but simply haven't done so yet.

or

 - Orphan the package if you no longer plan to maintain it.


If you do not take one of these actions, the process at https://docs.fedoraproject.org/en-US/fesco/Fails_to_build_from_source_Fails_to_install/#_package_removal_for_long_standing_ftbfs_and_fti_bugs will continue.
This package may be orphaned in 4+ weeks.
This is the second reminder (step 4) from the policy.

Don't hesitate to ask for help on https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/ if you are unsure how to fix this bug.

Comment 6 Luya Tshimbalanga 2026-07-07 01:48:13 UTC
In this case, it will be great for Python team addressing this complex issue which is very much outside on my skills. Let's set to assign for now.

Comment 7 Luya Tshimbalanga 2026-07-14 23:10:10 UTC
Version 26.08 is expected to come on July 20. We will test it when released.

Comment 8 Luya Tshimbalanga 2026-07-25 16:08:21 UTC
Add a blocker. Patch welcome for this package.

Comment 9 Miro Hrončok 2026-07-26 13:03:32 UTC
Sorry for the confusion. The bz2506751 tracker is for packages that were rebuilt with previous Python 3.15 versions and now need to be rebuilt for the ABI change. This package still needs to be built with Python 3.15 and is tracked in bz2412434.

Comment 10 Miro Hrončok 2026-07-28 08:45:58 UTC
So, I was able to make this build with 2 patches I am going to attach.

The patches were LLM-generated, and I do not currently have the capacity to thoroughly review them or perform some real tests. From a real shallow point of view, they seem plausible.

The package builds with them (except for occasional OOM). However, I am not confident enough to offer the Python 3.15 patch upstream as is (the other is a backport of sorts), nor to send this as a Fedora downstream PR. If you review the patches, feel free to use them at your own risk.

Comment 11 Miro Hrončok 2026-07-28 08:46:34 UTC
Created attachment 2152808 [details]
Replace PyWeakref_GetObject with PyWeakref_GetRef

Comment 12 Miro Hrončok 2026-07-28 08:48:59 UTC
Created attachment 2152809 [details]
Fix TBB version detection (for tbb 2023)

Comment 13 Luya Tshimbalanga 2026-07-28 16:16:06 UTC
(In reply to Miro Hrončok from comment #12)
> Created attachment 2152809 [details]
> Fix TBB version detection (for tbb 2023)

This patch is unnecessary as upstream fixed with version 26.08. The new updated package is under evaluation with patch from #11.

Comment 14 Luya Tshimbalanga 2026-07-28 23:33:25 UTC
@(In reply to Ben Beasley from comment #3)
> I’m personally not currently planning to attempt a patch for this. What
> would otherwise be a rather straightforward change to switch from
> PyWeakref_GetrRef to PyWeakref_GetRef and adjust the reference counting to
> deal with a strong refereence rather than a borrowed one is clouded by the
> involvement of (a fork of) boost::python. I would have to read a lot of
> undocumented Boost code to make sure I got the reference-counting right, and
> I’m just not up for it.
> 
> (There is more compatibility trouble down the road, particularly
> https://github.com/PixarAnimationStudios/OpenUSD/issues/4078 with OneTBB
> 2023.)

Version 26.08 rcently got released addressing the fix related to OneTBB 2023. With some modifications of the provided patch from comment#11, the build is successful.
Would you mind reviewing the modified patch assisted with DeepSeek tool from this scratch build: https://copr.fedorainfracloud.org/coprs/g/designsuite/blender/build/10785508/ ? If everything is well, we can send the patch to upstream while pushing only for Rawhide and the incoming Fedora 45 branch.

Comment 15 Luya Tshimbalanga 2026-07-29 22:27:17 UTC
Created attachment 2153004 [details]
Revised patch

For review, here is the updated patch keeping the original behaviour in pxr/base/tf/pyIdentity.cpp (Tf_PyIdHandle::Ptr)

Comment 16 Ben Beasley 2026-07-30 08:29:46 UTC
(In reply to Luya Tshimbalanga from comment #15)
> Created attachment 2153004 [details]
> Revised patch
> 
> For review, here is the updated patch keeping the original behaviour in
> pxr/base/tf/pyIdentity.cpp (Tf_PyIdHandle::Ptr)

Hmm, I find that this doesn’t apply directly (the patch is allegedly corrupt or ill-formed), but I was able to manually rebase it on the v26.08 tag in a git checkout. I’ll attach the modified version below, and I’m testing it in a local mock build.

I don’t have the capacity to do meaningful interactive testing of this package, and I don’t have the intimate familiarity with Boost Python and with this package’s source code that would be required to do a proper review. Assuming my build finishes successfully, I suppose we can apply this patch as a stopgap since the alternative is not having usd at all until upstream ships a version with Python 3.15 support, but I can’t vouch for the patch’s correctness.

Comment 17 Ben Beasley 2026-07-30 08:30:45 UTC
Created attachment 2153030 [details]
Version of the suggested patch that actually applies to v26.08

Comment 18 Ben Beasley 2026-07-30 08:41:02 UTC
As a compromise, given the caveats in https://bugzilla.redhat.com/show_bug.cgi?id=2433881#c10, I mentioned the existence of a patch upstream in https://github.com/PixarAnimationStudios/OpenUSD/issues/3966#issuecomment-5128542913 and linked this discussion, but I didn’t attach the patch to the issue or open a PR.

Comment 20 Luya Tshimbalanga 2026-07-30 23:43:36 UTC
The build was successful and the pull request is merged. You can build when ready.

Comment 21 Fedora Update System 2026-07-31 06:34:15 UTC
FEDORA-2026-d2b0ab9a73 (usd-26.08-2.fc45) has been submitted as an update to Fedora 45.
https://bodhi.fedoraproject.org/updates/FEDORA-2026-d2b0ab9a73

Comment 22 Fedora Update System 2026-07-31 06:38:23 UTC
FEDORA-2026-d2b0ab9a73 (usd-26.08-2.fc45) has been pushed to the Fedora 45 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.