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] NMakeDeps: doesn't properly handle cpp_info.defines with special characters #13603

Closed
SpaceIm opened this issue Apr 3, 2023 · 1 comment · Fixed by #15140
Closed

[bug] NMakeDeps: doesn't properly handle cpp_info.defines with special characters #13603

SpaceIm opened this issue Apr 3, 2023 · 1 comment · Fixed by #15140
Assignees

Comments

@SpaceIm
Copy link
Contributor

SpaceIm commented Apr 3, 2023

Environment details

  • Operating System+version: Windows 11
  • Compiler+version: Visual Studio 2022
  • Conan version: 2.0.3
  • Python version: 3.10.6

Steps to reproduce

Call conan install --requires="gdal/3.4.3" -o "sqlite3/*:shared=True" -b missing (you may have to write a conanfile.py in order to override versions of some dependencies since there are some conflicts currently I think).

My analysis of this issue:
When compiler is Visual Studio, gdal recipe (if version < 3.5) relies on NMakeToolchain & NMakeDeps. sqlite3 is an optional dependency of gdal, but enabled by default. When sqlite3 is shared on Windows, its recipe appends SQLITE_API=__declspec(dllimport) into cpp_info.defines (https://github.com/conan-io/conan-center-index/blob/eb52bc7ae38ab3cd857d38b0d32be39c45500fa6/recipes/sqlite3/all/conanfile.py#L207-L209).

I guess that my PR #12944 is not robust to some special characters in these definitions, they may have to be protected more than what is currently implemented here: https://github.com/conan-io/conan/blob/2.0.3/conan/tools/microsoft/nmakedeps.py#L54

Logs

I'll attach the log soon, but basically all compilation units of gdal including sqlite3.h fail. There is one error per line where SQLITE_API appears, something like 'string' unknown.

@SpaceIm
Copy link
Contributor Author

SpaceIm commented Nov 18, 2023

Some characters may have to be protected with \, lile ( and )

valgur added a commit to valgur/conan-center-index that referenced this issue Dec 5, 2023
valgur added a commit to valgur/conan-center-index that referenced this issue Dec 26, 2023
mayeut added a commit to mayeut/conan-center-index that referenced this issue Jan 1, 2024
ericLemanissier added a commit to ericLemanissier/conan-center-index that referenced this issue Jan 10, 2024
valgur added a commit to valgur/conan-center-index that referenced this issue Jan 20, 2024
conan-center-bot pushed a commit to conan-io/conan-center-index that referenced this issue Mar 1, 2024
* libspatialite: bump dependencies

* libspatialite: drop force=True

* libspatialite: bump deps

* libspatialite: add a workaround for NMakeDeps quoting issues

conan-io/conan#13603

* libspatialite: add v5.1.0

* libspatialite: bump deps

* libspatialite: fix MSVC build
conan-center-bot pushed a commit to conan-io/conan-center-index that referenced this issue May 13, 2024
* gdal: remove dead code

* bump deps

* remove outdated versions

* unbump flatbuffers

* Update conanfile.py

* add a workaround for NMakeDeps quoting issues

conan-io/conan#13603

Stolen from @valgur

* unbump maintained recipes

* fix conflicts

with libgeotiff, libtiff, proj

* Update conanfile.py

* use version range for expat

* revert migration to f-strings

to reduce the scope of the change, the potential for regression, and ease review

* restore 3.4.1

* fix line endings

* Update recipes/gdal/pre_3.5.0/conanfile.py

Co-authored-by: Uilian Ries <[email protected]>

---------

Co-authored-by: Uilian Ries <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants