Skip to content

Commit

Permalink
check_format: use GOPATH and add install commands for formatting libr…
Browse files Browse the repository at this point in the history
…aries (#2608)

The buildifier docs recommend using the go toolchain to install buildifier. I'm not sure if current default just reflects the original authors GOPATH.

I added explicit installation instructions else ./tools/check_format.sh may fail for a new contributor with errors that seemingly indicate an actual format error.

Risk Level: Low

Testing:
passing locally with ./tools/check_format.sh check

Signed-off-by: Christopher M. Luciano <cmluciano@us.ibm.com>
  • Loading branch information
cmluciano authored and htuch committed Feb 16, 2018
1 parent efd65e0 commit 0ab49ee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions bazel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ On Ubuntu, run the following commands:
apt-get install libtool
apt-get install cmake
apt-get install realpath
apt-get install clang-format-5.0
```

On Fedora (maybe also other red hat distros), run the following:
Expand All @@ -53,9 +54,10 @@ Envoy compiles and passes tests with the version of clang installed by XCode 8.3
Apple LLVM version 8.1.0 (clang-802.0.42).

3. Install Golang on your machine. This is required as part of building [BoringSSL](https://boringssl.googlesource.com/boringssl/+/HEAD/BUILDING.md)
and also for [Buildifer](https://github.com/bazelbuild/buildtools) which is used for formatting bazel BUILD files.
4. `bazel fetch //source/...` to fetch and build all external dependencies. This may take some time.
5. `bazel build //source/exe:envoy-static` from the Envoy source directory.
and also for [Buildifer](https://github.com/bazelbuild/buildtools) which is used for formatting bazel BUILD files.
4. `go get github.com/bazelbuild/buildtools/buildifier` to install buildifier
5. `bazel fetch //source/...` to fetch and build all external dependencies. This may take some time.
6. `bazel build //source/exe:envoy-static` from the Envoy source directory.

## Building Bazel with the CI Docker image

Expand Down
2 changes: 1 addition & 1 deletion tools/check_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
GOOGLE_PROTOBUF_WHITELIST = ('ci/prebuilt', 'source/common/protobuf')

CLANG_FORMAT_PATH = os.getenv("CLANG_FORMAT", "clang-format-5.0")
BUILDIFIER_PATH = os.getenv("BUILDIFIER", "/usr/lib/go/bin/buildifier")
BUILDIFIER_PATH = os.getenv("BUILDIFIER_BIN", "$GOPATH/bin/buildifier")
ENVOY_BUILD_FIXER_PATH = os.path.join(
os.path.dirname(os.path.abspath(sys.argv[0])), "envoy_build_fixer.py")
HEADER_ORDER_PATH = os.path.join(
Expand Down

0 comments on commit 0ab49ee

Please sign in to comment.