From 0c53cedaa2d71bb9bc5e4b40407d09a61c44bb81 Mon Sep 17 00:00:00 2001 From: Lukas Piatkowski Date: Sat, 26 Sep 2020 09:44:41 -0700 Subject: [PATCH] mononoke/integration: build EdenSCM with non system OpenSSL (#12) Summary: Pull Request resolved: https://github.com/facebookexperimental/rust-shed/pull/12 The OpenSSL version on Mac doesn't work well with EdenSCM and Mononoke integration, just use the one from getdeps/brew. Also remove the now redundant "DEVELOPER_DIR" since the modern XCode version works. Pull Request resolved: https://github.com/facebookexperimental/eden/pull/63 Differential Revision: D23927022 Pulled By: lukaspiatkowski fbshipit-source-id: 5b82632eea6004009ed20133198aa40eb1470589 --- .../workflows/eden_scm_lib_edenapi_tools_mac.yml | 4 ---- .github/workflows/edenscm_mac.yml | 4 ---- .github/workflows/mononoke-integration_mac.yml | 15 ++++++++++++--- .github/workflows/mononoke_mac.yml | 2 -- build/fbcode_builder/getdeps/buildopts.py | 9 ++++----- 5 files changed, 16 insertions(+), 18 deletions(-) diff --git a/.github/workflows/eden_scm_lib_edenapi_tools_mac.yml b/.github/workflows/eden_scm_lib_edenapi_tools_mac.yml index d4d71eb543b5c..432b0916ed1dd 100644 --- a/.github/workflows/eden_scm_lib_edenapi_tools_mac.yml +++ b/.github/workflows/eden_scm_lib_edenapi_tools_mac.yml @@ -1,5 +1,3 @@ -# This file was @generated by getdeps.py - name: EdenSCM Lib EdenAPI Tools Mac on: @@ -13,8 +11,6 @@ on: jobs: build: runs-on: macOS-latest - env: - DEVELOPER_DIR: /Applications/Xcode_10.3.app/Contents/Developer steps: - uses: actions/checkout@v1 - name: Install Rust Stable diff --git a/.github/workflows/edenscm_mac.yml b/.github/workflows/edenscm_mac.yml index 3e0f9c9f86ff3..f85e0c5ca850d 100644 --- a/.github/workflows/edenscm_mac.yml +++ b/.github/workflows/edenscm_mac.yml @@ -1,5 +1,3 @@ -# This file was @generated by getdeps.py - name: EdenSCM Mac on: @@ -13,8 +11,6 @@ on: jobs: build: runs-on: macOS-latest - env: - DEVELOPER_DIR: /Applications/Xcode_10.3.app/Contents/Developer steps: - uses: actions/checkout@v1 - name: Install Rust Stable diff --git a/.github/workflows/mononoke-integration_mac.yml b/.github/workflows/mononoke-integration_mac.yml index 6d41d31d71575..1aaa450c6ea8c 100644 --- a/.github/workflows/mononoke-integration_mac.yml +++ b/.github/workflows/mononoke-integration_mac.yml @@ -11,8 +11,6 @@ on: jobs: tests: runs-on: macOS-latest - env: - DEVELOPER_DIR: /Applications/Xcode_10.3.app/Contents/Developer steps: - uses: actions/checkout@v1 - name: Check space @@ -35,9 +33,16 @@ jobs: run: | brew install bash coreutils curl-openssl gnu-sed grep jq nmap tree - name: Install system deps - run: sudo python3 build/fbcode_builder/getdeps.py --allow-system-packages install-system-deps --recursive eden_scm + run: >- + export PATH="/usr/local/opt/curl-openssl/bin:$PATH"; + sudo python3 build/fbcode_builder/getdeps.py + --allow-system-packages + install-system-deps + --recursive + eden_scm - name: Build eden_scm dependencies run: >- + export PATH="/usr/local/opt/curl-openssl/bin:$PATH"; python3 build/fbcode_builder/getdeps.py build --allow-system-packages --scratch-path /tmp/build @@ -46,6 +51,7 @@ jobs: eden_scm - name: Build eden_scm run: >- + export PATH="/usr/local/opt/curl-openssl/bin:$PATH"; python3 build/fbcode_builder/getdeps.py build --allow-system-packages --scratch-path /tmp/build @@ -54,6 +60,7 @@ jobs: eden_scm - name: Build eden_scm_lib_edenapi_tools run: >- + export PATH="/usr/local/opt/curl-openssl/bin:$PATH"; python3 build/fbcode_builder/getdeps.py build --allow-system-packages --scratch-path /tmp/build @@ -62,6 +69,7 @@ jobs: eden_scm_lib_edenapi_tools - name: Build mononoke dependencies run: >- + export PATH="/usr/local/opt/curl-openssl/bin:$PATH"; python3 build/fbcode_builder/getdeps.py build --allow-system-packages --scratch-path /tmp/build @@ -70,6 +78,7 @@ jobs: mononoke - name: Build mononoke run: >- + export PATH="/usr/local/opt/curl-openssl/bin:$PATH"; python3 build/fbcode_builder/getdeps.py build --allow-system-packages --scratch-path /tmp/build diff --git a/.github/workflows/mononoke_mac.yml b/.github/workflows/mononoke_mac.yml index 2bc2cd354d422..b4ee2516f6617 100644 --- a/.github/workflows/mononoke_mac.yml +++ b/.github/workflows/mononoke_mac.yml @@ -11,8 +11,6 @@ on: jobs: build: runs-on: macOS-latest - env: - DEVELOPER_DIR: /Applications/Xcode_10.3.app/Contents/Developer steps: - uses: actions/checkout@v1 - name: Check space diff --git a/build/fbcode_builder/getdeps/buildopts.py b/build/fbcode_builder/getdeps/buildopts.py index 2c7cad9aa6496..56de827a6f2f9 100644 --- a/build/fbcode_builder/getdeps/buildopts.py +++ b/build/fbcode_builder/getdeps/buildopts.py @@ -269,12 +269,11 @@ def compute_env_for_install_dirs(self, install_dirs, env=None, manifest=None): env["RUSTC"] = rustc_path env["RUSTDOC"] = rustdoc_path - if self.is_windows(): - libcrypto = os.path.join(d, "lib/libcrypto.lib") - else: - libcrypto = os.path.join(d, "lib/libcrypto.so") openssl_include = os.path.join(d, "include/openssl") - if os.path.isfile(libcrypto) and os.path.isdir(openssl_include): + if os.path.isdir(openssl_include) and any( + os.path.isfile(os.path.join(d, "lib", libcrypto)) + for libcrypto in ("libcrypto.lib", "libcrypto.so", "libcrypto.a") + ): # This must be the openssl library, let Rust know about it env["OPENSSL_DIR"] = d