Skip to content

Ship only one copy of libyamlstar in Python wheels - #18

Open
edgarrmondragon wants to merge 1 commit into
yaml:mainfrom
edgarrmondragon:python-wheel-single-lib
Open

edgarrmondragon wants to merge 1 commit into
yaml:mainfrom
edgarrmondragon:python-wheel-single-lib

Conversation

@edgarrmondragon

@edgarrmondragon edgarrmondragon commented Dec 2, 2026 •

Copy link
Copy Markdown

The binding only loads the unversioned libyamlstar.so / .dylib (_candidate_filenames in yamlstar/__init__.py), but cp -pL turned the versioned symlinks from the build and release archives into full copies inside each Linux and macOS wheel.

Nothing needs the versioned names:

  • the Linux .so has no SONAME
  • the macOS install name is libyamlstar.dylib
  • util/yamlstar-plugin and the binding never reference them

Wheels rebuilt with make -C python wheels-from-release from the v0.1.28 release archives:

Wheel PyPI 0.1.28 Rebuilt
macosx_14_0_arm64 12.1 MB 6.1 MB
macosx_15_0_x86_64 13.6 MB 6.8 MB
manylinux_2_31_x86_64 14.1 MB 7.1 MB
manylinux_2_31_aarch64 none yet (#16) 6.2 MB
win_amd64 6.9 MB 6.9 MB (unchanged)
  • Each rebuilt wheel contains exactly one libyamlstar.* file.
  • YAMLStar().load('a: [1, {b: c}]') passes on macOS arm64, macOS x86_64 (Rosetta) and Linux aarch64 (glibc 2.31).
  • The x86_64 libyamlstar.so is byte-identical to the one in the PyPI wheel (SHA-256 6ac068ffed1c807d...).

This should probably be merged before #17 to ensure the manylinux aarch64 wheel is not bloated.

The binding only loads the unversioned `libyamlstar.so` / `.dylib` (`_candidate_filenames` in `yamlstar/__init__.py`), but `cp -pL` turned the versioned symlinks from the build and release archives into full copies inside each Linux and macOS wheel.

Nothing needs the versioned names:

- the Linux `.so` has no `SONAME`
- the macOS install name is `libyamlstar.dylib`
- `util/yamlstar-plugin` and the binding never reference them

Wheels rebuilt with `make -C python wheels-from-release` from the `v0.1.28` release archives:

| Wheel                 | PyPI 0.1.28 | Rebuilt |
|-----------------------|-------------|---------|
| `macosx_14_0_arm64`   | 12.1 MB     | 6.1 MB  |
| `macosx_15_0_x86_64`  | 13.6 MB     | 6.8 MB  |
| `manylinux_2_31_x86_64` | 14.1 MB   | 7.1 MB  |
| `manylinux_2_31_aarch64` | none yet (yaml#16) | 6.2 MB  |
| `win_amd64`           | 6.9 MB      | 6.9 MB (unchanged) |

- Each rebuilt wheel contains exactly one `libyamlstar.*` file.
- `YAMLStar().load('a: [1, {b: c}]')` passes on macOS arm64, macOS x86_64 (Rosetta) and Linux aarch64 (glibc 2.31).
- The x86_64 `libyamlstar.so` is byte-identical to the one in the PyPI wheel (SHA-256 `6ac068ffed1c807d...`).

Signed-off-by: Edgar Ramírez-Mondragón <[email protected]>
@edgarrmondragon
edgarrmondragon marked this pull request as ready for review December 2, 2026 18:25
@edgarrmondragon edgarrmondragon changed the title Ship one copy of libyamlstar in Python wheels Ship only one copy of libyamlstar in Python wheels Dec 2, 2026
@ingydotnet

Copy link
Copy Markdown
Member

@edgarrmondragon Thanks. I'll try to incorporate all this in the next release of YAMLStar.

This branch has not been deployed

No deployments
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.

2 participants