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

[MesonToolchain] Binaries c, cpp and ld (added recently) can be lists #14676

Conversation

franramirez688
Copy link
Contributor

@franramirez688 franramirez688 commented Sep 6, 2023

Changelog: Feature: Added mechanism to transform c, cpp, and/or ld binaries variables from Meson into lists if declared blank-separated strings.
Docs: omit
Closes: #14028

Maybe closes: #13824 #14006

@franramirez688 franramirez688 added this to the 2.0.11 milestone Sep 6, 2023
@franramirez688 franramirez688 self-assigned this Sep 6, 2023
assert "strip = 'STRIP_VALUE'" in content
assert "as = 'AS_VALUE'" in content
assert "windres = 'WINDRES_VALUE'" in content
assert "pkgconfig = 'PKG_CONFIG_VALUE'" in content
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test is coming from the test_meson_build_require. Previously, it was functional, but it shouldn't.

compiler.libcxx=libstdc++11
build_type=Release
[buildenv]
CC=aarch64-poky-linux-gcc -mcpu=cortex-a53 -march=armv8-a+crc+crypto
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So Meson needs this defined as a list for the c, cpp, etc? This reads a bit ugly imho, I'd expect to have the compiler as one thing and the list of flags as cxxflags or similar

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with that, but the thing is that you can pass all those arguments to the CC in one shot as a list and it seems to be working as it's said in the issue #14028.

Overall, we're not changing the behavior at all. We agree that this should not be the way to go, but we're only allowing the users to have those compiler and compiler flags together without changing those env variables (up to them). You can check the Meson documentation too (https://mesonbuild.com/Machine-files.html#binaries).

Copy link
Contributor

@jwillikers jwillikers Sep 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@memsharded This is unforunately how Yocto configures the CC and similar environment variables out-of-the-box.

@franramirez688 franramirez688 merged commit 4f819a3 into conan-io:release/2.0 Sep 14, 2023
"cpp": self.cpp,
"c": _sanitize_format(self.c),
"cpp": _sanitize_format(self.cpp),
"ld": _sanitize_format(self.ld),
Copy link
Contributor

@jwillikers jwillikers Sep 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@franramirez688 According to the Meson documentation here, I didn't think using a multivalue argument for the linker options made sense sense it would have to be one of gold, lld, bfd for Clang / GCC and only for MSVC / Clang-Cl should it be an executable. I think this is pretty different behavior than how autotools make use of the LD environment variable.

Fyi, I really appreciate you improving the interface for this stuff in this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, indeed @jwillikers
I added that possibility only to be sure that I was not missing any corner case where you could want to pass several arguments to LD. Anyway, I hope consumers will use <>_ld instead, as Meson recommends in its documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants