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.

[bug] autotools.configure() uses --host and --build when cross-compiling

See original GitHub issue

https://github.com/conan-io/conan/blob/d23c1b4631a297112d67ed2e6adb3a961b58d2c6/conan/tools/gnu/autotoolstoolchain.py#L188

        for flag, var in (("host", self._host), ("build", self._build), ("target", self._target)):
            if var and flag not in user_args_str:
                configure_args.append('--{}={}'.format(flag, var))

The old conans autotools_environment.py had parameters to set build=False host=False`, to prevent the configure script from being called with --host and --build. That seems like a useful thing for one problematic recipe: libvpx It has a custom configure script that does not handle --host and --build.

One way to workaround this is to patch the script so it accepts and ignores these parameters. This sounds fragile.

The other way is to generate my own call to the configure script. This seems appropriate and simpler than adding more cruft to the conan core. https://github.com/conan-io/conan-center-index/pull/13799

So, I thought I should raise this to see what you guys thought.

Issue Analytics

  • State:open
  • Created 9 months ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
franramirez688commented, Dec 14, 2022

I like it 😃 but the first one … if you only want to prune host, then if you don’t specify ‘build’ then it would call with build=None due to default arguments? ie at.update_configure_args( host=None ) would also prune build ?

Not at all. You pass only the arguments that you want to change, the rest of them are unaffected. For instance:

at = AutotoolsToolchain(self)
# at.configure_args -> ['--host=wasm32-local-emscripten', '--build=x86_64-linux-gnu', '--target=aarch64-linux-android']
at.update_configure_args(host=None, target="my_triplet")
# configure_args -> ['--build=x86_64-linux-gnu', '--target=my_triplet']
1reaction
franramirez688commented, Dec 14, 2022

@paulharris

Only to clarify the issue’s title, it says always, but it’s only happening when cross-compiling, isn’t it?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Hosts and Cross-Compilation - Autoconf
If you specify --host , but not --build , when configure performs the first compiler test it tries to run an executable produced...
Read more >
[bug] during crossbuild, build requirements are buit for host ...
When cross building a package and rebuilding all its dependencies, all its dependencies, including build requirements, are built using the ...
Read more >
Cross-compiling for ARM with Autoconf
System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD].
Read more >
3 Cross Compiling Erlang/OTP
This document describes how to cross compile Erlang/OTP-25. You are advised to read the whole document before attempting to cross compile Erlang/OTP.
Read more >
Use the NDK with other build systems
Some makefile projects allow cross compilation by overriding the same variables that you would with an autoconf project. As an example, the ...
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