Platform specific (multi-OS) extensions and wheels #74
Labels
No Label
Priority
Critical
Priority
High
Priority
Low
Priority
Normal
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
Type
Breaking
Type
Documentation
Type
Enhancement
Type
Feature
Type
Report
Type
Security
Type
Suggestion
Type
Testing
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: infrastructure/extensions-website#74
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Multi-OS (add-ons) extensions
Guiding principles:
They are two main reasons an extension may be OS specific:
In both cases this is indicated by the new
plaforms
manifest field.Manifest:
windows-amd64
,windows-arm64
,macos-x86_64
,macos-arm64
,linux-x86_64
Extensions package
To reduce the bandwith required to download extensions, the server can generate multiple platform-specific package from one uploaded package. The uploaded package is always a single .zip package containing the dependencies of all supported platforms. The server will then split the uploaded package into platform specific packages, with only the dependencies relevant to that platform.
Uploaded package:
Server-generated windows-amd64 package:
Server-generated macos-x86_64 package:
Tasks:
Handle OS-specific wheel package generation (can be done after everything else).Support multiple uploads per versionI think it is beneficial to adopt the notation defined in https://packaging.python.org/en/latest/specifications/platform-compatibility-tags/#platform-tag (takes over from https://peps.python.org/pep-0425/#platform-tag and uses the same rules): using underscores in the platform tag.
Unfortunately the docs don't provide a comprehensive list of platform tags and the spec document is not comprehensive enough, but we can also look at the popular wheel distributions compliant with the spec, e.g. https://pypi.org/project/Cython/#files and https://pypi.org/project/numpy/#files
We can also consult with packaging tests: https://github.com/pypa/packaging/blob/main/tests/test_tags.py
The windows tags then become:
win_amd64
,win_arm64
(couldn't easily find those in the wild and don't see blender releases available for windows arm)Linux: the spec differentiates between manylinux and musllinux, making
linux_x86_64
insufficient for a general case, but later in the same doc useslinux_x86_64
in examples. Not sure if we need to differentiate here, this also depends on how blender will be selecting wheels during installation. See also https://peps.python.org/pep-0600/MacOS: is also not uniform, you can find
macosx_11_0_arm64
andmacosx_10_9_x86_64
(and other ones, see the test)We have a choice to ignore the packaging spec for the
platforms
field and use whatever blender can produce as its platform tag, but I think that having consistency across our platform tags and wheel names is important - it leaves less room for surprises, when a wrong wheel may be picked during installation; and I would expect that wheels will be built by standard tooling, leading to the names complying with the spec.I updated the schema on the documentation already to include the
platforms
field:Summary of a chat with @ideasman42 and @dfelinto (please correct if I missed anything)
platforms
field won't be practicalThese points support the decision to use a simplified tag, such as
linux-x86_64
,macos-arm64
, etc (see the docs)Also it's important to note that the
platforms
field may be used to mark platform-specific code in the packaged code that doesn't ship any wheels at all, this is a reason to not rely on just thewheels
field in the manifest.Deployed #131 in production.
Repackaging is not implemented for now.
In addition to the initial support of multi-platform single-file uploads we want to start supporting multiple files per Version.
This allows to avoid unnecessary large file sizes for extensions that include their dependencies for all supported platforms.
Instead of implementing the logic for splitting uploaded files into multiple downloadable files ourselves, we will give control to maintainers, allowing them to prepare packages that will be shipped to end-users as is.
This approach has other benefits as well:
see also https://devtalk.blender.org/t/2024-06-14-extensions-platform/35136
@Oleg-Komarov for the records, Blender already has the -c extension build --split-platforms, which uses
[build.generated]
. So it is up to the server now to support[build.generated]
.[build.generated]
is now supported in productionClosing this. The main parts are in already, and the remaining tasks will be implemented as part of: #194