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

Problem with OpenSSL when trying to build sdk for Android #2531

Closed
protsenko85 opened this issue Jun 9, 2023 · 5 comments
Closed

Problem with OpenSSL when trying to build sdk for Android #2531

protsenko85 opened this issue Jun 9, 2023 · 5 comments
Assignees
Labels
bug This issue is a bug. closed-for-staleness duplicate This issue is a duplicate. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 10 days.

Comments

@protsenko85
Copy link

protsenko85 commented Jun 9, 2023

Describe the bug

I am using to build with ninja using arguments:
cmake ../aws-sdk-cpp -DNDK_DIR="C:\Users\prots\AppData\Local\Android\Sdk\ndk\21.4.7075529" -DBUILD_SHARED_LIBS=OFF -GNinja -DENABLE_TESTING=OFF -DCMAKE_BUILD_TYPE=Release -DCUSTOM_MEMORY_MANAGEMENT=ON -DTARGET_ARCH=ANDROID -DANDROID_NATIVE_API_LEVEL=21 -DBUILD_ONLY="identity-management;s3"

and receiving some problem with OpenSSL:

`[0/1] Install the project...
-- Install configuration: "Release"
CMake Error at cmake_install.cmake:54 (file):
  file cannot create directory: C:/Program Files
  (x86)/aws-cpp-sdk-all/external-install/zlib/lib.  Maybe need administrative
  privileges.


FAILED: CMakeFiles/install.util
cmd.exe /C "cd /D C:\_Projects\test-proj\build_sdk_android\external-build\ZLIB-prefix\src\ZLIB-build && "C:\Program Files\CMake\bin\cmake.exe" -P cmake_install.cmake"
ninja: build stopped: subcommand failed.
[3/16] Performing patch step for 'OPENSSL'
FAILED: OPENSSL-prefix/src/OPENSSL-stamp/OPENSSL-patch C:/_Projects/test-proj/build_sdk_android/external-build/OPENSSL-prefix/src/OPENSSL-stamp/OPENSSL-patch
cmd.exe /C "cd /D C:\_Projects\test-proj\build_sdk_android\openssl-src && cd C:/_Projects/test-proj/build_sdk_android/external-build && python C:/_Projects/test-proj/aws-sdk-cpp/tools/android-build/configure_openssl_cmake.py --source C:/_Projects/test-proj/aws-sdk-cpp --dest C:/_Projects/test-proj/build_sdk_android/openssl-src && "C:\Program Files\CMake\bin\cmake.exe" -E touch C:/_Projects/test-proj/build_sdk_android/external-build/OPENSSL-prefix/src/OPENSSL-stamp/OPENSSL-patch"
Python
ninja: build stopped: subcommand failed.
CMake Error at cmake/build_external.cmake:148 (message):
  Failed to build dependency libraries.
Call Stack (most recent call first):
  CMakeLists.txt:198 (include)

-- Configuring incomplete, errors occurred!`

I had issue Failed to configure dependency libraries. previously but i fixed this with solution: #2452 (comment)

But for this I can't find a solution. Can someone help me?

Expected Behavior

Compile successfully

Current Behavior

An error with OpelSSL

Reproduction Steps

Trying to compile SDK using instructions: https://aws.amazon.com/ru/blogs/developer/setting-up-an-android-application-with-aws-sdk-for-c/

Possible Solution

No response

Additional Information/Context

No response

AWS CPP SDK version used

1.11.95

Compiler and Version used

Ninja

Operating System and version

Windows 11

@protsenko85 protsenko85 added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jun 9, 2023
@yasminetalby yasminetalby self-assigned this Jun 9, 2023
@yasminetalby yasminetalby added the investigating This issue is being investigated and/or work is in progress to resolve the issue. label Jun 9, 2023
@yasminetalby
Copy link
Contributor

Hello @protsenko85 ,

Thank you very much for your submission.

First, I see that you encounter

CMake Error at cmake_install.cmake:54 (file):
file cannot create directory: C:/Program Files
(x86)/aws-cpp-sdk-all/external-install/zlib/lib. Maybe need administrative
privileges.

Have you attempted to use CMAKE_INSTALL_PREFIX as suggested by the blogpost linked in your submission: https://aws.amazon.com/ru/blogs/developer/setting-up-an-android-application-with-aws-sdk-for-c/ ?

Best,

Yasmine

@yasminetalby yasminetalby added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 10 days. and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. needs-triage This issue or PR still needs to be triaged. labels Jun 9, 2023
@github-actions
Copy link

Greetings! It looks like this issue hasn’t been active in longer than a week. We encourage you to check if this is still an issue in the latest release. Because it has been longer than a week since the last update on this, and in the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or add an upvote to prevent automatic closure, or if the issue is already closed, please feel free to open a new one.

@github-actions github-actions bot added the closing-soon This issue will automatically close in 4 days unless further comments are made. label Jun 12, 2023
@protsenko85
Copy link
Author

@yasminetalby
Yeah, I tried to use [CMAKE_INSTALL_PREFIX], but it doen't change anything
Maybe need administrative privileges. error was caused by the fact that I started the command prompt without administrator privileges. Now i fixed it and there is no error

Now i'm using cmake command
cmake ../aws-sdk-cpp -DNDK_DIR="C:\Users\prots\AppData\Local\Android\Sdk\ndk\21.4.7075529" -DBUILD_SHARED_LIBS=OFF -G "Ninja" -DENABLE_TESTING=OFF -DCMAKE_BUILD_TYPE=Release -DCUSTOM_MEMORY_MANAGEMENT=ON -DTARGET_ARCH=ANDROID -DANDROID_NATIVE_API_LEVEL=21 -DBUILD_ONLY="identity-management;s3" -DCMAKE_INSTALL_PREFIX="C:\_Projects\test_proj\install_sdk_android"
and still have error with openSSL:

[40/40] Linking C static library libz.a
[8/24] Performing install step for 'ZLIB'
[0/1] Install the project...
-- Install configuration: "Release"
-- Installing: C:/_Projects/test_proj/install_sdk_android/external-install/zlib/lib/libz.so
-- Installing: C:/_Projects/test_proj/install_sdk_android/external-install/zlib/lib/libz.a
-- Installing: C:/_Projects/test_proj/install_sdk_android/external-install/zlib/include/zconf.h
-- Installing: C:/_Projects/test_proj/install_sdk_android/external-install/zlib/include/zlib.h
-- Installing: C:/_Projects/test_proj/install_sdk_android/external-install/zlib/share/man/man3/zlib.3
-- Installing: C:/_Projects/test_proj/install_sdk_android/external-install/zlib/share/pkgconfig/zlib.pc
[9/24] Completed 'ZLIB'
[10/24] Performing download step (git clone) for 'OPENSSL'
Cloning into 'openssl-src'...
HEAD is now at e2e09d9fba Prepare for 1.1.1g release
Submodule 'boringssl' (https://boringssl.googlesource.com/boringssl) registered for path 'boringssl'
Submodule 'krb5' (https://github.com/krb5/krb5) registered for path 'krb5'
Submodule 'pyca.cryptography' (https://github.com/pyca/cryptography.git) registered for path 'pyca-cryptography'
Cloning into 'C:/_Projects/test_proj/build_sdk_android/openssl-src/boringssl'...
Cloning into 'C:/_Projects/test_proj/build_sdk_android/openssl-src/krb5'...
Cloning into 'C:/_Projects/test_proj/build_sdk_android/openssl-src/pyca-cryptography'...
Submodule path 'boringssl': checked out '2070f8ad9151dc8f3a73bffaa146b5e6937a583f'
Submodule path 'krb5': checked out '890ca2f401924cdcb88f493950b04700bbe52db3'
Submodule path 'pyca-cryptography': checked out '09403100de2f6f1cdd0d484dcb8e620f1c335c8f'
[11/24] No update step for 'OPENSSL'
[12/24] Performing patch step for 'OPENSSL'
FAILED: OPENSSL-prefix/src/OPENSSL-stamp/OPENSSL-patch C:/_Projects/test_proj/build_sdk_android/external-build/OPENSSL-prefix/src/OPENSSL-stamp/OPENSSL-patch
cmd.exe /C "cd /D C:\_Projects\test_proj\build_sdk_android\openssl-src && cd C:/_Projects/test_proj/build_sdk_android/external-build && python C:/_Projects/test_proj/aws-sdk-cpp/tools/android-build/configure_openssl_cmake.py --source C:/_Projects/test_proj/aws-sdk-cpp --dest C:/_Projects/test_proj/build_sdk_android/openssl-src && "C:\Program Files\CMake\bin\cmake.exe" -E touch C:/_Projects/test_proj/build_sdk_android/external-build/OPENSSL-prefix/src/OPENSSL-stamp/OPENSSL-patch"
Python
ninja: build stopped: subcommand failed.
CMake Error at cmake/build_external.cmake:148 (message):
  Failed to build dependency libraries.
Call Stack (most recent call first):
  CMakeLists.txt:198 (include)

@github-actions github-actions bot removed closing-soon This issue will automatically close in 4 days unless further comments are made. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 10 days. labels Jun 13, 2023
@yasminetalby
Copy link
Contributor

Hello @protsenko85 ,

Thank you very much for your response.

Yes, the suggestion was to use CMAKE_INSTALL_PREFIX to change path of installation and resolve the Maybe need administrative privilege issue.
Now that this is resolved, the first FAILED: CMakeFiles/install.util cmd.exe /C "cd /D C:\_Projects\test-proj\build_sdk_android\external-build\ZLIB-prefix\src\ZLIB-build && "C:\Program Files\CMake\bin\cmake.exe" -P cmake_install.cmake" ninja: build stopped: subcommand failed. doesn't occur.

For the second issue encountered here that is FAILED: OPENSSL-prefix/src/OPENSSL-stamp/OPENSSL-patch C:/_Projects/test-proj/build_sdk_android/external-build/OPENSSL-prefix/src/OPENSSL-stamp/OPENSSL-patch cmd.exe /C "cd /D C:\_Projects\test-proj\build_sdk_android\openssl-src && cd C:/_Projects/test-proj/build_sdk_android/external-build && python C:/_Projects/test-proj/aws-sdk-cpp/tools/android-build/configure_openssl_cmake.py --source C:/_Projects/test-proj/aws-sdk-cpp --dest C:/_Projects/test-proj/build_sdk_android/openssl-src && "C:\Program Files\CMake\bin\cmake.exe" -E touch C:/_Projects/test-proj/build_sdk_android/external-build/OPENSSL-prefix/src/OPENSSL-stamp/OPENSSL-patch" Python unfortunately, this is a known existing bug which is currently in the team's backlog (see).

The current known work around is to revert to use v1.8.186 of the AWS CPP SDK.

I will mark this issue as a duplicate of #1946 and bring this item up for discussion with the team.

Thank you very much for your feedback and collaboration.

Let me know if the current workaround works for you or if you have any further questions.

Best regards,

Yasmine

@yasminetalby yasminetalby added duplicate This issue is a duplicate. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 10 days. labels Jun 13, 2023
@github-actions
Copy link

Greetings! It looks like this issue hasn’t been active in longer than a week. We encourage you to check if this is still an issue in the latest release. Because it has been longer than a week since the last update on this, and in the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or add an upvote to prevent automatic closure, or if the issue is already closed, please feel free to open a new one.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Jun 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. closed-for-staleness duplicate This issue is a duplicate. response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 10 days.
Projects
None yet
Development

No branches or pull requests

2 participants