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

[libiconv] Fix android #30092

Merged
merged 2 commits into from
Mar 13, 2023
Merged

[libiconv] Fix android #30092

merged 2 commits into from
Mar 13, 2023

Conversation

dg0yt
Copy link
Contributor

@dg0yt dg0yt commented Mar 8, 2023

Fixes #29719. Fixes #27304.

  • Changes comply with the maintainer guide
  • SHA512s are updated for each updated download
  • The "supports" clause reflects platforms that may be fixed by this new version
  • Any fixed CI baseline entries are removed from that file.
  • Any patches that are no longer applied are deleted from the port's directory.
  • The version database is fixed by rerunning ./vcpkg x-add-version --all and committing the result.
  • Only one version is added to each modified port's versions file.

@Adela0814 Adela0814 removed the request for review from JonLiu1993 March 9, 2023 02:01
@JonLiu1993 JonLiu1993 added the category:community-triplet A PR or issue related to community triplets not officially validated by the vcpkg team. label Mar 9, 2023
@JonLiu1993 JonLiu1993 added the info:reviewed Pull Request changes follow basic guidelines label Mar 9, 2023
@JonLiu1993
Copy link
Member

@hushanjushi, could you please test it on your environment and see if it solves your problem?

@JonLiu1993 JonLiu1993 removed the info:reviewed Pull Request changes follow basic guidelines label Mar 9, 2023
@dg0yt
Copy link
Contributor Author

dg0yt commented Mar 9, 2023

@JonLiu1993 The problems were reproducible, the PR does fix it, and the same fix is now already merged for libtasn1. No need to hold this back.

@JonLiu1993 JonLiu1993 added the info:reviewed Pull Request changes follow basic guidelines label Mar 10, 2023
@hushanjushi
Copy link

hushanjushi commented Mar 10, 2023

@hushanjushi, could you please test it on your environment and see if it solves your problem?

I tested and found a puzzling error:

configure: error: in `/home/test/tools/test/vcpkg/buildtrees/libiconv/x64-android-dbg':
configure: error: C compiler cannot create executables

I clone dg0yt:libiconv and input:

./vcpkg install libiconv --triplet=x64-android

I have set Android-ndk and can compile other packages.. Confused... Only I can ensure is configure error.

@hushanjushi
Copy link

@JonLiu1993 The problems were reproducible, the PR does fix it, and the same fix is now already merged for libtasn1. No need to hold this back.

I met some problems when tests this pr...

@dg0yt
Copy link
Contributor Author

dg0yt commented Mar 10, 2023

@hushanjushi Share your config.log from buildtrees/libiconv/x64-android-dbg.

@hushanjushi
Copy link

@hushanjushi Share your config.log from buildtrees/libiconv/x64-android-dbg.

config.log

@dg0yt
Copy link
Contributor Author

dg0yt commented Mar 10, 2023

configure:4218: checking whether the C compiler works
configure:4240: gcc -g -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wformat -Werror=format-security -fPIC -fno-limit-debug-info -DANDROID -D_FORTIFY_SOURCE=2 -avoid-version   conftest.c -latomic -lm >&5
gcc: error: unrecognized command-line option '-fno-limit-debug-info'
gcc: error: unrecognized command-line option '-avoid-version'; did you mean '-fno-version'?

Not a NDK compiler.

ac_cv_env_CC_set=
ac_cv_env_CC_value=

vcpkg scripts set environment variable CC to the compiler which is detected by CMake, but here it is empty. Did you modify your environment?

This PR changes source files, but not the build system. Your current problem is unrelated to this PR.

@hushanjushi
Copy link

hushanjushi commented Mar 10, 2023

configure:4218: checking whether the C compiler works
configure:4240: gcc -g -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wformat -Werror=format-security -fPIC -fno-limit-debug-info -DANDROID -D_FORTIFY_SOURCE=2 -avoid-version   conftest.c -latomic -lm >&5
gcc: error: unrecognized command-line option '-fno-limit-debug-info'
gcc: error: unrecognized command-line option '-avoid-version'; did you mean '-fno-version'?

Not a NDK compiler.

ac_cv_env_CC_set=
ac_cv_env_CC_value=

vcpkg scripts set environment variable CC to the compiler which is detected by CMake, but here it is empty. Did you modify your environment?

This PR changes source files, but not the build system. Your current problem is unrelated to this PR.

I don't change the environment. ./vcpkg install gsl sqlite3 --triplet=x64-android can work in pr version vcpkg...

And libtasn1 show same information. It can't find NDK compiler,too...

Is vcpkg only need ANDROID_NDK_HOME?

@JonLiu1993 JonLiu1993 removed the info:reviewed Pull Request changes follow basic guidelines label Mar 10, 2023
@dg0yt
Copy link
Contributor Author

dg0yt commented Mar 10, 2023

All my recent testing is with setting ANDROID_NDK_HOME only.
gsl uses CMake only.
libiconv and libtasn1 use autotools build system. vcpkg needs to pass in certain setting via environment variables. It determines the actual values by configuring a small CMake project first. This is where the cmake log files come from. Here, we should get the same variables as with gsl. Files of interest:
cmake-vars-arm-android-dbg.cmake.log : selected preprocessed variables
get-cmake-vars-arm-android-dbg-CMakeCache.txt.log : cached variables from CMake configuration

@hushanjushi
Copy link

All my recent testing is with setting ANDROID_NDK_HOME only. gsl uses CMake only. libiconv and libtasn1 use autotools build system. vcpkg needs to pass in certain setting via environment variables. It determines the actual values by configuring a small CMake project first. This is where the cmake log files come from. Here, we should get the same variables as with gsl. Files of interest: cmake-vars-arm-android-dbg.cmake.log : selected preprocessed variables get-cmake-vars-arm-android-dbg-CMakeCache.txt.log : cached variables from CMake configuration

I try again, but very confusing, fail, too.

@hushanjushi
Copy link

hushanjushi commented Mar 10, 2023

cmake-vars-arm-android-dbg.cmake.log

All my recent testing is with setting ANDROID_NDK_HOME only. gsl uses CMake only. libiconv and libtasn1 use autotools build system. vcpkg needs to pass in certain setting via environment variables. It determines the actual values by configuring a small CMake project first. This is where the cmake log files come from. Here, we should get the same variables as with gsl. Files of interest: cmake-vars-arm-android-dbg.cmake.log : selected preprocessed variables get-cmake-vars-arm-android-dbg-CMakeCache.txt.log : cached variables from CMake configuration

cmake-vars-x64-android-dbg.cmake.log

no found get-cmake-vars-x64-android-dbg-CMakeCache.txt.log

only get-cmake-vars-x64-android-dbg-out.log

It seems like found ndk but no use?

@dg0yt
Copy link
Contributor Author

dg0yt commented Mar 10, 2023

It seems like found ndk but no use?

Yes, but this problem is not related to this PR.

As expected, CMake detects the right compiler:

set(VCPKG_DETECTED_CMAKE_C_COMPILER "/home/test/tools/Android/Sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/linux-x86_64/bin/clang")

Check the output of env. I guess you set CC to an empty value (maybe in an attempt to unset it). It might be ignored by CMake, but unfortunately it isn't by vcpkg scripts.

@hushanjushi
Copy link

hushanjushi commented Mar 10, 2023

It seems like found ndk but no use?

Yes, but this problem is not related to this PR.

As expected, CMake detects the right compiler:

set(VCPKG_DETECTED_CMAKE_C_COMPILER "/home/test/tools/Android/Sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/linux-x86_64/bin/clang")

Check the output of env. I guess you set CC to an empty value (maybe in an attempt to unset it). It might be ignored by CMake, but unfortunately it isn't by vcpkg scripts.

I understand. I try again...

I have set:

export CC=/usr/local/bin/gcc
export CXX=/usr/local/bin/g++

and link /usr/bin/cc and /usr/bin/c++, not work, same as before.

Should I set cc to ndk-clang? Yes. Work

@hushanjushi
Copy link

It seems like found ndk but no use?

Yes, but this problem is not related to this PR.

As expected, CMake detects the right compiler:

set(VCPKG_DETECTED_CMAKE_C_COMPILER "/home/test/tools/Android/Sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/linux-x86_64/bin/clang")

Check the output of env. I guess you set CC to an empty value (maybe in an attempt to unset it). It might be ignored by CMake, but unfortunately it isn't by vcpkg scripts.

Can vcpkg auto set it? Or we should set CC manually for autotools in recent days?

@dg0yt
Copy link
Contributor Author

dg0yt commented Mar 10, 2023

For now, you shall not set CC unless you want to override vcpkg autotools stuff (and deal with the effects).
Either unset it, or try what vcpkg would use, home/test/tools/Android/Sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/linux-x86_64/bin/clang.

(Whether vcpkg should ignore the user's CC is off-topic in this PR.)

@hushanjushi
Copy link

hushanjushi commented Mar 10, 2023

For now, you shall not set CC unless you want to override vcpkg autotools stuff (and deal with the effects). Either unset it, or try what vcpkg would use, home/test/tools/Android/Sdk/ndk/25.2.9519653/toolchains/llvm/prebuilt/linux-x86_64/bin/clang.

(Whether vcpkg should ignore the user's CC is off-topic in this PR.)

But I found CC unset will give me the not-found error... (Not ignore but i think if empty will use default cc in vcpkg? Not CC can't find is really strange)

@dg0yt
Copy link
Contributor Author

dg0yt commented Mar 10, 2023

You must sanitize your environment. I would prefer to no longer deal with these unrelated problems here.

@hushanjushi
Copy link

You must sanitize your environment. I would prefer to no longer deal with these unrelated problems here.

Ok. I fully understand it...

@hushanjushi
Copy link

hushanjushi commented Mar 10, 2023

You must sanitize your environment. I would prefer to no longer deal with these unrelated problems here.

In a new VM, it works. Thank you.

@JonLiu1993 JonLiu1993 added the info:reviewed Pull Request changes follow basic guidelines label Mar 10, 2023
@dan-shaw dan-shaw merged commit 4aac45c into microsoft:master Mar 13, 2023
@dg0yt dg0yt deleted the libiconv branch March 13, 2023 05:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:community-triplet A PR or issue related to community triplets not officially validated by the vcpkg team. info:reviewed Pull Request changes follow basic guidelines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[libiconv] build failure libiconv:arm64-android failed
4 participants