[rez] Separate packages for 64-bit and 32-bit Python

92 views
Skip to first unread message

Marcus Ottosson

unread,
May 23, 2019, 6:04:19 AM5/23/19
to rez-c...@googlegroups.com

Hi all,

So far I’ve only dealt with packages that support both 64- and 32-bit, pure-Python packages. But for anything compiled, it’ll only ever be compatible with just one of them.

I figure I could use a separate version for each..

~/packages/PySide/python-2.7.14.x64
~/packages/PySide/python-2.7.14.x32

..but suspect there’s a better way, possibly involving variants, as I expect the same issue to also apply to 32-bit Maya’s and anything else with a matching plug-in ecosystem.

~/packages/PySide/python-2/__?__/PySide/__init__.py

How are you dealing with this at the moment?

Best,
Marcus

Joseph Yu

unread,
May 23, 2019, 6:50:14 AM5/23/19
to rez-config
Yep, I would probably approach it with the "arch" variant. e.g.

# Top of package.py file
from rez.system import system as __system__  # Hide it so it does not get picked up as a package attribute

variants
= [['python-2', 'arch-{sys.arch}'.format(sys=__system__)]]  # Current system architecture


In the default config, the "arch" is an implicit package requirement so the right one should get picked up by your current system.
The "arch" package is typically created by "rez bind --quickstart" during the initial setup process.
Just watch out for any custom platform mappings!

Marcus Ottosson

unread,
May 23, 2019, 6:56:01 AM5/23/19
to rez-c...@googlegroups.com
But, does that really work if my system is 64-bit and my Python interpreter is 32-bit? :O

--
You received this message because you are subscribed to the Google Groups "rez-config" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rez-config+...@googlegroups.com.
To post to this group, send email to rez-c...@googlegroups.com.
Visit this group at https://groups.google.com/group/rez-config.
To view this discussion on the web visit https://groups.google.com/d/msgid/rez-config/266bb7f3-5e6e-435f-afb7-39b1396b27d3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Joseph Yu

unread,
May 23, 2019, 9:53:28 AM5/23/19
to rez-config
Oh I see. For that, I'm not sure at the moment. If I understand correctly:
  1. System is 64 bit
  2. Python is built both 64 and 32 bit
  3. PySide (or some package) is build both 64 and 32 bit
Goal: (Explicitly?) grab 32 bit PySide, which should grab 32 bit Python, for the current 64 bit system?

I wonder if having a "32 or 64 bit" request will work? Something like:

rez env 'pyside' 'python' 'arch-x86|x86_64'

My thinking is that the resolve procedure will prioritise 32 bit first before going for 64 bit but I've never done this myself.

On Thursday, 23 May 2019 11:56:01 UTC+1, Marcus Ottosson wrote:
But, does that really work if my system is 64-bit and my Python interpreter is 32-bit? :O

On Thu, 23 May 2019 at 11:50, Joseph Yu <jose...@wwfx.co.uk> wrote:
Yep, I would probably approach it with the "arch" variant. e.g.

# Top of package.py file
from rez.system import system as __system__  # Hide it so it does not get picked up as a package attribute

variants
= [['python-2', 'arch-{sys.arch}'.format(sys=__system__)]]  # Current system architecture


In the default config, the "arch" is an implicit package requirement so the right one should get picked up by your current system.
The "arch" package is typically created by "rez bind --quickstart" during the initial setup process.
Just watch out for any custom platform mappings!


On Thursday, 23 May 2019 11:04:19 UTC+1, Marcus Ottosson wrote:

Hi all,

So far I’ve only dealt with packages that support both 64- and 32-bit, pure-Python packages. But for anything compiled, it’ll only ever be compatible with just one of them.

I figure I could use a separate version for each..

~/packages/PySide/python-2.7.14.x64
~/packages/PySide/python-2.7.14.x32

..but suspect there’s a better way, possibly involving variants, as I expect the same issue to also apply to 32-bit Maya’s and anything else with a matching plug-in ecosystem.

~/packages/PySide/python-2/__?__/PySide/__init__.py

How are you dealing with this at the moment?

Best,
Marcus

--
You received this message because you are subscribed to the Google Groups "rez-config" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rez-c...@googlegroups.com.

Marcus Ottosson

unread,
May 23, 2019, 10:19:04 AM5/23/19
to rez-c...@googlegroups.com

My thinking is that the resolve procedure will prioritise 32 bit first before going for 64 bit but I’ve never done this myself

I think this would try and reference the system-wide value of arch, e.g. AMD64, rather than reference anything related to the Python package?

However, I think I see where I’ve gone wrong.

My python package is referencing the system-wide install, and on some systems that install is 32-bit (despite the system itself being 64-bit). The Rez-way of solving this would be to just not reference system-packages, and instead explicitly host python amongst other packages in your repository. That way you know that in order to install/build PySide, you would need to use this exact Python, which in turn would be compatible with the result. And everyone’s happy.

This would work in this case and is probably how I will approach this from now on.

But what about packages that don’t lend themselves for packaging this way, like Maya and Blender? Packages that should probably reference system-paths rather than try and bundle it alongside the package.py? My reason for referencing system Python rather than packaging it is the same as why I wouldn’t try and package Maya - performance.

It’s as if there’s a missing component in the level of specificity we’re able to provide.

  • name
  • version
  • variant
  • architecture (x64 or x86) (missing?)

On second thought; how should the python package referencing a system Python indicate whether that install is 32- or 64-bit? :/ I probably need to think this through a bit more!


To unsubscribe from this group and stop receiving emails from it, send an email to rez-config+...@googlegroups.com.

To post to this group, send email to rez-c...@googlegroups.com.
Visit this group at https://groups.google.com/group/rez-config.
Reply all
Reply to author
Forward
0 new messages