This repository has been archived by the owner on Dec 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
66 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,66 @@ | ||
# BUILD | ||
|
||
For those who wish to verify reproducibility of the binaries being distributed | ||
via MavenCentral, you can do so by following along below. | ||
For those who wish to verify reproducibility of the binaries being distributed, | ||
you can do so by following along below. | ||
|
||
- What you will need: | ||
- `Linux` or `macOS` | ||
- A `Linux x86_64` machine | ||
- Git | ||
- Gradle | ||
- Java 11 or higher | ||
|
||
- Clone the repository | ||
```shell | ||
git clone https://github.com/05nelsonm/kmp-tor-binary.git | ||
cd kmp-tor-binary | ||
``` | ||
|
||
- Build `tor` binaries: | ||
- This step will: | ||
- Build all platforms supported by `kmp-tor-binary` | ||
- Archive desktop binaries to the `binary-build/built` directory | ||
- Move android binaries to `kmp-tor-binary-android` module | ||
`src/androidMain/jniLibs` directory. | ||
- Initialize the `tor-browser-build` submodule | ||
```shell | ||
git submodule update --init | ||
``` | ||
- Open up the `tor-browser-build` submodule's `README` and install | ||
packages needed to build `tor` | ||
```shell | ||
cat library/binary-build/tor-browser-build/README | ||
``` | ||
- Run the build script | ||
```shell | ||
./library/binary-build/scripts/build_tor.sh all | ||
``` | ||
- Running `git diff` at this point should show **no** changes to the project. | ||
- Resource creation: | ||
- This step will: | ||
- Apply detached signatures to `macOS`/`Windows` binaries | ||
- Reproducibly built binaries for `macOS` and `Windows` are codesigned | ||
before being packaged as resources. The [diff-cli](tools/diff-cli/README.md) tool | ||
is used to create and apply detached signatures. | ||
- `gzip` all files | ||
- Move them to their respective `kmp-tor-binary-<os><arch>` module resource directory | ||
- Update `kmp-tor-binary-extract` constants (sha256 & manifest values) | ||
- Run the resource creation script | ||
```shell | ||
./library/binary-build/scripts/resources_create.sh all | ||
``` | ||
- Running `git diff` at this point should show **no** changes to the project. | ||
- Docker | ||
- Java 17+ | ||
|
||
|
||
1) Clone the repository | ||
```shell | ||
git clone -b master --single-branch https://github.com/05nelsonm/kmp-tor-binary.git | ||
cd kmp-tor-binary | ||
``` | ||
|
||
<!-- TODO: uncomment once release has been made for 2.0.0 | ||
2) Checkout the tag for whatver version you wish to verify | ||
```shell | ||
git checkout | ||
``` | ||
--> | ||
|
||
3) Build `tor` binaries (go touch grass for a little bit): | ||
```shell | ||
./external/task.sh build:all | ||
``` | ||
|
||
4) Package them: | ||
```shell | ||
./external/task.sh package | ||
``` | ||
|
||
5) Clean: | ||
```shell | ||
./gradlew clean -PKMP_TARGETS="JVM,LINUX_ARM64,LINUX_X64,MACOS_ARM64,MACOS_X64,MINGW_X64,IOS_ARM64,IOS_SIMULATOR_ARM64,IOS_X64,TVOS_ARM64,TVOS_SIMULATOR_ARM64,TVOS_X64,WATCHOS_ARM32,WATCHOS_ARM64,WATCHOS_DEVICE_ARM64,WATCHOS_SIMULATOR_ARM64,WATCHOS_X64" | ||
``` | ||
|
||
6) Sync the project: | ||
```shell | ||
./gradlew prepareKotlinBuildScriptModel -PKMP_TARGETS="JVM,LINUX_ARM64,LINUX_X64,MACOS_ARM64,MACOS_X64,MINGW_X64,IOS_ARM64,IOS_SIMULATOR_ARM64,IOS_X64,TVOS_ARM64,TVOS_SIMULATOR_ARM64,TVOS_X64,WATCHOS_ARM32,WATCHOS_ARM64,WATCHOS_DEVICE_ARM64,WATCHOS_SIMULATOR_ARM64,WATCHOS_X64" | ||
``` | ||
|
||
7) Check the generated reports for any errors: | ||
```shell | ||
( | ||
set +e | ||
ERRS=$(ls library/binary/build/reports/resource-validation/binary | grep ".err") | ||
echo "" | ||
for file_err in $ERRS; do | ||
echo "$file_err:" | ||
cat "library/binary/build/reports/resource-validation/binary/$file_err" | ||
done | ||
echo "" | ||
) | ||
``` | ||
|
||
If the output is blank, all built/packaged resources matched the expected sha256 hash values | ||
defined in `build-logic/src/main/kotlin/resources/TorResources.kt`. | ||
|
||
Any error output is pretty self-explanatory (either the file didn't exist or hashes did not | ||
match what was expected for the given platform/architecture). | ||
|
||
That's it. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters