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

[package] openssl/3.0.3: can not be built under Windows 11 (Visual Studio 11) #10755

Open
Trafo opened this issue May 12, 2022 · 2 comments
Open
Labels
bug Something isn't working

Comments

@Trafo
Copy link

Trafo commented May 12, 2022

Package and Environment Details

  • Package Name/Version: openssl/3.0.3
  • Operating System+version: Windows11
  • Compiler+version: msvc17
  • Conan version: conan 1.48.0
  • Python version: Python 3.10.4

Conan profile

[settings]
os=Windows
os_build=Windows
arch=x86_64
arch_build=x86_64
compiler=Visual Studio
compiler.version=17
build_type=Release
[options]
[conf]
[build_requires]
[env]

Steps to reproduce (Include if Applicable)

  • build lib under windows 11 with msvc 17

My description

I opened already a bug ticket in OpenSSL: openssl/openssl#18299

The main problem is, that there is a variable set: RC = "C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\rc.exe"
The quotes are the problem there. Because this leads to the call inside of the build script:
""C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\rc.exe"" /foapps\openssl-bin-openssl.res "apps\openssl.rc"
which leads to the failure: The system cannot find the path specified.
OpenSSL developers are claiming that this RC is set by the Conan script. Sadly just looking into the Conan script, I don't see where it is done.

Logs (Include/Attach if Applicable)

Click to expand log

Build log:

openssl/3.0.3: Applying build-requirement: strawberryperl/5.30.0.1
openssl/3.0.3: Applying build-requirement: nasm/2.15.05
openssl/3.0.3: WARN: Build folder is dirty, removing it: C:\Users\mathiaseggert\.conan\data\openssl\3.0.3\_\_\build\cdb6fd543ab5677fd09e2c988f468d700c5445bc
openssl/3.0.3: Copying sources to build folder
openssl/3.0.3: Building your package in C:\Users\mathiaseggert\.conan\data\openssl\3.0.3\_\_\build\cdb6fd543ab5677fd09e2c988f468d700c5445bc
openssl/3.0.3: Generator txt created conanbuildinfo.txt
openssl/3.0.3: Aggregating env generators
openssl/3.0.3: Calling build()
Conan:vcvars already set 
openssl/3.0.3: using target: VC-conan-Release-Windows-x86_64-Visual Studio-17 -> VC-WIN64A
openssl/3.0.3: my %targets = (
    "VC-conan-Release-Windows-x86_64-Visual Studio-17" => {
        inherit_from => [ "VC-WIN64A" ],
        cflags => add("-O2 -Ob2 -MD"),
        cxxflags => add("-O2 -Ob2 -MD"),
        defines => add("NDEBUG"),
        includes => add("C:/Users/mathiaseggert/.conan/data/zlib/1.2.12/_/_/package/5a61a86bb3e07ce4262c80e1510f9c05e9b6d48b/include"),
        lflags => add(""),
        
        
        
        
        cxx => "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/bin/Hostx64/x64/cl.exe",
        
        
        
    },
);

WARN: replace_in_file didn't find pattern '/MTd ' in 'Configurations\10-main.conf' file.
WARN: replace_in_file didn't find pattern '/MTd"' in 'Configurations\10-main.conf' file.
Configuring OpenSSL version 3.0.3 for target VC-conan-Release-Windows-x86_64-Visual Studio-17
Using os-specific seed configuration
Creating configdata.pm
Running configdata.pm
Creating makefile.in
Creating makefile

**********************************************************************
***                                                                ***
***   OpenSSL has been successfully configured                     ***
***                                                                ***
***   If you encounter a problem while building, please open an    ***
***   issue on GitHub <https://github.com/openssl/openssl/issues>  ***
***   and include the output from the following command:           ***
***                                                                ***
***       perl configdata.pm --dump                                ***
***                                                                ***
***   (If you are new to OpenSSL, you might want to consult the    ***
***   'Troubleshooting' section in the INSTALL.md file first)      ***
***                                                                ***
**********************************************************************

Microsoft (R) Program Maintenance Utility Version 14.31.31107.0
Copyright (C) Microsoft Corporation.  All rights reserved.

	"C:\.conan\fcf9d5\1\bin\perl.exe" "-I." -Mconfigdata "util\dofile.pl" "-omakefile" "include\crypto\bn_conf.h.in" > include\crypto\bn_conf.h
	"C:\.conan\fcf9d5\1\bin\perl.exe" "-I." -Mconfigdata "util\dofile.pl" "-omakefile" "include\crypto\dso_conf.h.in" > include\crypto\dso_conf.h
	"C:\.conan\fcf9d5\1\bin\perl.exe" "-I." -Mconfigdata "util\dofile.pl" "-omakefile" "include\openssl\asn1.h.in" > include\openssl\asn1.h
	"C:\.conan\fcf9d5\1\bin\perl.exe" "-I." -Mconfigdata "util\dofile.pl" "-omakefile" "include\openssl\asn1t.h.in" > include\openssl\asn1t.h
	"C:\.conan\fcf9d5\1\bin\perl.exe" "-I." -Mconfigdata "util\dofile.pl" "-omakefile" "include\openssl\bio.h.in" > include\openssl\bio.h
	"C:\.conan\fcf9d5\1\bin\perl.exe" "-I." -Mconfigdata "util\dofile.pl" "-omakefile" "include\openssl\cmp.h.in" > include\openssl\cmp.h
	"C:\.conan\fcf9d5\1\bin\perl.exe" "-I." -Mconfigdata "util\dofile.pl" "-omakefile" "include\openssl\cms.h.in" > include\openssl\cms.h
	"C:\.conan\fcf9d5\1\bin\perl.exe" "-I." -Mconfigdata "util\dofile.pl" "-omakefile" "include\openssl\conf.h.in" > include\openssl\conf.h
	"C:\.conan\fcf9d5\1\bin\perl.exe" "-I." -Mconfigdata "util\dofile.pl" "-omakefile" "include\openssl\configuration.h.in" > include\openssl\configuration.h
	"C:\.conan\fcf9d5\1\bin\perl.exe" "-I." -Mconfigdata "util\dofile.pl" "-omakefile" "include\openssl\crmf.h.in" > include\openssl\crmf.h
	"C:\.conan\fcf9d5\1\bin\perl.exe" "-I." -Mconfigdata "util\dofile.pl" "-omakefile" "include\openssl\crypto.h.in" > include\openssl\crypto.h
	"C:\.conan\fcf9d5\1\bin\perl.exe" "-I." -Mconfigdata "util\dofile.pl" "-omakefile" "include\openssl\ct.h.in" > include\openssl\ct.h
	"C:\.conan\fcf9d5\1\bin\perl.exe" "-I." -Mconfigdata "util\dofile.pl" "-omakefile" "include\openssl\err.h.in" > include\openssl\err.h
	"C:\.conan\fcf9d5\1\bin\perl.exe" "-I." -Mconfigdata "util\dofile.pl" "-omakefile" "include\openssl\ess.h.in" > include\openssl\ess.h
	"C:\.conan\fcf9d5\1\bin\perl.exe" "-I." -Mconfigdata "util\dofile.pl" "-omakefile" "include\openssl\fipskey.h.in" > include\openssl\fipskey.h
	"C:\.conan\fcf9d5\1\bin\perl.exe" "-I." -Mconfigdata "util\dofile.pl" "-omakefile" "include\openssl\lhash.h.in" > include\openssl\lhash.h
	"C:\.conan\fcf9d5\1\bin\perl.exe" "-I." -Mconfigdata "util\dofile.pl" "-omakefile" "include\openssl\ocsp.h.in" > include\openssl\ocsp.h
	"C:\.conan\fcf9d5\1\bin\perl.exe" "-I." -Mconfigdata "util\dofile.pl" "-omakefile" "include\openssl\opensslv.h.in" > include\openssl\opensslv.h
	"C:\.conan\fcf9d5\1\bin\perl.exe" "-I." -Mconfigdata "util\dofile.pl" "-omakefile" "include\openssl\pkcs12.h.in" > include\openssl\pkcs12.h
	"C:\.conan\fcf9d5\1\bin\perl.exe" "-I." -Mconfigdata "util\dofile.pl" "-omakefile" "include\openssl\pkcs7.h.in" > include\openssl\pkcs7.h
	"C:\.conan\fcf9d5\1\bin\perl.exe" "-I." -Mconfigdata "util\dofile.pl" "-omakefile" "include\openssl\safestack.h.in" > include\openssl\safestack.h
	"C:\.conan\fcf9d5\1\bin\perl.exe" "-I." -Mconfigdata "util\dofile.pl" "-omakefile" "include\openssl\srp.h.in" > include\openssl\srp.h
	"C:\.conan\fcf9d5\1\bin\perl.exe" "-I." -Mconfigdata "util\dofile.pl" "-omakefile" "include\openssl\ssl.h.in" > include\openssl\ssl.h
	"C:\.conan\fcf9d5\1\bin\perl.exe" "-I." -Mconfigdata "util\dofile.pl" "-omakefile" "include\openssl\ui.h.in" > include\openssl\ui.h
	"C:\.conan\fcf9d5\1\bin\perl.exe" "-I." -Mconfigdata "util\dofile.pl" "-omakefile" "include\openssl\x509.h.in" > include\openssl\x509.h
	"C:\.conan\fcf9d5\1\bin\perl.exe" "-I." -Mconfigdata "util\dofile.pl" "-omakefile" "include\openssl\x509_vfy.h.in" > include\openssl\x509_vfy.h
	"C:\.conan\fcf9d5\1\bin\perl.exe" "-I." -Mconfigdata "util\dofile.pl" "-omakefile" "include\openssl\x509v3.h.in" > include\openssl\x509v3.h
	"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\bin\HostX64\x64\nmake.exe" /                   depend

Microsoft (R) Program Maintenance Utility Version 14.31.31107.0
Copyright (C) Microsoft Corporation.  All rights reserved.

	"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\bin\HostX64\x64\nmake.exe" /                   _build_sw

Microsoft (R) Program Maintenance Utility Version 14.31.31107.0
Copyright (C) Microsoft Corporation.  All rights reserved.

... BUILD processing ...

x509.c
	cmd /C """cl"" /Zs /showIncludes  /Zi /Fdapp.pdb /MD /Gs0 /GF /Gy -O2 -Ob2 -MD /W3 /wd4090 /nologo /O2 -I"apps" -I"." -I"include" -I"apps\include" -D"OPENSSL_BUILDING_OPENSSL" -D"ZLIB" -D"OPENSSL_SYS_WIN32" -D"WIN32_LEAN_AND_MEAN" -D"UNICODE" -D"_UNICODE" -D"_CRT_SECURE_NO_DEPRECATE" -D"_WINSOCK_DEPRECATED_NO_WARNINGS" -D"NDEBUG" -D"NDEBUG" -I"C:/Users/mathiaseggert/.conan/data/zlib/1.2.12/_/_/package/5a61a86bb3e07ce4262c80e1510f9c05e9b6d48b/include" -I"C:/Users/mathiaseggert/.conan/data/zlib/1.2.12/_/_/package/5a61a86bb3e07ce4262c80e1510f9c05e9b6d48b/include"   "apps\x509.c" > apps\openssl-bin-x509.d 2>&1"
	"C:\.conan\fcf9d5\1\bin\perl.exe" util\mkrc.pl openssl > apps\openssl.rc
	""C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\rc.exe""  /foapps\openssl-bin-openssl.res "apps\openssl.rc"
The system cannot find the path specified.
NMAKE : fatal error U1077: '""C:\Program' : return code '0x1'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.31.31103\bin\HostX64\x64\nmake.exe"' : return code '0x2'
Stop.
openssl/3.0.3: openssl/3.0.3: ERROR: Package 'cdb6fd543ab5677fd09e2c988f468d700c5445bc' build failed

OpenSSL Config data:

Command line (with current working directory = .):

    C:\.conan\fcf9d5\1\bin\perl.exe Configure VC-conan-Release-Windows-x86_64-Visual Studio-17 no-shared --prefix=C:\Users\mathiaseggert\.conan\data\openssl\3.0.3\_\_\package\cdb6fd543ab5677fd09e2c988f468d700c5445bc --libdir=lib --openssldir=C:\Users\mathiaseggert\.conan\data\openssl\3.0.3\_\_\package\cdb6fd543ab5677fd09e2c988f468d700c5445bc\res no-unit-test threads PERL=C:\.conan\fcf9d5\1\bin\perl.exe no-tests --release enable-fips zlib --with-zlib-include=C:/Users/mathiaseggert/.conan/data/zlib/1.2.12/_/_/package/5a61a86bb3e07ce4262c80e1510f9c05e9b6d48b/include --with-zlib-lib=C:/Users/mathiaseggert/.conan/data/zlib/1.2.12/_/_/package/5a61a86bb3e07ce4262c80e1510f9c05e9b6d48b/lib/zlib.lib

Perl information:

    C:\.conan\fcf9d5\1\bin\perl.exe
    5.30.0 for MSWin32-x64-multi-thread

Enabled features:

    acvp-tests
    aria
    asm
    async
    autoalginit
    autoerrinit
    autoload-config
    bf
    blake2
    bulk
    cached-fetch
    camellia
    capieng
    cast
    chacha
    cmac
    cmp
    cms
    comp
    ct
    deprecated
    des
    dgram
    dh
    dsa
    dso
    dtls
    ec
    ec2m
    ecdh
    ecdsa
    engine
    err
    filenames
    fips
    fips-securitychecks
    gost
    idea
    legacy
    makedepend
    md4
    mdc2
    module
    multiblock
    nextprotoneg
    ocb
    ocsp
    padlockeng
    pic
    pinshared
    poly1305
    posix-io
    psk
    rc2
    rc4
    rdrand
    rfc3779
    rmd160
    scrypt
    secure-memory
    seed
    siphash
    siv
    sm2
    sm3
    sm4
    sock
    srp
    srtp
    sse2
    ssl
    ssl-trace
    static-engine
    stdio
    threads
    tls
    ts
    ui-console
    whirlpool
    zlib
    tls1
    tls1-method
    tls1_1
    tls1_1-method
    tls1_2
    tls1_2-method
    tls1_3
    dtls1
    dtls1-method
    dtls1_2
    dtls1_2-method

Disabled features:

    afalgeng            [not-linux] OPENSSL_NO_AFALGENG
    asan                [default]   OPENSSL_NO_ASAN
    buildtest-c++       [default]
    crypto-mdebug       [default]   OPENSSL_NO_CRYPTO_MDEBUG
    devcryptoeng        [default]   OPENSSL_NO_DEVCRYPTOENG
    dynamic-engine      [cascade]
    ec_nistp_64_gcc_128 [default]   OPENSSL_NO_EC_NISTP_64_GCC_128
    egd                 [default]   OPENSSL_NO_EGD
    external-tests      [default]   OPENSSL_NO_EXTERNAL_TESTS
    fuzz-afl            [default]   OPENSSL_NO_FUZZ_AFL
    fuzz-libfuzzer      [default]   OPENSSL_NO_FUZZ_LIBFUZZER
    ktls                [default]   OPENSSL_NO_KTLS
    loadereng           [cascade]   OPENSSL_NO_LOADERENG
    md2                 [default]   OPENSSL_NO_MD2 (skip crypto\md2)
    msan                [default]   OPENSSL_NO_MSAN
    rc5                 [default]   OPENSSL_NO_RC5 (skip crypto\rc5)
    sctp                [default]   OPENSSL_NO_SCTP
    shared              [option]
    tests               [option]    OPENSSL_NO_TESTS
    trace               [default]   OPENSSL_NO_TRACE
    ubsan               [default]   OPENSSL_NO_UBSAN
    unit-test           [option]    OPENSSL_NO_UNIT_TEST
    uplink              [cascade]   OPENSSL_NO_UPLINK
    weak-ssl-ciphers    [default]   OPENSSL_NO_WEAK_SSL_CIPHERS
    zlib-dynamic        [default]
    ssl3                [default]   OPENSSL_NO_SSL3
    ssl3-method         [default]   OPENSSL_NO_SSL3_METHOD

Config target attributes:

    AR => "lib",
    ARFLAGS => "/nologo",
    AS => "nasm",
    ASFLAGS => "-g",
    CC => "cl",
    CFLAGS => "/W3 /wd4090 /nologo /O2",
    CPP => "\"\$(CC)\" /EP /C",
    CXX => "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/bin/Hostx64/x64/cl.exe",
    CXXFLAGS => "/W3 /wd4090 /nologo /O2",
    HASHBANGPERL => "/usr/bin/env perl",
    LD => "link",
    LDFLAGS => "/nologo /debug",
    MT => "mt",
    MTFLAGS => "-nologo",
    RANLIB => "CODE(0x27e3140)",
    RC => "rc",
    ar_resp_delim => "
",
    aroutflag => "/out:",
    asflags => "-Ox -f win64 -DNEAR",
    asm_arch => "x86_64",
    asoutflag => "-o ",
    bin_cflags => "/Zi /Fdapp.pdb /MD",
    bin_lflags => "setargv.obj /subsystem:console /opt:ref",
    bn_ops => "SIXTY_FOUR_BIT",
    build_file => "makefile",
    build_scheme => [ "unified", "windows", "VC-common" ],
    cflags => "/Gs0 /GF /Gy -O2 -Ob2 -MD",
    coutflag => "/Fo",
    cppflags => "",
    cxxflags => "-O2 -Ob2 -MD",
    defines => [ "OPENSSL_BUILDING_OPENSSL", "ZLIB", "OPENSSL_SYS_WIN32", "WIN32_LEAN_AND_MEAN", "UNICODE", "_UNICODE", "_CRT_SECURE_NO_DEPRECATE", "_WINSOCK_DEPRECATED_NO_WARNINGS", "NDEBUG" ],
    disable => [  ],
    dso_cflags => "/Zi /Fddso.pdb",
    dso_scheme => "win32",
    enable => [  ],
    ex_libs => "C:/Users/mathiaseggert/.conan/data/zlib/1.2.12/_/_/package/5a61a86bb3e07ce4262c80e1510f9c05e9b6d48b/lib/zlib.lib ws2_32.lib gdi32.lib advapi32.lib crypt32.lib user32.lib",
    includes => [ "C:/Users/mathiaseggert/.conan/data/zlib/1.2.12/_/_/package/5a61a86bb3e07ce4262c80e1510f9c05e9b6d48b/include", "C:/Users/mathiaseggert/.conan/data/zlib/1.2.12/_/_/package/5a61a86bb3e07ce4262c80e1510f9c05e9b6d48b/include" ],
    ld_implib_flag => "/implib:",
    ld_resp_delim => "
",
    lddefflag => "/def:",
    ldoutflag => "/out:",
    ldpostoutflag => "",
    ldresflag => " ",
    lflags => "",
    lib_cflags => "/Zi /Fdossl_static.pdb /MD /Zl",
    lib_cppflags => "",
    lib_defines => [ "L_ENDIAN" ],
    makedep_scheme => "VC",
    makedepcmd => "\"\$(CC)\" /Zs /showIncludes",
    module_cflags => "",
    module_cxxflags => undef,
    module_ldflags => "/dll",
    mtinflag => "-manifest ",
    mtoutflag => "-outputresource:",
    multilib => "-x64",
    perl_platform => "Windows::MSVC",
    perlasm_scheme => "auto",
    rcoutflag => "/fo",
    shared_cflag => "",
    shared_defflag => "",
    shared_defines => [  ],
    shared_ldflag => "/dll",
    shared_rcflag => "",
    shared_target => "win-shared",
    sys_id => "WIN64A",
    thread_defines => [  ],
    thread_scheme => "winthreads",
    unistd => "<unistd.h>",
    uplink_arch => "x86_64",

Recorded environment:

    AR =
    ARFLAGS =
    AS =
    ASFLAGS =
    BUILDFILE =
    CC =
    CFLAGS =
    CPP =
    CPPDEFINES =
    CPPFLAGS =
    CPPINCLUDES =
    CROSS_COMPILE =
    CXX = C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/bin/Hostx64/x64/cl.exe
    CXXFLAGS =
    HASHBANGPERL =
    LD =
    LDFLAGS =
    LDLIBS =
    MT =
    MTFLAGS =
    OPENSSL_LOCAL_CONFIG_DIR =
    PERL = C:\.conan\fcf9d5\1\bin\perl.exe
    RANLIB =
    RC = "C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\rc.exe"
    RCFLAGS =
    RM =
    __CNF_CFLAGS =
    __CNF_CPPDEFINES =
    __CNF_CPPFLAGS =
    __CNF_CPPINCLUDES =
    __CNF_CXXFLAGS =
    __CNF_LDFLAGS =
    __CNF_LDLIBS =

Makevars:

    AR              = lib
    ARFLAGS         = /nologo
    AS              = nasm
    ASFLAGS         = -g
    CC              = cl
    CFLAGS          = /W3 /wd4090 /nologo /O2
    CPP             = "$(CC)" /EP /C
    CPPDEFINES      =
    CPPFLAGS        =
    CPPINCLUDES     =
    CXX             = C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/bin/Hostx64/x64/cl.exe
    CXXFLAGS        = /W3 /wd4090 /nologo /O2
    HASHBANGPERL    = C:\.conan\fcf9d5\1\bin\perl.exe
    LD              = link
    LDFLAGS         = /nologo /debug
    LDLIBS          =
    MT              = mt
    MTFLAGS         = -nologo
    PERL            = C:\.conan\fcf9d5\1\bin\perl.exe
    RC              = "C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64\rc.exe"
    RCFLAGS         =

NOTE: These variables only represent the configuration view.  The build file
template may have processed these variables further, please have a look at the
build file for more exact data:
    makefile

build file:

    makefile

build file templates:

    Configurations\common0.tmpl
    Configurations\windows-makefile.tmpl
@Trafo Trafo added the bug Something isn't working label May 12, 2022
@Trafo Trafo changed the title [package] <openssl>/<3.0.3>: can not be built under Windows 11 (Visual Studio 11) [package] openssl/3.0.3: can not be built under Windows 11 (Visual Studio 11) May 12, 2022
@SpaceIm
Copy link
Contributor

SpaceIm commented May 12, 2022

OpenSSL developers are claiming that this RC is set by the Conan script. Sadly just looking into the Conan script, I don't see where it is done.

Maybe from

@contextlib.contextmanager
def _make_context(self):
if self._use_nmake:
# Windows: when cmake generates its cache, it populates some environment variables as well.
# If cmake also initiates openssl build, their values (containing spaces and forward slashes)
# break nmake (don't know about mingw make). So we fix them
def sanitize_env_var(var):
return '"{}"'.format(var).replace('/', '\\') if '"' not in var else var
env = {key: sanitize_env_var(tools.get_env(key)) for key in ("CC", "RC") if tools.get_env(key)}
with tools.environment_append(env):
yield
else:
yield

It has been added in openssl 1.1.1x branch by #5441, then kept when 3.x.x branch was created.

@jahnf
Copy link

jahnf commented Feb 16, 2023

@Trafo Did you happen to get a successful build? I ran into the same issue with Visual Studio 2022 on Windows 11 with OpenSSL 3.0.7 recently. Is there a workaround?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants