-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[openssl] openssl/1.1.1j Fails to build first time (once) when using cmake-conan with "cannot open input file 'apps\app_rand.obj'" #4740
Comments
As an enterprise consumer, I strongly disagree with this comment... openssl/openssl#12563 (comment) Most often this type of problem is the firewall/anti-virus.... You might want to try disabling those... check method 6 https://support.microsoft.com/en-us/topic/-windows-cannot-access-the-specified-device-path-or-file-error-when-you-try-to-install-update-or-start-a-program-or-file-46361133-47ed-6967-c13e-e75d3cc29657 it's a fairly well known problem We've needed to disable the Windows Indexing Service on our build node, check this https://www.ghacks.net/2017/08/10/manage-windows-10-search-indexing/ how to Both of these tend to open new/modified files which can prevent other processes from opening them... in this case the openssl build process. |
No. I have the same issue and can explain what's going on. Somehow openssl (conan?) configuration code detect cl.exe path as
Note
Now the correct fix is needed :) |
I love that! We recently had a similar problem with boost. https://github.com/conan-io/conan-center-index/pull/5099/files, If I make a PR would you be willing to test it to help confirm the fix? I don't have any problems locally so it's difficult for me to confirm. |
Sure. Thanks a lot in advance! |
For the original issue "it always works the second time", I'd stand by my first suggestion for OP... We have sadly seen this many times. As for the path escape problem... I think I found the issue 🤔 ❓ Are you specifying the compiler? the following lines prepare the conan-center-index/recipes/openssl/1.x.x/conanfile.py Lines 551 to 552 in 8feafc2
Using a normal command prompt, I get openssl/1.1.1j: Calling build()
**********************************************************************
** Visual Studio 2019 Developer Command Prompt v16.7.7
** Copyright (c) 2020 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'
openssl/1.1.1j: using target: VC-conan-Release-Windows-x86_64-Visual Studio-16 -> VC-WIN64A
openssl/1.1.1j: my %targets = (
"VC-conan-Release-Windows-x86_64-Visual Studio-16" => {
inherit_from => [ "VC-WIN64A" ],
cflags => add("-O2 -Ob2 -MD"),
cxxflags => add("-O2 -Ob2 -MD"),
defines => add("NDEBUG"),
includes => add("C:/.conan/9d4cd9/1/include"),
lflags => add(""),
},
); Shortly after it happily compiles
↪️ Notice it's using However with cc=C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx86/x86/cl.exe
cxx=C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx86/x86/cl.exe OpenSSL build receives
Than I can reproduce the original issues
It does not print the Which is later followed by
As for fixing the problem, I'm at odds. Adding
And using
I still have the original issue 😑 To my knowledge thus far it seems to be a problem internal with the OpenSSL |
No. it's a CI job in a Docker container, involving conan.cmake and building missing conan packages from where. Simple |
It'll be that much more rewarding when we fix it =D |
I was able to create a minimal (sort of) test case. Here it is: CMakeLists.txt cmake_minimum_required(VERSION 3.2)
project(build)
if(NOT EXISTS "${CMAKE_BINARY_DIR}/conan.cmake")
message(STATUS "Downloading conan.cmake from https://github.com/conan-io/cmake-conan")
file(DOWNLOAD "https://raw.githubusercontent.com/conan-io/cmake-conan/v0.15/conan.cmake"
"${CMAKE_BINARY_DIR}/conan.cmake")
endif()
include(${CMAKE_BINARY_DIR}/conan.cmake)
conan_check()
conan_cmake_run(
BUILD_REQUIRES
cmake/3.20.1
REQUIRES
openssl/1.1.1h
SETTINGS
cmake:arch=x86_64
nasm:arch=x86_64
strawberryperl:arch=x86_64
BUILD openssl
) Execute the following commands:
When I run cmake for the first time, it detects C/C++ compilers and writes the settings into CMakeCache.txt:
when conan.cmake in the same process tries to build openssl package, these settings somehow affect its config:
and openssl build fails. If I rerun cmake after that, C/C++ compiler settings are taken from CMakeCache.txt and do NOT affect openssl config while building:
Why so? cmake sets some environment variables that affect perl? I have no idea... |
BTW, x86_64 build fails just the same way so the test case can be reduced to cmake_minimum_required(VERSION 3.2)
project(build)
if(NOT EXISTS "${CMAKE_BINARY_DIR}/conan.cmake")
message(STATUS "Downloading conan.cmake from https://github.com/conan-io/cmake-conan")
file(DOWNLOAD "https://raw.githubusercontent.com/conan-io/cmake-conan/v0.15/conan.cmake"
"${CMAKE_BINARY_DIR}/conan.cmake")
endif()
include(${CMAKE_BINARY_DIR}/conan.cmake)
conan_cmake_run(
BUILD_REQUIRES cmake/3.20.1
REQUIRES openssl/1.1.1h
BUILD openssl
) and mkdir conan
echo [generators] > conan/conanfile.txt
conan install conan -if conan -g virtualbuildenv
call conan\activate_build.bat
mkdir build
cd build
cmake -G Ninja .. |
Yes. When cmake initially determines C/C++ compilers, it sets CC/CXX environment variables to the full cl.exe path (forward slashes, no double quotes around) that affect openssl configuration. |
@prince-chrismc --- a/recipes/openssl/1.x.x/conanfile.py
+++ b/recipes/openssl/1.x.x/conanfile.py
@@ -635,6 +635,10 @@ class OpenSSLConan(ConanFile):
if self._use_nmake and self._full_version >= "1.1.0":
self._replace_runtime_in_file(os.path.join("Configurations", "10-main.conf"))
+ if tools.os_info.is_windows and not self._win_bash:
+ for v in ['CC', 'CXX', 'RC']:
+ if v in os.environ and not '"' in os.environ[v]:
+ os.environ[v] = '"' + os.environ[v].replace('/', '\\') + '"'
self.run('{perl} ./Configure {args}'.format(perl=self._perl, args=args), win_bash=self._win_bash)
self._patch_install_name() If it's OK for you I can submit a PR. |
Please! This way I can approve it right away =D |
Co-Authored-By: Dmitry Bely <[email protected]>
* openssl: create 3.x.x directory * openssl/3.x.x: Update license to Apache-2.0 * openssl/3.x.x: Update reporting issues URL * openssl/3.x.x: Add no_deprecated, no_legacy and no_fips options * openssl/3.x.x: Delete patch for 1.1.1 * openssl/3.x.x: Update option from no_zlib to zlib * openssl/3.x.x: Remove removed options no_md2 and no_rc5 * openssl/3.x.x.: no_rc4 is still a valid option https://github.com/openssl/openssl/blob/1b495200436b57309ca958a7a72affaf75171c1a/INSTALL.md#no-algorithm * openssl/3.x.x: Remove legacy target names * openssl/3.x.x.: Remove more legacy conditions * openssl/3.x.x: Fix zlib option name * Revert "openssl/3.x.x: Update license to Apache-2.0" This reverts commit 13852ab1da9678d3700440bee862561af7878b37. * openssl/3.x.x: Actually update license to Apache-2.0 * openssl/3.x.x.: Remove all legacy version switches * openssl/3.x.x: Use OpenSSL_version instead of legacy SSLeay_version * openssl/3.x.x.: update test_package to never use find_package() Several reasons for this decision: 1) No matter the value of the paramter use_find_package CMake did always use a FindOpenSSL.cmake file 2) On my machine that meant that CMake used a FindOpenSSL.cmake file from my Python installation, which can't yet handle version 3.0.0 due to a regex error 3) Even when I addded the Conan cmake_find_package generator, it did not work (more cpp_info work needed, maybe?) 4) Even when 3) would be fixed, it would still always use the FindOpenSSL.cmake approach for some reason (I guess), so the entire use_find_package switch is pointless * openssl/3.x.x.: Remove custom OpenSSLVersion object * openssl/3.x.x.: Remove legacy target_prefix * openssl/3.x.x.: Remove custom _cross_building method Since tools.cross_building() has now a skip_x64_x86 flag * openssl/3.x.x: Some formatting * openssl/3.x.x: Remove old workaround for MinGW This got fixed in the meantime via openssl/openssl@9694ebf See also openssl/openssl#7653 * openssl/3.x.x: add no_engine option * openssl/3.x.x: Add 3.0.0-alpha5 * openssl/3.x.x: Port #1782 from @syoliver - add components * openssl/3.x.x: Fix license test The LICENSE file got renamed to LICENSE.txt * openssl/3.x.x: add old/ URLs as mirrors * openssl/3.x.x: threat URLs explicit as strings * openssl/3.x.x: add 3.0.0-alpha6 * openssl/3.x.x: the downloads have permament locations now This seems to be the case for a while now, but not for all old versions we support in the recipe for the 1.x.x versions It also does not seem to apply for pre-release versions, which rather seem to get de-published See also here: openssl/openssl#4469 * openssl: Update Conan conventions Automatically created by bincrafters-conventions 0.26.0 * openssl/3.x.x: reorder methods * openssl/3.x.x: add 3.0.0-alpha7 * openssl/3.x.x: test upstream PR 13225 openssl/openssl#13225 * openssl/3.x.x: update patch from upstream PR13225 * openssl/3.x.x: port #2944 Require installation of msys2 for MinGW builds * openssl/3.x.x: port #3214 fix openssl/** build with shared and fPIC option for OS Neutrino * openssl/3.x.x: add 3.0.0-alpha8 * openssl/3.x.x: remove fPIC when shared Co-authored-by: Anonymous Maarten <[email protected]> * openssl/3.x.x: add 3.0.0-alpha9 * openssl/3.x.x: use get_safe for fPIC * openssl/3.x.x: don't use get_safe for zlib option Co-authored-by: Anonymous Maarten <[email protected]> * openssl/3.x.x: add 3.0.0-alpha10 * openssl/3.x.x: add openssl/3.0.0-alpha11 * openssl: Update Conan conventions Automatically created by bincrafters-conventions 0.30.2 * openssl/3.x.x: add openssl/3.0.0 * openssl: Update Conan conventions Automatically created by bincrafters-conventions 0.30.5 * openssl/3.x.x: modernize Co-Authored-By: Anonymous Maarten <[email protected]> * openssl/3.x.x: modernize Co-Authored-By: Anonymous Maarten <[email protected]> * openssl/3.x.x: replace os.rename -> tools.rename * opeensl/3.x.x.: nit Co-authored-by: Anonymous Maarten <[email protected]> * openssl/3.x.x: readd old versions to config.yml Co-Authored-By: Anonymous Maarten <[email protected]> * openssl/3.x.x: remove platform import Co-authored-by: Anonymous Maarten <[email protected]> * openssl/3.x.x: fix typo in option name * openssl/3.x.x: more tools modernizations * openssl/3.x.x: use textwrap Co-authored-by: Anonymous Maarten <[email protected]> * openssl/3.x.x: remove MD5 and SHA1 from test_package * openssl/3.x.x: use self.options.get_safe() * openssl: add openssl.pc + fix libdir * openssl: convert test to pure C source * openssl: use spaces in test source * openssl/3.x.x: remove SSL_library_init from test_package * openssl: run openssl binary in test package * openssl: digest.c only needs crypto library * openssl: remove unused definitions for cmake * openssl: enable fPIC when not enabled + use zlib's shared option correctly * openssl: don't echo args (there is log.print_run_commands) + don't add shared/zlib multiple times * openssl: tools.XCRun only acceps Settings object * openssl: use self.settings.os * openssl: reformatting + be the first to use f-strings + functools.lru_cache * openssl: ./Configure --help does not print any targets. * openssl: fix critical typo * openssl: fix sneaky usage of tools.os_info in build_requirements * openssl/3.x.x: remove patch for macOS shared Co-Authored-By: Bowb <[email protected]> * openssl/3.x.x: port #4460 remove explicit apple deployment target flag Co-Authored-By: SSE4 <[email protected]> * openssl/3.x.x: port #4597 provide official variables in cmake_find_package Co-Authored-By: SpaceIm <[email protected]> * openssl/3.x.x: port #4698 fix rt dependency for SUSE11 Co-Authored-By: Alexey Klimkin <[email protected]> * openssl/3.x.x: port #4772 fix builddirs and add vars module to cmake_find_package only Co-Authored-By: SpaceIm <[email protected]> * openssl/3.x.x: port #5441 closes #4740 Co-Authored-By: Dmitry Bely <[email protected]> * openssl/3.x.x: port #3998 add libatomic in build dependency for Neutrino OS Co-Authored-By: Arenoros <[email protected]> * openssl/3.x.x: port #6337 OpenSSL on Windows: multi-profile support Co-Authored-By: Stefan Floeren <[email protected]> * openssl/3.x.x: port #6588 Add macOS ARM target Co-Authored-By: gmeeker <[email protected]> * openssl/3.x.x: port #6884 Build openssl for emscripten Co-Authored-By: Volodymyr B. <[email protected]> * openssl: reformatting fixes * openssl: make method property + remove unused import * openssl: reverse sort openssl's config.yml * openssl: only run openssl when not cross building * openssl: port options of openssl 1.1.1 * openssl: fix MSVC install + remove options unsupported by openssl 3 + openssl exe is only available when building with no_stio=False * force push Signed-off-by: Uilian Ries <[email protected]> * openssl: add missing options + various reformatting Co-authored-by: bincrafters-user <[email protected]> Co-authored-by: Anonymous Maarten <[email protected]> Co-authored-by: Anonymous Maarten <[email protected]> Co-authored-by: Bowb <[email protected]> Co-authored-by: SSE4 <[email protected]> Co-authored-by: SpaceIm <[email protected]> Co-authored-by: Alexey Klimkin <[email protected]> Co-authored-by: Dmitry Bely <[email protected]> Co-authored-by: Arenoros <[email protected]> Co-authored-by: Stefan Floeren <[email protected]> Co-authored-by: gmeeker <[email protected]> Co-authored-by: Volodymyr B. <[email protected]> Co-authored-by: Uilian Ries <[email protected]>
Package and Environment Details (include every applicable attribute)
Steps to reproduce (Include if Applicable)
Let's say we have
conan-bug
directory, where inside we have:profile.txt:
conanfile.txt:
CMakeLists.txt:
cmake-conan-0.15 directory from:
https://github.com/conan-io/cmake-conan/releases/tag/v0.15
Now, in
cmd.exe
run:Output with failure:
https://gist.github.com/Talkless/28fe39d2176e00b25d9987caef9009be (using gist as log conflicts with github formatting somehow).
Intrestingly, if I run same
cmake
command again (second time) - build succeeds (openssl
is built)!If I remove
openssl
package withconan.exe remove openssl --force
and runcmake
again, it also succeeds!Now to actually reproduce build, I have to remove
openssl
package andbuild
directory.This issue is experienced only with
openssl
package so far.The text was updated successfully, but these errors were encountered: