Skip to content

Isolate universal2 artifact-combination logic#572

Open
jakelishman wants to merge 1 commit intoPyO3:mainfrom
jakelishman:isolate-universal2
Open

Isolate universal2 artifact-combination logic#572
jakelishman wants to merge 1 commit intoPyO3:mainfrom
jakelishman:isolate-universal2

Conversation

@jakelishman
Copy link

@jakelishman jakelishman commented Feb 17, 2026

The combination of the multiple build artifacts into one universal2-compatible artifact is now done as part of the general artifact-path handling, which means we no longer have to sort out the configuration environment twice for the same system, and we no longer rely on cargo returning information about the built artifacts in the same order between two separate compilations.

Beyond the immediate benefit of isolating the "create binary artifacts" logic into only a single place, this commit is intended to be a refactor along the path towards support for extracting non-binary artifacts that are side-effects of particular RustExtension's build scripts.


This supersedes #571, and is a step towards #563 as mentioned (spiritually) in #563 (comment).

I haven't added any new tests here since it isn't new behaviour, though I couldn't immediately see that the tests in the repo already cover the universal2 case. If there's a good way to add them, I can.

I tested it myself locally to verify it produces universal2 artifacts, and it at least managed to import the resulting object on my ARM Mac (and it's about the right size, and the object functions, etc).

The changes are larger-scale than might be expected because I had to refactor several places of target detection to account for a build process that doesn't necessarily just have a single target triple.

The combination of the multiple build artifacts into one
universal2-compatible artifact is now done as part of the general
artifact-path handling, which means we no longer have to sort out the
configuration environment twice for the same system, and we no longer
rely on `cargo` returning information about the built artifacts in the
same order between two separate compilations.

Beyond the immediate benefit of isolating the "create binary artifacts"
logic into only a single place, this commit is intended to be a refactor
along the path towards support for extracting non-binary artifacts that
are side-effects of particular `RustExtension`'s build scripts.
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.

1 participant