prysm-pulse/third_party
Preston Van Loon 65db331eaf
Remove bazel-go-ethereum fork, use upstream go-ethereum (#9725)
* Check in go-ethereum crypto/sepc256k1 package with proper build rules

* gaz

* Add karalabe/usb

* viz improvement

* Remove bazel-go-ethereum, use vendored libraries only

* move vendor stuff to third_party so that go mod wont be mad anymore

* fix geth e2e flags

* fix geth e2e flags

* remove old rules_foreign_cc toolchain

* Update cross compile docker image to support os x

* works for geth build

* remove copy of sepc256k1

* revert changes in tools/cross-toolchain

* gaz

* Update go-ethereum to 1.10.10

* Revert "revert changes in tools/cross-toolchain"

This reverts commit 2e8128f7c3a2d20a16e50b88ec7e5b69c70ddf2b.

* revert tags changes

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
2021-10-19 00:00:22 +00:00
..
afl Add beacon state unmarshal fuzzer, afl support (#6625) 2020-09-14 11:42:08 -07:00
beacon-fuzz libfuzz based tests (#5095) 2020-05-05 07:22:26 +00:00
blst Add New Compiler Flags for BLST (#7352) 2020-09-26 08:48:02 +00:00
herumi Support Go Builds For Darwin Arm64 (#9600) 2021-09-18 17:56:05 +00:00
usb Remove bazel-go-ethereum fork, use upstream go-ethereum (#9725) 2021-10-19 00:00:22 +00:00
BUILD.bazel Spec freeze updates (#2312) 2019-07-19 19:16:10 -05:00
com_github_ethereum_go_ethereum_secp256k1.patch Remove bazel-go-ethereum fork, use upstream go-ethereum (#9725) 2021-10-19 00:00:22 +00:00
com_github_gogo_protobuf-equal.patch Spec freeze updates (#2312) 2019-07-19 19:16:10 -05:00
com_github_prysmaticlabs_ethereumapis-tags.patch libfuzz based tests (#5095) 2020-05-05 07:22:26 +00:00
io_bazel_rules_go_test.patch Bazel: minimal test build transitions (#9122) 2021-06-30 19:22:09 +00:00
io_bazel_rules_go.patch Update rules_go (#7202) 2020-11-10 03:01:56 +00:00
libp2p_tls.patch Refactor dependencies, make Prysm "go gettable" (#6053) 2020-05-31 14:44:34 +08:00
README.md Fix Up READMEs for Mainnet (#7910) 2020-11-23 18:47:55 +00:00

Third Party Package Patching

This directory includes local patches to third party dependencies we use in Prysm. Sometimes, we need to make a small change to some dependency for ease of use in Prysm without wanting to maintain our own fork of the dependency ourselves. Our build tool, Bazel allows us to include patches in a seamless manner based on simple diff rules.

This README outlines how patching works in Prysm and an explanation of previously created patches.

Given maintaining a patch can be difficult and tedious, patches are NOT the recommended way of modifying dependencies in Prysm unless really needed

Table of Contents

Prerequisites

Bazel Installation:

  • The latest release of Bazel
  • A modern UNIX operating system (MacOS included)

Creating a Patch

To create a patch, we need an original version of a dependency which we will refer to as a and the patched version referred to as b.

cd /tmp
git clone https://github.com/someteam/somerepo a
git clone https://github.com/someteam/somerepo b && cd b

Then, make all your changes in b and finally create the diff of all your changes as follows:

cd ..
diff -ur --exclude=".git" a b > $GOPATH/src/github.com/prysmaticlabs/prysm/third_party/YOURPATCH.patch

Next, we need to tell the Bazel WORKSPACE to patch the specific dependency. Here's an example for a patch we use today for the Ethereum APIs dependency:

go_repository(
    name = "com_github_prysmaticlabs_ethereumapis",
    commit = "367ca574419a062ae26818f60bdeb5751a6f538",
    patch_args = ["-p1"],
    patches = [
        "//third_party:com_github_prysmaticlabs_ethereumapis-tags.patch",
    ],
    importpath = "github.com/prysmaticlabs/ethereumapis",
)

Now, when used in Prysm, the dependency you patched will have the patched modifications when you run your code.