-
Notifications
You must be signed in to change notification settings - Fork 988
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
[bug] When cross building AutotoolsToolchain does not pass --build option if there is any configure argument with "build" in its name #12642
Comments
Hi @ovostrikov Thanks for reporting it because, indeed, it's a bug. I'll open a PR fixing this for the next release. |
Something like this should be sufficient: --- a/conan/tools/gnu/autotoolstoolchain.py
+++ b/conan/tools/gnu/autotoolstoolchain.py
@@ -186,8 +186,11 @@ class AutotoolsToolchain:
configure_args.extend(self.configure_args)
user_args_str = args_to_string(self.configure_args)
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))
+ if var:
+ arg = f"--{flag}="
+ if arg not in user_args_str:
+ arg += var
+ configure_args.append(arg)
args = {"configure_args": args_to_string(configure_args),
"make_args": args_to_string(self.make_args), |
This was referenced Dec 1, 2022
SpaceIm
added a commit
to SpaceIm/conan-center-index
that referenced
this issue
Feb 6, 2023
- use new stdcpp_library() instead of legacy one (since conan 1.54.0) - write custom _sha256sum() function to avoid relying on legacy conans.tools.sha256sum() conan function - remove workaround for conan-io/conan#12642 (fixed in conan 1.57.0) - remove workaround for conan-io/conan#12153 (fixed in conan 1.54.0)
3 tasks
conan-center-bot
pushed a commit
to conan-io/conan-center-index
that referenced
this issue
Feb 7, 2023
- use new stdcpp_library() instead of legacy one (since conan 1.54.0) - write custom _sha256sum() function to avoid relying on legacy conans.tools.sha256sum() conan function - remove workaround for conan-io/conan#12642 (fixed in conan 1.57.0) - remove workaround for conan-io/conan#12153 (fixed in conan 1.54.0)
sabelka
pushed a commit
to sabelka/conan-center-index
that referenced
this issue
Feb 12, 2023
- use new stdcpp_library() instead of legacy one (since conan 1.54.0) - write custom _sha256sum() function to avoid relying on legacy conans.tools.sha256sum() conan function - remove workaround for conan-io/conan#12642 (fixed in conan 1.57.0) - remove workaround for conan-io/conan#12153 (fixed in conan 1.54.0)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Environment Details
Steps to reproduce
conan new at/1.0.0 -t -m autotools_lib
Edit the conanfile
generate
method to addCreate
cross-build-profile
fileRun
Expected result
The '--build=x86_64-linux-gnu' option should be present:
> '--disable-shared' '--enable-static' '--prefix=/' '--bindir=${prefix}/bin' '--sbindir=${prefix}/bin' '--libdir=${prefix}/lib' '--includedir=${prefix}/include' '--oldincludedir=${prefix}/include' '--with-cross-build=some_path' '--host=wasm32-local-emscripten' '--build=x86_64-linux-gnu'
Actual result
The '--build=x86_64-linux-gnu' option is missing
'--disable-shared' '--enable-static' '--prefix=/' '--bindir=${prefix}/bin' '--sbindir=${prefix}/bin' '--libdir=${prefix}/lib' '--includedir=${prefix}/include' '--oldincludedir=${prefix}/include' '--with-cross-build=some_path' '--host=wasm32-local-emscripten'
Possible cause
AutotoolsToolchain checks that
build
option has not been set yet. However, since it's a simple substring check, existingwith-cross-build
option fails this checkExample of affected recipe
ICU cross builds incorrectly because of this in some cases.
The text was updated successfully, but these errors were encountered: