question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[package] xmlsec/1.2.30: Android build failed

See original GitHub issue

Package and Environment Details (include every applicable attribute)

  • Package Name/Version: xmlsec/1.2.30
  • Operating System+version: macOS Catalina (Android cross-build)
  • Compiler+version: clang 9
  • Conan version: conan 1.31.3
  • Python version: Python 3.7.4

Conan profile (output of conan profile show default or conan profile show <profile> if custom profile is in use)

[settings]
os_build=Macos
arch_build=x86_64

compiler=clang
compiler.version=9
compiler.libcxx=libc++

os=Android
os.api_level=21
arch=armv7
build_type=Release

[build_requires]
android_ndk_installer/r21d@bincrafters/stable
cmake_installer/3.15.5@conan/stable

Steps to reproduce (Include if Applicable)

Logs (Include/Attach if Applicable)

Click to expand log
ERROR: m4/1.4.18: Error in build() method, line 90
        autotools.make()
        ConanException: Error 2 while executing make -j12


In file included from ../source_subfolder/lib/freading.c:22:
../source_subfolder/lib/stdio-impl.h:72:22: error: field has incomplete type 'struct __sbuf'
      struct  __sbuf _ub; /* ungetc buffer */
                     ^
../source_subfolder/lib/stdio-impl.h:72:15: note: forward declaration of 'struct __sbuf'
      struct  __sbuf _ub; /* ungetc buffer */
              ^
../source_subfolder/lib/freading.c:41:16: error: no member named '_flags' in 'struct __sFILE'
  return (fp_->_flags & __SRD) != 0;
          ~~~  ^
../source_subfolder/lib/freading.c:41:25: error: use of undeclared identifier '__SRD'
  return (fp_->_flags & __SRD) != 0;
                        ^
3 errors generated.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:18 (18 by maintainers)

github_iconTop GitHub Comments

3reactions
a4zcommented, Nov 24, 2020

if the bincrafters/stable has not been changed since I looked at it the last time, I doubt you can use it with 2 profiles, since is uses os_build os_arch

this one https://github.com/conan-io/conan-center-index/pull/3004 works.

I would not waste time to the old approach with os_build and os_arch since the 2 profile way of handing xcompile is more natural and better, and you do not run into problems that build requirements wants to be build in debug modes, and sich things…

here an example how some of the profiles I use look like, in the 2 profile way, for an OSX to Android Armv8 build

Configuration (profile_host):
[settings]
arch=armv8
build_type=Release
compiler=clang
compiler.libcxx=libc++
compiler.version=9
os=Android
os.api_level=21
[options]
libcurl:with_ssl=openssl
lua:compile_as_cpp=True
ms-gsl:on_contract_violation=throw
nlohmann_json:multiple_headers=True
paho-mqtt-c:asynchronous=True
paho-mqtt-c:shared=False
paho-mqtt-c:ssl=True
paho-mqtt-cpp:ssl=True
[build_requires]
*: android-ndk/r21d
[env]

Configuration (profile_build):
[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=apple-clang
compiler.libcxx=libc++
compiler.version=12.0
os=Macos
os_build=Macos
[options]
[build_requires]
[env]

3reactions
jgsogocommented, Nov 24, 2020

Hi! Using the two profiles approach is the way to go and Conan will deprecate os_build arch_build settings in Conan v2 (we cannot do it before). The android-ndk recipe in bincrafters will stop to work as it is implemented now. There are other efforts you can have a look to, like https://github.com/conan-io/conan-center-index/pull/3004 by @a4z (I haven’t had time to have a look at it, and I should 😞 , but time constraints…).

In Conan we are also working in a new paradigm to supersede some limitations of the current build. We are working on toolchains (experimental yet) and if we manage to provide everything we want, it will be the default way (and only way) in Conan 2.0. Not ready yet.

@dmn-star the profiles shared by @madebr should work using a new implementation of the android-ndk recipe (the one in the PR I shared with you before or here you can find a POC by myself). It is important to realize that you need to choose between old approach (one profile and os/arch_build settings) or the new approach (two profiles), they are not going to play well together. Choose one and use it.

In your latest log you are using two profiles, but there is something wrong:

  • your host profile, it says the binaries you are generating, this one looks like ok:

    Configuration (profile_host):
    [settings]
    arch=armv8
    build_type=Release
    compiler=clang
    compiler.libcxx=libc++
    compiler.version=9
    os=Android
    os.api_level=21
    [options]
    [build_requires]
    [env]
    
  • but your build profile is wrong. The build profile tell Conan the binaries to use in the build-machine, the binaries that are going to run where you are compiling your sources, these are typically Win/Linux/Macos binaries.

    Configuration (profile_build):
    [settings]
    arch=x86_64
    os=Macos
    [options]
    [build_requires]
    *: android_ndk_installer/r21d@bincrafters/stable, cmake/3.19.0, m4/1.4.18, autoconf/2.69, automake/1.16.2, ninja/1.10.1
    [env]
    

    The [settings] section is right, you are using Macos/x86_64, but you are telling Conan to generate these binaries using android_ndk_installer… are you going to generate binaries for Macos using Android-NDK? I don’t think so.

You should use the profiles suggested by @madebr (https://github.com/conan-io/conan-center-index/issues/3627#issuecomment-731198329), the build-requires to android-ndk appears in the host profile, you are telling Conan to build the binaries for your host architecture (Android) using Android-NDK. 👍

Keep in mind:

  • build_requires tells Conan the tools to use to generate the binaries that match that profile.
  • host profile: describes the binaries to be generated, the library/project you want to build.
    • if this profile contains any build_requires, these packages listed under [build_requires] will be built (only if needed) using the settings in the build-profile because the are to be run in the build-machine.
  • build profile: describes the binaries you will be using to generate the packages in the host profile.
    • if this profile contains any build_requires, these packages listed here will only be retrieved if Conan needs to build some of the packages in the build-context (packages that are build-requires of your library).

image

I think I’m not explaining myself well enough 😓 Feel free to blame me and I’ll try to explain it better.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't install xmlsec using PIP command - Stack Overflow
I was getting below error while installation of sentry. ERROR: Could not build wheels for xmlsec which use PEP ...
Read more >
R2022-09 (monthly release cumulative patch) - 7.3
If you need to work on MDM workflows after the upgrade, install the Bonita BPM Integration package before installing this monthly patch.
Read more >
EasyBuild v4.6.2 documentation (release 20221021.0)
The latest version of EasyBuild provides support for building and installing 2,798 different software packages, including 37 different (compiler) toolchains ...
Read more >
Untitled
initial package generated by npm2rpm - add missing build section - minor ... for rpm bug 1131960 - Enable xmlsec1 support for EPEL...
Read more >
pinentry bug fix and enhancement update
... update kbl pci ids [2.99.917-20.20151109] - Update to upstream package. ... use upstream's preference - Fix build failure due to GCC PR65873...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found