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

[bug]If LDFLAGS consists of string with spaces, then conan_meson_XXX.ini is incorrect #17189

Open
5741978 opened this issue Oct 18, 2024 · 5 comments · May be fixed by #17208
Open

[bug]If LDFLAGS consists of string with spaces, then conan_meson_XXX.ini is incorrect #17189

5741978 opened this issue Oct 18, 2024 · 5 comments · May be fixed by #17208
Assignees
Labels
component: ux No changes to core business logic
Milestone

Comments

@5741978
Copy link

5741978 commented Oct 18, 2024

Describe the bug

We build our project with conan 2.8.0+meson 1.5.0+ninja 1.12.1 for Win VS 2022+clang-cl compiler

This is [buildenv] part of our profile:
[buildenv]
PATH=+(path)"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\Llvm\x64\bin"
CXX=clang-cl.exe
CC=clang-cl.exe
LD=lld-link.exe
LDFLAGS=+/LIBPATH:"C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/Llvm/x64/lib/clang/14.0.5/lib/windows"

And this- what i see in conan_meson_native.ini:
####C/C++ arguments
c_args = [] + preprocessor_definitions
c_link_args = ['/LIBPATH:"C:/Program', 'Files/Microsoft', 'Visual', 'Studio/2022/Enterprise/VC/Tools/Llvm/x64/lib/clang/14.0.5/lib/windows"']
cpp_args = [] + preprocessor_definitions
cpp_link_args = ['/LIBPATH:"C:/Program', 'Files/Microsoft', 'Visual', 'Studio/2022/Enterprise/VC/Tools/Llvm/x64/lib/clang/14.0.5/lib/windows"']

So, our builds fail at sanity check stage:

Sanity testing C++ compiler: clang-cl.exe
Is cross compiler: False.
Sanity check compiler command line: clang-cl.exe sanitycheckcpp.cc /Fesanitycheckcpp.exe /MD /nologo /showIncludes /utf-8 /link "/LIBPATH:"C:/Program" Files/Microsoft Visual "Studio/2022/Enterprise/VC/Tools/Llvm/x64/lib/clang/14.0.5/lib/windows""
Sanity check compile stdout:
LINK : fatal error LNK1181: cannot open input file 'Files\Microsoft.obj'

what do you think about this behaviour?
maybe we are doing something wrong?

How to reproduce it

No response

@memsharded memsharded self-assigned this Oct 18, 2024
@memsharded
Copy link
Member

Hi @5741978

Thanks for your report.

Using env-vars to communicate information to build systems integrations is generally not preferred.
There are other mechanisms, like the tools.build:cxxflags or tools.build:sharedlinkflags that can be defined and will be used by different tools like MesonToolchain.

Could you please check them and try them and let us know if that works better?

@5741978
Copy link
Author

5741978 commented Oct 18, 2024

Hi!
tools.build:sharedlinkflags - this is really working thing!
Thanks a lot!

@memsharded
Copy link
Member

Great, happy to know it is working now.

The conf system has some further advantages, like it is easier to define append/prepend operations, it has some type validation on the receiving side.

@5741978
Copy link
Author

5741978 commented Oct 22, 2024

I have noticed, that in conan config list command:

tools.build:sharedlinkflags: List of extra flags used by CMakeToolchain for CMAKE_SHARED_LINKER_FLAGS_INIT variable

only CMakeToolchain mentioned

@memsharded memsharded added this to the 2.9.0 milestone Oct 22, 2024
@memsharded memsharded added component: ux No changes to core business logic and removed stage: triaging labels Oct 22, 2024
@memsharded
Copy link
Member

That is true, it seems the doc for that sharedlinkflags became a bit outdated. Marking it to update it for the next release.
As the pull request to fix it should be pretty trivial, feel free to submit it if you want (otherwise we will do it, don't worry).

Thanks again for your feedback.

@5741978 5741978 linked a pull request Oct 23, 2024 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: ux No changes to core business logic
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants