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

[cpython]: Invalid pkg_config name #8198

Closed
ashfyre opened this issue Nov 28, 2021 · 1 comment · Fixed by #21387
Closed

[cpython]: Invalid pkg_config name #8198

ashfyre opened this issue Nov 28, 2021 · 1 comment · Fixed by #21387
Labels
bug Something isn't working

Comments

@ashfyre
Copy link

ashfyre commented Nov 28, 2021

Package and Environment Details (include every applicable attribute)

  • Package Name/Version: cpython/3.9.7
  • Operating System+version: Windows 10 64-bit
  • Compiler+version: n/a
  • Docker image: n/a
  • Conan version: conan 1.42.2
  • Python version: Python 3.7.4

Conan profile (output of conan profile show default or conan profile show <profile> if custom profile is in use)

[settings]
os=Windows
os_build=Windows
arch=x86_64
arch_build=x86_64
compiler=Visual Studio
compiler.version=16
build_type=Release
[options]
[conf]
[build_requires]
[env]

Steps to reproduce (Include if Applicable)

Attempt to generate for pkg-config with this library as a requirement. Example repro conanfile:

from conans import ConanFile

class test_py(ConanFile):
    name = "test"
    version = "0.0.1"
    generators = "pkg_config"

    requires = ["cpython/3.9.7"]

My output is:

conanfile.py (test/0.0.1): Installing package
Requirements
    cpython/3.9.7 from 'conancenter' - Cache
    zlib/1.2.11 from 'conancenter' - Cache
Packages
    cpython/3.9.7:d140711d95cc16a85766a8fc3a551dfafe84cf63 - Cache
    zlib/1.2.11:3fb49604f9c2f729b85ba3115852006824e72cab - Cache

Installing (downloading, building) binaries...
zlib/1.2.11: Already installed!
cpython/3.9.7: Already installed!
cpython/3.9.7: Appending PATH environment variable: C:\Users\<>\.conan\data\cpython\3.9.7\_\_\package\d140711d95cc16a85766a8fc3a551dfafe84cf63\bin
cpython/3.9.7: Setting PYTHON environment variable: C:\Users\<>\.conan\data\cpython\3.9.7\_\_\package\d140711d95cc16a85766a8fc3a551dfafe84cf63\bin\python.exe
cpython/3.9.7: Setting PYTHON environment variable: C:\Users\<>\.conan\data\cpython\3.9.7\_\_\package\d140711d95cc16a85766a8fc3a551dfafe84cf63\bin
cpython/3.9.7: Setting PYTHON_ROOT environment variable: C:\Users\<>\.conan\data\cpython\3.9.7\_\_\package\d140711d95cc16a85766a8fc3a551dfafe84cf63
conanfile.py (test/0.0.1): ERROR: Generator pkg_config(file:None) failed
sequence item 2: expected str instance, list found
ERROR: sequence item 2: expected str instance, list found

I've tracked the bug to this line of code in the recipe:

        self.cpp_info.components["_embed_copy"].names["pkg_config"] = ["python{}-embed".format(py_version.major)]

That property should be a string. Deleting the square brackets fixes this, at least on my end. May I open up a PR to patch this?

@ashfyre ashfyre added the bug Something isn't working label Nov 28, 2021
@SpaceIm
Copy link
Contributor

SpaceIm commented Nov 28, 2021

That property should be a string. Deleting the square brackets fixes this, at least on my end. May I open up a PR to patch this?

Sure

mttbernardini added a commit to mttbernardini/conan-center-index that referenced this issue Aug 10, 2022
@Ahajha Ahajha mentioned this issue Feb 4, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants