microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
22.67k stars 6.27k forks source link

[openssl:arm64-android] openssl for android build failure #33881

Closed SoftdriveFelix closed 11 months ago

SoftdriveFelix commented 11 months ago

Operating system

Windows vcpkg commit: 4cfabe769eaceb209ea37267e8c50c43b86a4a7b

Compiler

Clang (android ndk26)

Steps to reproduce the behavior

`vcpkg install openssl --triplet arm64-android`

Failure logs

-- Using cached openssl-openssl-openssl-3.1.2.tar.gz.
-- Cleaning sources at C:/vcpkg/buildtrees/openssl/src/nssl-3.1.2-a1adf9ea87.clean. Use --editable to skip cleaning for the packages you specify.
-- Extracting source C:/vcpkg/downloads/openssl-openssl-openssl-3.1.2.tar.gz
-- Applying patch arm64-asm.patch
-- Applying patch disable-apps.patch
-- Applying patch disable-install-docs.patch
-- Applying patch script-prefix.patch
-- Applying patch windows/install-layout.patch
-- Applying patch windows/install-pdbs.patch
-- Applying patch windows/perlasm-scheme.patch
-- Applying patch unix/android-cc.patch
-- Applying patch unix/move-openssldir.patch
-- Applying patch unix/no-empty-dirs.patch
-- Applying patch unix/no-static-libs-for-shared.patch
-- Using source at C:/vcpkg/buildtrees/openssl/src/nssl-3.1.2-a1adf9ea87.clean
-- Using cached msys2-make-4.4.1-1-x86_64.pkg.tar.zst.
-- Using cached msys2-perl-5.36.0-1-x86_64.pkg.tar.zst.
-- Using cached msys2-bash-5.2.015-1-x86_64.pkg.tar.zst.
-- Using cached msys2-coreutils-8.32-5-x86_64.pkg.tar.zst.
-- Using cached msys2-file-5.44-5-x86_64.pkg.tar.zst.
-- Using cached msys2-gawk-5.2.1-2-x86_64.pkg.tar.zst.
-- Using cached msys2-grep-1~3.0-6-x86_64.pkg.tar.zst.
-- Using cached msys2-gzip-1.12-2-x86_64.pkg.tar.zst.
-- Using cached msys2-diffutils-3.9-1-x86_64.pkg.tar.zst.
-- Using cached msys2-pkgconf-1.9.4-1-x86_64.pkg.tar.zst.
-- Using cached msys2-sed-4.9-1-x86_64.pkg.tar.zst.
-- Using cached msys2-msys2-runtime-3.4.6-1-x86_64.pkg.tar.zst.
-- Using cached msys2-libintl-0.21-2-x86_64.pkg.tar.zst.
-- Using cached msys2-libcrypt-2.1-4-x86_64.pkg.tar.zst.
-- Using cached msys2-libiconv-1.17-1-x86_64.pkg.tar.zst.
-- Using cached msys2-gmp-6.2.1-2-x86_64.pkg.tar.zst.
-- Using cached msys2-gcc-libs-11.3.0-3-x86_64.pkg.tar.zst.
-- Using cached msys2-libbz2-1.0.8-4-x86_64.pkg.tar.zst.
-- Using cached msys2-liblzma-5.4.1-1-x86_64.pkg.tar.zst.
-- Using cached msys2-libzstd-1.5.4-1-x86_64.pkg.tar.zst.
-- Using cached msys2-zlib-1.2.13-1-x86_64.pkg.tar.zst.
-- Using cached msys2-libreadline-8.2.001-3-x86_64.pkg.tar.zst.
-- Using cached msys2-mpfr-4.2.0-2-x86_64.pkg.tar.zst.
-- Using cached msys2-libpcre-8.45-3-x86_64.pkg.tar.zst.
-- Using cached msys2-ncurses-6.4-1-x86_64.pkg.tar.zst.
-- Using msys root at C:/vcpkg/downloads/tools/msys2/7695e693b092e6c7
-- Getting CMake variables for arm64-android
-- Getting CMake variables for arm64-android
-- Using cached msys2-autoconf-wrapper-20221207-1-any.pkg.tar.zst.
-- Using cached msys2-automake-wrapper-20221207-1-any.pkg.tar.zst.
-- Using cached msys2-binutils-2.40-1-x86_64.pkg.tar.zst.
-- Using cached msys2-libtool-2.4.7-3-x86_64.pkg.tar.zst.
-- Using cached msys2-make-4.4.1-1-x86_64.pkg.tar.zst.
-- Using cached msys2-pkgconf-1.9.4-1-x86_64.pkg.tar.zst.
-- Using cached msys2-which-2.21-4-x86_64.pkg.tar.zst.
-- Using cached msys2-bash-5.2.015-1-x86_64.pkg.tar.zst.
-- Using cached msys2-coreutils-8.32-5-x86_64.pkg.tar.zst.
-- Using cached msys2-file-5.44-5-x86_64.pkg.tar.zst.
-- Using cached msys2-gawk-5.2.1-2-x86_64.pkg.tar.zst.
-- Using cached msys2-grep-1~3.0-6-x86_64.pkg.tar.zst.
-- Using cached msys2-gzip-1.12-2-x86_64.pkg.tar.zst.
-- Using cached msys2-diffutils-3.9-1-x86_64.pkg.tar.zst.
-- Using cached msys2-sed-4.9-1-x86_64.pkg.tar.zst.
-- Using cached msys2-msys2-runtime-3.4.6-1-x86_64.pkg.tar.zst.
-- Using cached msys2-autoconf2.71-2.71-1-any.pkg.tar.zst.
-- Using cached msys2-automake1.16-1.16.5-1-any.pkg.tar.zst.
-- Using cached msys2-libiconv-1.17-1-x86_64.pkg.tar.zst.
-- Using cached msys2-libintl-0.21-2-x86_64.pkg.tar.zst.
-- Using cached msys2-zlib-1.2.13-1-x86_64.pkg.tar.zst.
-- Using cached msys2-tar-1.34-3-x86_64.pkg.tar.zst.
-- Using cached msys2-findutils-4.9.0-3-x86_64.pkg.tar.zst.
-- Using cached msys2-gmp-6.2.1-2-x86_64.pkg.tar.zst.
-- Using cached msys2-gcc-libs-11.3.0-3-x86_64.pkg.tar.zst.
-- Using cached msys2-libbz2-1.0.8-4-x86_64.pkg.tar.zst.
-- Using cached msys2-liblzma-5.4.1-1-x86_64.pkg.tar.zst.
-- Using cached msys2-libzstd-1.5.4-1-x86_64.pkg.tar.zst.
-- Using cached msys2-libreadline-8.2.001-3-x86_64.pkg.tar.zst.
-- Using cached msys2-mpfr-4.2.0-2-x86_64.pkg.tar.zst.
-- Using cached msys2-libpcre-8.45-3-x86_64.pkg.tar.zst.
-- Using cached msys2-m4-1.4.19-2-x86_64.pkg.tar.zst.
-- Using cached msys2-perl-5.36.0-1-x86_64.pkg.tar.zst.
-- Using cached msys2-ncurses-6.4-1-x86_64.pkg.tar.zst.
-- Using cached msys2-libcrypt-2.1-4-x86_64.pkg.tar.zst.
-- Using msys root at C:/vcpkg/downloads/tools/msys2/d7266db249278763
-- Using cached mingw-w64-i686-pkgconf-1~1.8.0-2-any.pkg.tar.zst.
-- Using cached msys2-msys2-runtime-3.4.6-1-x86_64.pkg.tar.zst.
-- Using msys root at C:/vcpkg/downloads/tools/msys2/6f3fa1a12ef85a6f
-- Configuring arm64-android-dbg
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:112 (message):
    Command failed: C:/vcpkg/downloads/tools/msys2/d7266db249278763/usr/bin/bash.exe --noprofile --norc --debug -c "V=1 ./../src/nssl-3.1.2-a1adf9ea87.clean/vcpkg/configure --host=aarch64-linux-android \"C:/vcpkg/downloads/tools/msys2/7695e693b092e6c7/usr/bin/perl.exe\" \"C:/vcpkg/buildtrees/openssl/src/nssl-3.1.2-a1adf9ea87.clean/Configure\" \"android-\" \"enable-static-engine\" \"enable-capieng\" \"no-ssl3\" \"no-weak-ssl-ciphers\" \"no-tests\" \"no-shared\" \"no-module\" \"no-apps\" \"--openssldir=/etc/ssl\" \"--libdir=lib\" \"--disable-silent-rules\" \"--verbose\" \"--disable-shared\" \"--enable-static\" \"--debug\" \"--prefix=/C/vcpkg/installed/arm64-android/debug\""
    Working Directory: C:/vcpkg/buildtrees/openssl/arm64-android-dbg
    Error code: 1
    See logs for more information:
      C:\vcpkg\buildtrees\openssl\config-arm64-android-dbg-out.log
      C:\vcpkg\buildtrees\openssl\config-arm64-android-dbg-err.log

Call Stack (most recent call first):
  scripts/cmake/vcpkg_configure_make.cmake:838 (vcpkg_execute_required_process)
  ports/openssl/unix/portfile.cmake:104 (vcpkg_configure_make)
  ports/openssl/portfile.cmake:73 (include)
  scripts/ports.cmake:147 (include)

config-arm64-android-dbg-err.log config-arm64-android-dbg-out.log

config-arm64-android-dbg-err.log ``` + C:/vcpkg/downloads/tools/msys2/7695e693b092e6c7/usr/bin/perl.exe C:/vcpkg/buildtrees/openssl/src/nssl-3.1.2-a1adf9ea87.clean/Configure android- enable-static-engine enable-capieng no-ssl3 no-weak-ssl-ciphers no-tests no-shared no-module no-apps --openssldir=/etc/ssl --libdir=lib --debug --prefix=/C/vcpkg/installed/arm64-android/debug Usage: Configure [no- ...] [enable- ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [[no-]threads] [[no-]shared] [[no-]zlib|zlib-dynamic] [no-asm] [no-egd] [sctp] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--config=FILE] os/compiler[:flags] pick os/compiler from: BC-32 BS2000-OSD BSD-aarch64 BSD-armv4 BSD-generic32 BSD-generic64 BSD-ia64 BSD-ppc BSD-ppc64 BSD-ppc64le BSD-riscv32 BSD-riscv64 BSD-sparc64 BSD-sparcv8 BSD-x86 BSD-x86-elf BSD-x86_64 Cygwin Cygwin-i386 Cygwin-i486 Cygwin-i586 Cygwin-i686 Cygwin-x86 Cygwin-x86_64 DJGPP MPE/iX-gcc OS390-Unix UEFI UEFI-x86 UEFI-x86_64 UWIN VC-CE VC-CLANG-WIN64-CLANGASM-ARM VC-WIN32 VC-WIN32-ARM VC-WIN32-ARM-UWP VC-WIN32-ONECORE VC-WIN32-UWP VC-WIN64-ARM VC-WIN64-ARM-UWP VC-WIN64-CLANGASM-ARM VC-WIN64A VC-WIN64A-ONECORE VC-WIN64A-UWP VC-WIN64A-masm VC-WIN64I aix-cc aix-gcc aix64-cc aix64-gcc aix64-gcc-as android-arm android-arm64 android-armeabi android-mips android-mips64 android-x86 android-x86_64 android64 android64-aarch64 android64-mips64 android64-x86_64 bsdi-elf-gcc cc darwin-i386 darwin-i386-cc darwin-ppc darwin-ppc-cc darwin64-arm64 darwin64-arm64-cc darwin64-ppc darwin64-ppc-cc darwin64-x86_64 darwin64-x86_64-cc gcc haiku-x86 haiku-x86_64 hpux-ia64-cc hpux-ia64-gcc hpux-parisc-cc hpux-parisc-gcc hpux-parisc1_1-cc hpux-parisc1_1-gcc hpux64-ia64-cc hpux64-ia64-gcc hpux64-parisc2-cc hpux64-parisc2-gcc hurd-x86 ios-cross ios-xcrun ios64-cross ios64-xcrun iossimulator-xcrun iphoneos-cross irix-mips3-cc irix-mips3-gcc irix64-mips4-cc irix64-mips4-gcc linux-aarch64 linux-alpha-gcc linux-aout linux-arm64ilp32 linux-armv4 linux-c64xplus linux-elf linux-generic32 linux-generic64 linux-ia64 linux-latomic linux-mips32 linux-mips64 linux-ppc linux-ppc64 linux-ppc64le linux-sparcv8 linux-sparcv9 linux-x32 linux-x86 linux-x86-clang linux-x86_64 linux-x86_64-clang linux32-riscv32 linux32-s390x linux64-loongarch64 linux64-mips64 linux64-riscv64 linux64-s390x linux64-sparcv9 mingw mingw64 nonstop-nse nonstop-nse_64 nonstop-nse_64_put nonstop-nse_g nonstop-nse_g_tandem nonstop-nse_put nonstop-nse_spt nonstop-nse_spt_floss nonstop-nsv nonstop-nsx nonstop-nsx_64 nonstop-nsx_64_put nonstop-nsx_g nonstop-nsx_g_tandem nonstop-nsx_put nonstop-nsx_spt nonstop-nsx_spt_floss sco5-cc sco5-gcc solaris-sparcv7-cc solaris-sparcv7-gcc solaris-sparcv8-cc solaris-sparcv8-gcc solaris-sparcv9-cc solaris-sparcv9-gcc solaris-x86-gcc solaris64-sparcv9-cc solaris64-sparcv9-gcc solaris64-x86_64-cc solaris64-x86_64-gcc tru64-alpha-cc tru64-alpha-gcc uClinux-dist uClinux-dist64 unixware-2.0 unixware-2.1 unixware-7 unixware-7-gcc vms-alpha vms-alpha-p32 vms-alpha-p64 vms-ia64 vms-ia64-p32 vms-ia64-p64 vms-x86_64 vms-x86_64-cross-ia64 vos-gcc vxworks-mips vxworks-ppc405 vxworks-ppc60x vxworks-ppc750 vxworks-ppc750-debug vxworks-ppc860 vxworks-ppcgen vxworks-simlinux ```
config-arm64-android-dbg-out.log ``` Configuring OpenSSL version 3.1.2 for target android- Using os-specific seed configuration ```

Additional context

When I try to run the command that failed C:/vcpkg/downloads/tools/msys2/d7266db249278763/usr/bin/bash.exe --noprofile --norc --debug -c "V=1 ./../src/nssl-3.1.2-a1adf9ea87.clean/vcpkg/configure --host=aarch64-linux-android \"C:/vcpkg/downloads/tools/msys2/7695e693b092e6c7/usr/bin/perl.exe\" \"C:/vcpkg/buildtrees/openssl/src/nssl-3.1.2-a1adf9ea87.clean/Configure\" \"android-\" \"enable-static-engine\" \"enable-capieng\" \"no-ssl3\" \"no-weak-ssl-ciphers\" \"no-tests\" \"no-shared\" \"no-module\" \"no-apps\" \"--openssldir=/etc/ssl\" \"--libdir=lib\" \"--disable-silent-rules\" \"--verbose\" \"--disable-shared\" \"--enable-static\" \"--debug\" \"--prefix=/C/vcpkg/installed/arm64-android/debug\"" I get this error: \C:/vcpkg/buildtrees/openssl/src/nssl-3.1.2-a1adf9ea87.clean/Configure\: -c: line 1: unexpected EOF while looking for matching"'` Not too sure if it's related or not.

openssl:x64-android also fails.

I am able to install the windows variants of the library (openssl:x64-windows, openssl:x86-windows, etc).

I am able to build other arm64-android packages without issues. I currently have fmt, spdlog, boost-signals2, bzip2, catch2, glm, gtest, libguarded and nlohmann-json.

I have set $Env:ANDROID_NDK_HOME="C:\Android\ndk\26.0.10636728" before trying to install otherwise I would get an error.

dg0yt commented 11 months ago

For ports based on traditional make, VCPKG is incompatible with NDK r26, #33179. This is known since #31332.

Would be fixed by #31228 but this wasn't accepted. Must be fixed #33198. But I don't expect it to be stable soon.

Neumann-A commented 11 months ago

@dg0yt is it currently fixed by https://github.com/microsoft/vcpkg/pull/33198 ? I mean that PR is basically green. I just haven't come around writing tests for its behavior.

dg0yt commented 11 months ago

is it currently fixed by #33198 ? I mean that PR is basically green. I just haven't come around writing tests for its behavior.

I don't know. We need to test with NDK r26.

(I'm not concerned about making https://github.com/microsoft/vcpkg/pull/33198 a drop-in replacement for vcpkg_configure_make and friends, but about giving it an extensible interface now that allows to fix use case which vcpkg_configure_make is unable to handle at the moment. Once the port is merged, it will become impossible to make certain changes, such as changing an option from default-on to default-off. Maybe the functions should start as x_vcpkg_make_..., to signal interface instability to users writing their own ports.)

SoftdriveFelix commented 11 months ago

I can confirm that both #31228 and #33198 fix the issue. I tried both of them in a freshly pulled environment.

SoftdriveFelix commented 11 months ago

Hmmm... Actually it seems like a fresh vcpkg install of main also fixes the issue 🤔 I probably had a corrupt vcpkg environment