Skip to content

Shrink MvtStyle 15x, stop tracking build products, 0.1.1 - #3

Merged
wf9a5m75 merged 4 commits into
mainfrom
fix/style-ffi-staticlib-only
Oct 27, 2026
Merged

wf9a5m75 merged 4 commits into
mainfrom
fix/style-ffi-staticlib-only

Conversation

@wf9a5m75

Copy link
Copy Markdown
Contributor

The iOS style compiler was 14 MB a slice

MvtStyle.xcframework.zip in v0.1.0 is 10 MB, while MvtRender is 4 MB.

  • Cause: mvt-style-ffi declared crate-type = ["staticlib", "rlib"]. With an rlib alongside the staticlib, rustc does not run LTO for the static library. libmvt_style_ffi.a therefore kept std, core and the crate as separate objects, each with its LLVM bitcode still embedded (5 MB in std alone).
  • Fix: nothing depends on the rlib, so the crate is now staticlib only.
before (v0.1.0) after
archive members 403 375 (same as MvtRender / TilePng)
ios-arm64 slice 14,353,376 B 945,976 B
  • cargo test -p mvt-style-ffi passes: 5 tests.
  • All four mvt_style_* functions in mvt_style.h are still exported.

The bitcode does not reach an app binary, but it is what SDK users download.

Stop tracking the native build products

The android core / style jniLibs and the ios-core / ios-style xcframeworks and lib/ were committed. The SDKs now take these from a release, so the committed copies only drift: every local build overwrites them, and the committed MvtStyle already differed from v0.1.0. They are untracked and gitignored, like bindings/ios/MvtRender.xcframework already was.

0.1.1

The Cargo workspace, bindings/js and bindings/js-style versions move together, as release.yml checks.

With "rlib" alongside "staticlib", rustc cannot run LTO for the static
library, so libmvt_style_ffi.a carried std, core and the crate as
separate objects with their LLVM bitcode embedded: 14 MB a slice, 10 MB
zipped in the v0.1.0 release. Nothing depends on the rlib. As a
staticlib only it is 0.94 MB a slice, like MvtRender and TilePng, and
exports the same four mvt_style_* functions.
The SDKs now take these from a release. A copy here is overwritten by
every local build, and already disagreed with what v0.1.0 shipped.
react-sdk no longer has vectorstyle/ and vectortile/ workspaces
(MapConductor/react-sdk#25): react-vectorstyle and react-vectortile
unpack a release into their own vendor/. sync-sdk.sh now copies a local
build there and stamps it as local, so the next plain fetch puts the
pinned release back.
@wf9a5m75

Copy link
Copy Markdown
Contributor Author

Added: sync-sdk.sh now copies the web builds into react-sdk/react-{vectorstyle,vectortile}/vendor/, to match MapConductor/react-sdk#25. The old react-sdk/vectorstyle / vectortile workspaces are gone. The iOS and Android copies already land where the split modules look for a local build (a gitignored *.xcframework next to Package.swift, and src/main/jniLibs).

@wf9a5m75
wf9a5m75 merged commit 032c1cd into main Oct 27, 2026
3 checks passed
@wf9a5m75
wf9a5m75 deleted the fix/style-ffi-staticlib-only branch October 27, 2026 08:49
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