Skip to content

Commit

Permalink
Small fixes to boringssl_fips.genrule_cmd (envoyproxy#33570)
Browse files Browse the repository at this point in the history
- Move `HOME` var up so that `curl` reads it and does not fail
 - Adjust `PATH` var. `cmake` directory will be added to `PATH` a few
   lines later
 - Actually perform the `SHA` verification for clang.

Signed-off-by: Jonh Wendell <[email protected]>
  • Loading branch information
jwendell authored Apr 17, 2024
1 parent d32a1d0 commit c1d2789
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions bazel/external/boringssl_fips.genrule_cmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

set -e
set -eo pipefail

export CXXFLAGS=''
export LDFLAGS=''
Expand All @@ -21,6 +21,7 @@ fi
# ROOT=$(dirname $(rootpath boringssl/BUILDING.md))/..
ROOT=./external/boringssl_fips
pushd "$ROOT"
export HOME="$PWD"

# Build tools requirements (from section 12.1 of https://csrc.nist.gov/CSRC/media/projects/cryptographic-module-validation-program/documents/security-policies/140sp4407.pdf):
# - Clang compiler version 12.0.0 (https://releases.llvm.org/download.html)
Expand All @@ -29,7 +30,7 @@ pushd "$ROOT"
# - Cmake version 3.20.1 (https://cmake.org/download/)

# Override $PATH for build tools, to avoid picking up anything else.
export PATH="$(dirname `which cmake`):/usr/bin:/bin"
export PATH="/usr/bin:/bin"

# Clang
VERSION=12.0.0
Expand All @@ -42,9 +43,9 @@ else
fi

curl -sLO https://github.com/llvm/llvm-project/releases/download/llvmorg-"$VERSION"/clang+llvm-"$VERSION"-"$PLATFORM".tar.xz
echo "$SHA256" clang+llvm-"$VERSION"-"$PLATFORM".tar.xz | sha256sum --check
tar xf clang+llvm-"$VERSION"-"$PLATFORM".tar.xz

export HOME="$PWD"
printf "set(CMAKE_C_COMPILER \"clang\")\nset(CMAKE_CXX_COMPILER \"clang++\")\n" > ${HOME}/toolchain
export PATH="$PWD/clang+llvm-$VERSION-$PLATFORM/bin:$PATH"

Expand Down

0 comments on commit c1d2789

Please sign in to comment.