Open dzonerzy opened 19 hours ago
Thanks for the report @dzonerzy
I am trying to reproduce with a simple test like:
def test_cross_build_user_toolchain_defined_quotes():
# https://github.com/conan-io/conan/issues/17029
rpi_profile = textwrap.dedent("""
[settings]
os=Linux
compiler=gcc
compiler.version=6
compiler.libcxx=libstdc++11
arch=armv8
build_type=Release
[conf]
tools.cmake.cmaketoolchain:user_toolchain=["rpi_toolchain.cmake"]
""")
client = TestClient(path_with_spaces=False)
conanfile = GenConanfile().with_settings("os", "arch", "compiler", "build_type")\
.with_generator("CMakeToolchain")
client.save({"conanfile.py": conanfile,
"rpi": rpi_profile})
client.run("install . --profile:host=rpi")
toolchain = client.load("conan_toolchain.cmake")
print(toolchain)
assert 'include("rpi_toolchain.cmake")' in toolchain
And this seems to work so far. I will keep investigating, are you using the standard zlib recipe from ConanCenter?
Thanks for looking at this @memsharded, yes I'm using the official zlib recipe, I cloned the ConanCenter repo locally and added it to conan using:
conan remote add <repo_folder>
then I installed the package with:
conan install --requires=zlib/1.3.1 -r=local-repo --build=zlib/1.3.1 -s build_type=Release -c tools.build:cxxflags="['/O1']" -c tools.compilation:verbosity=verbose
Hi @dzonerzy. Turns out this has nothing to do with the recipe, it's an evaluation issue in Python's side.
As a workaround for now, you can replace the backslashes in the toolchain path in your profile with either forward ones, or double them, like =["C:\\Users\\user\\Desktop\\test\\base.cmake"]
, and that should solve the current issue.
It's quite annoying, but currently backslash paths can't be used in conf lists and have them behave as such, we'll try to take a look into this, see if we can address it for 2.8.0, but no guarantee
Describe the bug
I've modified my default profile to inject a cmake which clear all the compiler flags for Debug and Release builds like as follows:
when I run
conan install --requires=zlib/1.3.1 -r=local-repo --build=zlib/1.3.1 -s build_type=Release -c tools.build:cxxflags="['/O1']" -c tools.compilation:verbosity=verbose
To force compilation with /O1 everytime I get the following error:
I've tried both with the square brackets and without but the error still persist.
This is the content of my base.cmake
How to reproduce it
1 - Modify a profile to inject the attached user toolchain 2 - Build from source a receips
base.zip