Summary: # Problem Oddly enough, since the addition of ReactiveCocoa to Electron on MacOS, we're seeing non-determinism when creating tar archives. P144049799 shows the difference between two release artifacts built on Sandcastle. Their contents are identical but they're packed differently. # Approach To counter this, I'm now calculating the checksum not based on the archive itself but on its *sorted* contents by first inserting all files into a `BTreeMap` with the file path as key and then lastly hashing all hashes, building some sort of bastardised Merkle tree. # This diff I'm only implementing the hashing here. The next diff will actually make use of this. # Further steps This requires a few more downstream changes which will require some finesse to roll out. - The manifest will need to include both the intrinsic and extrinsic checksums as Launcher depends on the latter to verify the download integrity. We could also calculate the intrinsic checksum again, but that just adds more complexity which is hard to debug. - Sandcastle will need to understand the new manifest format and we need to schedule the MSDK rollout accordingly. Not a huge problem as the call volume is low and manual. - We need to modify the artifact and release ents to contain both checksums. - The release endpoint needs to be modified to return the checksum the launcher cares about. Reviewed By: nikoant Differential Revision: D24024011 fbshipit-source-id: 55de748178c033c18a69c79c68f12e7c1aaf4deb
Flipper Packer
Work in progress and incomplete
A tool for splitting a Flipper build into smaller artifacts that can be distributed and cached separately.
N.B. Buck build files are not included in the open-source export of this tool.
Building
With cargo:
$ cargo build
With Buck:
$ buck build :packer
Testing
With cargo:
$ cargo test
With Buck:
$ buck test :packer
Usage
See help page:
$ cargo run -- --help
flipper-packer 0.1.0
Facebook, Inc.
USAGE:
flipper-packer [FLAGS] [OPTIONS] <PLATFORM>
FLAGS:
-h, --help Prints help information
-p, --packlist Custom list of files to pack.
-V, --version Prints version information
OPTIONS:
-d, --dist <DIRECTORY> Flipper dist directory to read from. [default: ~/fbsource/xplat/sonar/dist]
-o, --output <DIRECTORY> Directory to write output files to. [default: .]
ARGS:
<PLATFORM> Platform to build for [possible values: Mac, Linux, Windows]
Buck:
$ buck run :packer