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

Some "url" attributes causes cmake-conan to fail #649

Closed
rollebolle opened this issue Jun 28, 2024 · 3 comments · Fixed by #652
Closed

Some "url" attributes causes cmake-conan to fail #649

rollebolle opened this issue Jun 28, 2024 · 3 comments · Fixed by #652
Assignees

Comments

@rollebolle
Copy link

rollebolle commented Jun 28, 2024

Having some special characters in the URL attribute in a conanfile.py may cause conan_provider.cmake to fail (see error message below). In my case it was a "?" and a "=" that generated this error. Selected generators was CMakeDeps but dont think it matters

CMake Error at /srv/rolwal/repos/sync-product/cmake/conan_provider.cmake:476 (string):
  string sub-command JSON failed parsing json string: * Line 1492, Column 24

    Syntax error: value, object or array expected.

  .
Call Stack (most recent call first):
  /srv/rolwal/repos/sync-product/cmake/conan_provider.cmake:578 (conan_install)
  CMakeLists.txt:60 (find_package)

@memsharded memsharded self-assigned this Jun 28, 2024
@memsharded
Copy link
Member

Hi @rollebolle

I have tried to reproduce this without success. What I did:

  • Use a conan new cmake_lib -d name=pkg -d version=0.1 dependency
  • Change the url attribute to contain ?=
  • Created the package pkg/0.1
  • Used the dependency pkg/0.1 in this repo example conanfile.txt
  • Use the provider
  • Everything went well

I am using Windows 11, CMake 3.25.3, VS 2022 17.1
Profile:

arch=x86_64
build_type=Release
compiler=msvc
compiler.cppstd=14
compiler.runtime=dynamic
compiler.runtime_type=Release
compiler.version=194
os=Windows

Latest Conan 2.4.1

@rollebolle
Copy link
Author

rollebolle commented Jun 28, 2024

After examining what part of our URL that actually triggered this, I tried it in the example project in this repo, using a conanfile with the URL below. This gave me the error I described. Conan 2.4.1

url = "foo;a=p"

@memsharded
Copy link
Member

Thanks for the hints, I managed to reproduce, and the final offender was the ; semicolon, because CMake uses them as separators 🤦

I am doing #652 to fix it, thanks again for the feedback!

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

Successfully merging a pull request may close this issue.

2 participants