From 29574cd3f09cce5cafdec9e073ba76684b176731 Mon Sep 17 00:00:00 2001 From: Vignesh Rao Date: Tue, 14 Jan 2025 18:41:52 -0600 Subject: [PATCH] Set and verify OpenSSL paths as environment variables --- .github/workflows/test.yml | 12 ++++++++++++ Dockerfile | 16 ++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 081c941..01904e0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,6 +32,9 @@ jobs: - name: Verify 'rustfmt' run: rustfmt --version shell: bash + - name: Verify 'openssl' + run: openssl version + shell: bash - name: Verify 'go' run: go version shell: bash @@ -41,3 +44,12 @@ jobs: - name: Verify 'npm' run: npm --version shell: bash + - name: Verify 'OPENSSL_LIB_DIR' + run: echo "$OPENSSL_LIB_DIR" + shell: bash + - name: Verify 'OPENSSL_INCLUDE_DIR' + run: echo "$OPENSSL_INCLUDE_DIR" + shell: bash + - name: Verify 'OPENSSL_STATIC' + run: echo "$OPENSSL_STATIC" + shell: bash diff --git a/Dockerfile b/Dockerfile index 821619d..3463b48 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,6 +24,7 @@ RUN apt-get install -y --no-install-recommends \ vim \ git \ jq \ + findutils \ build-essential \ libssl-dev \ libffi-dev \ @@ -42,6 +43,21 @@ RUN ln -s /usr/bin/python3.10 /usr/bin/python RUN curl https://sh.rustup.rs -sSf | sh -s -- -y ENV PATH="${HOME}/.cargo/bin:${PATH}" +# Find OpenSSL paths, set environment variables, and persist them +RUN OPENSSL_LIB_PATH=$(find / -name 'libssl.so*' 2>/dev/null | head -n 1) && \ + OPENSSL_LIB_DIR=$(dirname "$OPENSSL_LIB_PATH") && \ + OPENSSL_INCLUDE_PATH=$(find /usr -name 'ssl.h' 2>/dev/null | grep -v '/node/' | head -n 1) && \ + OPENSSL_INCLUDE_DIR=$(dirname "$OPENSSL_INCLUDE_PATH") && \ + echo "OPENSSL_LIB_DIR=$OPENSSL_LIB_DIR" && \ + echo "OPENSSL_INCLUDE_DIR=$OPENSSL_INCLUDE_DIR" && \ + echo "OPENSSL_STATIC=$OPENSSL_STATIC" && \ + export OPENSSL_LIB_DIR OPENSSL_INCLUDE_DIR + +# Set the environment variables for future stages (persistent across containers) +ENV OPENSSL_LIB_DIR=$OPENSSL_LIB_DIR \ + OPENSSL_INCLUDE_DIR=$OPENSSL_INCLUDE_DIR \ + OPENSSL_STATIC=1 + # Download and unzip the github actions runner RUN mkdir actions-runner && cd actions-runner \ && curl -O -L ${RELEASE_URL}/download/v${RUNNER_VERSION}/actions-runner-linux-x64-${RUNNER_VERSION}.tar.gz \