iOS: bspatch integration - #44
Conversation
da09fff to
0985b83
Compare
0985b83 to
53c4592
Compare
There was a problem hiding this comment.
Pull request overview
Introduces a shared native BSDIFF40 patching implementation intended for iOS and Android, with an iOS unit-test target and CI coverage.
Changes:
- Moves the HDiffPatch bridge and vendored sources into shared directories.
- Adds iOS patch fixtures, unit tests, project configuration, and CI execution.
- Updates Android to consume the shared implementation.
Reviewed changes
Copilot reviewed 19 out of 39 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
shared/third_party/README.md |
Documents vendored HDiffPatch sources. |
shared/third_party/hdiffpatch/LICENSE |
Adds upstream licenses. |
shared/third_party/hdiffpatch/libHDiffPatch/HPatch/patch.h |
Adds patch API declarations. |
shared/third_party/hdiffpatch/libHDiffPatch/HPatch/patch.c |
Adds core patch implementation. |
shared/third_party/hdiffpatch/libHDiffPatch/HPatch/patch_types.h |
Adds patch types and stream interfaces. |
shared/third_party/hdiffpatch/libHDiffPatch/HPatch/patch_private.h |
Adds internal patch helpers. |
shared/third_party/hdiffpatch/libHDiffPatch/HPatch/hpatch_mt/hpatch_mt.h |
Adds multithreading interfaces. |
shared/third_party/hdiffpatch/libHDiffPatch/HPatch/checksum_plugin.h |
Adds checksum plugin API. |
shared/third_party/hdiffpatch/file_for_patch.h |
Adds file-stream declarations. |
shared/third_party/hdiffpatch/file_for_patch.c |
Adds file-stream implementation. |
shared/third_party/hdiffpatch/dirDiffPatch/dir_patch/dir_patch_types.h |
Adds directory patch types. |
shared/third_party/hdiffpatch/decompress_plugin_demo.h |
Adds bzip2 decompression support. |
shared/third_party/hdiffpatch/bsdiff_wrapper/bspatch_wrapper.h |
Declares BSDIFF40 patch APIs. |
shared/third_party/hdiffpatch/bsdiff_wrapper/bspatch_wrapper.c |
Implements BSDIFF40 patch application. |
shared/diffpatch/bspatch_bridge.h |
Defines the shared patch bridge API. |
shared/diffpatch/bspatch_bridge.c |
Implements bridge resource and error handling. |
package.json |
Adds native unit-test scripts. |
ios/CodePushDiffPatchTests/Fixtures/wrong_old/old.dat |
Adds mismatched-base fixture. |
ios/CodePushDiffPatchTests/Fixtures/identical/old.dat |
Adds identical-input fixture. |
ios/CodePushDiffPatchTests/Fixtures/identical/new.dat |
Adds identical-output fixture. |
ios/CodePushDiffPatchTests/Fixtures/identical/patch.bsdiff |
Adds identical-data patch fixture. |
ios/CodePushDiffPatchTests/Fixtures/empty_old/old.dat |
Adds empty-base fixture. |
ios/CodePushDiffPatchTests/Fixtures/empty_old/new.dat |
Adds expected literal output. |
ios/CodePushDiffPatchTests/Fixtures/empty_old/patch.bsdiff |
Adds empty-base patch fixture. |
ios/CodePushDiffPatchTests/Fixtures/basic/old.dat |
Adds ordinary base fixture. |
ios/CodePushDiffPatchTests/Fixtures/basic/new.dat |
Adds ordinary expected output. |
ios/CodePushDiffPatchTests/Fixtures/basic/patch.bsdiff |
Adds ordinary patch fixture. |
ios/CodePushDiffPatchTests/Fixtures/bad_header/old.dat |
Adds invalid-header base fixture. |
ios/CodePushDiffPatchTests/Fixtures/bad_header/patch.bsdiff |
Adds malformed patch fixture. |
ios/CodePushDiffPatchTests/DiffPatchTests-Bridging-Header.h |
Exposes the C bridge to Swift tests. |
ios/CodePushDiffPatchTests/BSPatchTests.swift |
Tests patch success and failures. |
ios/CodePush.xcodeproj/xcshareddata/xcschemes/CodePushTests.xcscheme |
Adds the shared test scheme. |
ios/CodePush.xcodeproj/project.pbxproj |
Configures the iOS test target. |
CLAUDE.md |
Documents native unit testing. |
android/app/src/main/java/com/microsoft/codepush/react/diffpatch/DiffPatch.kt |
Updates the bridge path reference. |
android/app/src/main/cpp/third_party/README.md |
Points to shared vendored sources. |
android/app/src/main/cpp/CMakeLists.txt |
Builds Android against shared sources. |
.npmignore |
Excludes iOS test sources from publishing. |
.github/workflows/ci-test.yml |
Runs iOS unit tests and reduces duplicate Android tests. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| 47F66D5AF3C3185E1A3E3B15 /* bspatch_bridge.c in Sources */, | ||
| DC983F1C71E0E7131BB343C5 /* libHDiffPatch/HPatch/patch.c in Sources */, | ||
| A88F11124A2120A8373A8B61 /* bsdiff_wrapper/bspatch_wrapper.c in Sources */, | ||
| 0ABCB5DEFE01A7A15552A498 /* file_for_patch.c in Sources */, |
There was a problem hiding this comment.
This xcodeproj is really ancient and has all sorts of problems. The CodePush target doesn't even compile (missing RN headers). We'll fix this one day, but the important thing for this PR is that the tests are buildable and runnable.
| 13BE3DEC1AC21097009241FE /* CodePush.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CodePush.h; path = CodePush/CodePush.h; sourceTree = "<group>"; }; | ||
| 13BE3DED1AC21097009241FE /* CodePush.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CodePush.m; path = CodePush/CodePush.m; sourceTree = "<group>"; }; | ||
| 1B23B9131BF9267B000BB2F0 /* RCTConvert+CodePushInstallMode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "RCTConvert+CodePushInstallMode.m"; path = "CodePush/RCTConvert+CodePushInstallMode.m"; sourceTree = "<group>"; }; | ||
| 1B5F6957BD953EE17AF6B18C /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS26.0.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; |
There was a problem hiding this comment.
Fixed, turns out it wasn't even necessary to link Foundation.framework -> removed.
83c8db3 to
5c775f5
Compare
5c775f5 to
9da1028
Compare
9da1028 to
fd52e3c
Compare
fd52e3c to
56e4ed4
Compare
56e4ed4 to
552c47d
Compare
8d8890f to
d18b97f
Compare
d18b97f to
2b0e976
Compare
2b0e976 to
1dd0e18
Compare
1dd0e18 to
58deb74
Compare
58deb74 to
8de36a5
Compare
Context
iOS side of #40: set up tooling and build systems to integrate the
hdiffpatchlibrary and ourbspatch_bridgewrapper.No business logic in this PR, that's in #48.
Summary of changes
./shared/: the vendoredhdiffpatchlibrary and our thinbspatch_bridgefrom Android: bspatch integration #40 moves to the shared dir. The vendoredbzip2lib remains at./androidas iOS links against the system library (-lbz2)CMakeLists.txtfrom the Android side.applyPatch()directly frombspatch_bridge.h. The same test cases as in Android: bspatch integration #40CodePush.xcodeprojgets a new test target to run those tests.package.jsontask for each, and run the new iOS unit tests in CI.