Skip to content

iOS: bspatch integration - #44

Draft
ofalvai wants to merge 1 commit into
android-opt-in-bsdifffrom
ios-bspatch-integration
Draft

iOS: bspatch integration#44
ofalvai wants to merge 1 commit into
android-opt-in-bsdifffrom
ios-bspatch-integration

Conversation

@ofalvai

@ofalvai ofalvai commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Stack created with GitHub Stacks CLIGive Feedback 💬

@ofalvai ofalvai changed the title ios bspatch integration iOS: bspatch integration Aug 25, 2026
@ofalvai
ofalvai force-pushed the ios-bspatch-integration branch from da09fff to 0985b83 Compare August 25, 2026 10:20
@ofalvai
ofalvai force-pushed the ios-bspatch-integration branch from 0985b83 to 53c4592 Compare August 25, 2026 10:23
@ofalvai
ofalvai requested a balanced review from Copilot August 25, 2026 10:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +936 to +939
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 */,

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread ios/CodePush.xcodeproj/project.pbxproj Outdated
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; };

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, turns out it wasn't even necessary to link Foundation.framework -> removed.

Comment thread .github/workflows/ci-test.yml
@ofalvai
ofalvai force-pushed the ios-bspatch-integration branch 2 times, most recently from 6492a5b to 83c8db3 Compare August 25, 2026 12:52
@ofalvai
ofalvai force-pushed the ios-bspatch-integration branch from 83c8db3 to 5c775f5 Compare August 25, 2026 14:48
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