bazelbuild / bazelbuild/rules_apple
static xcframework zip archive has bad CRC
- Dominant language
- Starlark
- Stars
- 593
- Forks
- 334
- Avg merge
- 16h 48m
- Merged PRs (30d)
- 9
Description
Zip archives produced by rules_apple appear to fail CRC checks.
```console
$ git clone https://github.com/envoyproxy/envoy-mobile.git
$ git checkout 234b73f4
$ git submodule update --init --recursive
$ ./bazelw build ios_xcframework --config=ios
$ unzip bazel-bin/library/swift/Envoy.xcframework.zip
Archive: bazel-bin/library/swift/Envoy.xcframework.zip
inflating: Envoy.xcframework/Info.plist
inflating: Envoy.xcframework/ios-arm64/Envoy.a
inflating: Envoy.xcframework/ios-arm64/Envoy.swiftmodule/arm64.swiftinterface
inflating: Envoy.xcframework/ios-arm64/Envoy.swiftmodule/arm64.swiftdoc
inflating: Envoy.xcframework/ios-arm64/Headers/Envoy.h
inflating: Envoy.xcframework/ios-arm64/Headers/module.modulemap
inflating: Envoy.xcframework/ios-arm64_x86_64-simulator/Envoy.a bad CRC b38a73aa (should be a131c8e2)
inflating: Envoy.xcframework/ios-arm64_x86_64-simulator/Envoy.swiftmodule/arm64.swiftinterface
inflating: Envoy.xcframework/ios-arm64_x86_64-simulator/Envoy.swiftmodule/arm64.swiftdoc
inflating: Envoy.xcframework/ios-arm64_x86_64-simulator/Envoy.swiftmodule/x86_64.swiftinterface
inflating: Envoy.xcframework/ios-arm64_x86_64-simulator/Envoy.swiftmodule/x86_64.swiftdoc
inflating: Envoy.xcframework/ios-arm64_x86_64-simulator/Headers/Envoy.h
inflating: Envoy.xcframework/ios-arm64_x86_64-simulator/Headers/module.modulemap
```
Notice this line:
> inflating: Envoy.xcframework/ios-arm64_x86_64-simulator/Envoy.a bad CRC b38a73aa (should be a131c8e2)
If I recompress with `zip` and decompress again, I don't see the same bad CRC error.
```console
$ zip -r Envoy.xcframework.zip Envoy.xcframework
$ rm -rf Envoy.xcframework
$ unzip Envoy.xcframework.zip
Archive: Envoy.xcframework.zip
creating: Envoy.xcframework/
creating: Envoy.xcframework/ios-arm64_x86_64-simulator/
inflating: Envoy.xcframework/ios-arm64_x86_64-simulator/Envoy.a
creating: Envoy.xcframework/ios-arm64_x86_64-simulator/Headers/
inflating: Envoy.xcframework/ios-arm64_x86_64-simulator/Headers/Envoy.h
inflating: Envoy.xcframework/ios-arm64_x86_64-simulator/Headers/module.modulemap
creating: Envoy.xcframework/ios-arm64_x86_64-simulator/Envoy.swiftmodule/
inflating: Envoy.xcframework/ios-arm64_x86_64-simulator/Envoy.swiftmodule/x86_64.swiftdoc
inflating: Envoy.xcframework/ios-arm64_x86_64-simulator/Envoy.swiftmodule/arm64.swiftinterface
inflating: Envoy.xcframework/ios-arm64_x86_64-simulator/Envoy.swiftmodule/arm64.swiftdoc
inflating: Envoy.xcframework/ios-arm64_x86_64-simulator/Envoy.swiftmodule/x86_64.swiftinterface
creating: Envoy.xcframework/ios-arm64/
inflating: Envoy.xcframework/ios-arm64/Envoy.a
creating: Envoy.xcframework/ios-arm64/Headers/
inflating: Envoy.xcframework/ios-arm64/Headers/Envoy.h
inflating: Envoy.xcframework/ios-arm64/Headers/module.modulemap
creating: Envoy.xcframework/ios-arm64/Envoy.swiftmodule/
inflating: Envoy.xcframework/ios-arm64/Envoy.swiftmodule/arm64.swiftinterface
inflating: Envoy.xcframework/ios-arm64/Envoy.swiftmodule/arm64.swiftdoc
inflating: Envoy.xcframework/Info.plist
$ # No error
```
Contributor guide
Research direction
Start by reproducing the issue with the documented checkout, ./bazelw build ios_xcframework --config=ios, and unzip on bazel-bin/library/swift/Envoy.xcframework.zip. Compare the generated archive with the recompressed archive and verify that the simulator Envoy.a entry no longer reports a bad CRC during extraction.
Written by the indexing model from the issue text.
Assessment
- Domain
- build-system, mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100