Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake fails to find OpenSSL in 20210927.1 #4195

Closed
1 of 8 tasks
speedym opened this issue Sep 30, 2021 · 8 comments
Closed
1 of 8 tasks

CMake fails to find OpenSSL in 20210927.1 #4195

speedym opened this issue Sep 30, 2021 · 8 comments
Assignees
Labels
Area: Common Tools investigate Collect additional information, like space on disk, other tool incompatibilities etc. OS: macOS

Comments

@speedym
Copy link

speedym commented Sep 30, 2021

Description

After the upgrade from 20210919.1 -> 20210927.1 of the macos-10.15 virtual environment, our CI broke because the following line:

find_package(OpenSSL REQUIRED)

fails with:
`CMake Error at /usr/local/Cellar/cmake/3.21.3/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the
system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY
OPENSSL_INCLUDE_DIR)
Call Stack (most recent call first):
/usr/local/Cellar/cmake/3.21.3/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
/usr/local/Cellar/cmake/3.21.3/share/cmake/Modules/FindOpenSSL.cmake:574 (find_package_handle_standard_args)
cmake/libs/simple-websocket-server.cmake:41 (find_package)
CMakeLists.txt:360 (include)

-- Configuring incomplete, errors occurred!
See also "/Users/runner/work/xxxxx/xxxxx/build/macos/CMakeFiles/CMakeOutput.log".
Error: Process completed with exit code 1.`

Virtual environments affected

  • Ubuntu 16.04
  • Ubuntu 18.04
  • Ubuntu 20.04
  • macOS 10.15
  • macOS 11
  • Windows Server 2016
  • Windows Server 2019
  • Windows Server 2022

Image version and build link

20210927.1

Is it regression?

20210919.1

Expected behavior

CMake should find OpenSSL

Actual behavior

CMake fails to find OpenSSL and exits with error code.

Repro steps

Make a trivial CMake project with:

find_package(OpenSSL REQUIRED)

Start CMake on a virtual instance, observe that it fails.

@al-cheb al-cheb added Area: Common Tools investigate Collect additional information, like space on disk, other tool incompatibilities etc. OS: macOS and removed needs triage labels Sep 30, 2021
@al-cheb
Copy link
Contributor

al-cheb commented Sep 30, 2021

Hey, @speedym
Could you please check if OPENSSL_ROOT_DIR works?
cmake -DOPENSSL_ROOT_DIR="/usr/local/opt/openssl@1.1" .

@Bionus
Copy link

Bionus commented Oct 1, 2021

I had the same issue and changing the OPENSSL_ROOT_DIR from /usr/local/opt/openssl to /usr/local/opt/openssl@1.1 indeed solved the problem 👍

@speedym
Copy link
Author

speedym commented Oct 1, 2021

Sorry for lagging on this, on our side "brew install openssl" solved the problem as well. It would be great if it worked out of the box though.

@miketimofeev
Copy link
Contributor

@speedym brew install openssl installs version 3.0, but we would like to stick to 1.1 for some time. We are working on possible workarounds

@mikhailkoliada mikhailkoliada added the awaiting-deployment Code complete; awaiting deployment and/or deployment in progress label Oct 2, 2021
@mikhailkoliada
Copy link
Member

the fix should be in the next week's release

@mikhailkoliada
Copy link
Member

New macOS images have been deployed, the issue should be fixed.

@miketimofeev miketimofeev removed the awaiting-deployment Code complete; awaiting deployment and/or deployment in progress label Oct 7, 2021
@sanderland
Copy link

I am also facing an OPENSSL_ROOT_DIR problem in macos-10.15, my build script has:

export OPENSSL_ROOT_DIR=$(brew --prefix openssl)
export OPENSSL_LIBRARIES="${OPENSSL_ROOT_DIR}/lib"
echo $OPENSSL_ROOT_DIR
ls $OPENSSL_ROOT_DIR
echo $OPENSSL_LIBRARIES
ls $OPENSSL_LIBRARIES

On my build 22 days ago this output:
/usr/local/opt/openssl@1.1/lib and directory contents
Now it outputs

/usr/local/opt/openssl@3
ls: /usr/local/opt/openssl@3: No such file or directory

Changing this to export OPENSSL_ROOT_DIR=/usr/local/opt/openssl@1.1 fixes the build, but it is still strange that the path given by brew does not exist, suggesting something went wrong in creating the image.

@miketimofeev
Copy link
Contributor

Hi @sanderland! The behavior changed because openssl brew formula now points to the openssl 3.0, but we decided to stick to 1.1 for a while thus brew --prefix openssl returns an incorrect path (this command doesn't check whether the formula is installed on machine or not). You need to change the line to export OPENSSL_ROOT_DIR=$(brew --prefix openssl@1.1) to fix the issue

ctz added a commit to rustls/rustls that referenced this issue Oct 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Common Tools investigate Collect additional information, like space on disk, other tool incompatibilities etc. OS: macOS
Projects
None yet
Development

No branches or pull requests

6 participants