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

pkgconf: conan v2 support & allow cross-build in the meantime #12219

Closed
wants to merge 18 commits into from

Conversation

SpaceIm
Copy link
Contributor

@SpaceIm SpaceIm commented Aug 14, 2022

Specify library name and version: lib/1.0

This is also a good place to share with all of us why you are submitting this PR (specially if it is a new addition to ConanCenter): is it a dependency of other libraries you want to package? Are you the author of the library? Thanks!


  • I've read the guidelines for contributing.
  • I've followed the PEP8 style guides for Python code in the recipes.
  • I've used the latest Conan client version.
  • I've tried at least one configuration locally with the conan-center hook activated.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@SpaceIm
Copy link
Contributor Author

SpaceIm commented Aug 31, 2022

Two different errors in test_package & test_v1_package on Windows:

In test_package:

vcvarsall.bat] Environment initialized for: 'x64'
'autoreconf' is not recognized as an internal or external command,
operable program or batch file.
pkgconf/1.7.4 (test package): WARN: Using the new toolchains and generators without specifying a build profile (e.g: -pr:b=default) is discouraged and might cause failures and unexpected behavior
ERROR: pkgconf/1.7.4 (test package): Error in build() method, line 43
	autotools.autoreconf()
	ConanException: Error 1 while executing autoreconf --force --install

Here I've replaced the manual self.run(autoreconf -fiv, ...) by the method autoreconf() of conan.tools.gnu.Autotools, but also I have VirtualBuildEnv in generators, so should autoconf recipe be updated to add env vars to buildenv_info?

In test_v1_package:

autoreconf: export WARNINGS=
autoreconf: Entering directory '.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: /c/j/w/prod/buildsinglereference/.conan/data/automake/1.16.3/_/_/package/3e48e69237f7f2196164383ef9dedf0f93cbf249/bin/aclocal.exe --force 
aclocal.exe: error: couldn't open directory 'C': No such file or directory
autoreconf: error: /c/j/w/prod/buildsinglereference/.conan/data/automake/1.16.3/_/_/package/3e48e69237f7f2196164383ef9dedf0f93cbf249/bin/aclocal.exe failed with exit status: 1
ERROR: pkgconf/1.7.4 (test package): Error in build() method, line 30
	self.run("{} -fiv".format(tools.get_env("AUTORECONF")), run_environment=True, win_bash=tools.os_info.is_windows)
	ConanException: Error 1 while executing /c/j/w/prod/buildsinglereference/.conan/data/autoconf/2.71/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/bin/autoreconf -fiv

conanfile of test_v1_package has not been changed, so could it come from the change of conans.tools.unix_path by conan.tools.microsoft.unix_path in the definition of AUTOMAKE_CONAN_INCLUDES in package_info() of pkgconf?

@uilianries
Copy link
Member

ping @lasote @franramirez688

Two different errors in test_package & test_v1_package on Windows:

In test_package:

vcvarsall.bat] Environment initialized for: 'x64'
'autoreconf' is not recognized as an internal or external command,
operable program or batch file.
pkgconf/1.7.4 (test package): WARN: Using the new toolchains and generators without specifying a build profile (e.g: -pr:b=default) is discouraged and might cause failures and unexpected behavior
ERROR: pkgconf/1.7.4 (test package): Error in build() method, line 43
	autotools.autoreconf()
	ConanException: Error 1 while executing autoreconf --force --install

Here I've replaced the manual self.run(autoreconf -fiv, ...) by the method autoreconf() of conan.tools.gnu.Autotools, but also I have VirtualBuildEnv in generators, so should autoconf recipe be updated to add env vars to buildenv_info?

In test_v1_package:

autoreconf: export WARNINGS=
autoreconf: Entering directory '.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: /c/j/w/prod/buildsinglereference/.conan/data/automake/1.16.3/_/_/package/3e48e69237f7f2196164383ef9dedf0f93cbf249/bin/aclocal.exe --force 
aclocal.exe: error: couldn't open directory 'C': No such file or directory
autoreconf: error: /c/j/w/prod/buildsinglereference/.conan/data/automake/1.16.3/_/_/package/3e48e69237f7f2196164383ef9dedf0f93cbf249/bin/aclocal.exe failed with exit status: 1
ERROR: pkgconf/1.7.4 (test package): Error in build() method, line 30
	self.run("{} -fiv".format(tools.get_env("AUTORECONF")), run_environment=True, win_bash=tools.os_info.is_windows)
	ConanException: Error 1 while executing /c/j/w/prod/buildsinglereference/.conan/data/autoconf/2.71/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/bin/autoreconf -fiv

conanfile of test_v1_package has not been changed, so could it come from the change of conans.tools.unix_path by conan.tools.microsoft.unix_path in the definition of AUTOMAKE_CONAN_INCLUDES in package_info() of pkgconf?

@lasote
Copy link
Contributor

lasote commented Sep 5, 2022

Hi, I'll take a look

@SpaceIm
Copy link
Contributor Author

SpaceIm commented Sep 5, 2022

For the issue in test_package on Windows, it might require updates of msys2 (#12715), m4, autoconf & automake recipes.
For test_v1_package, I don't know.

@lasote
Copy link
Contributor

lasote commented Sep 5, 2022

For the issue in test_package on Windows, it might require updates of msys2 (#12715), m4, autoconf & automake recipes.
For test_v1_package, I don't know.

The building of the test_package on windows is supposed to run inside msys2, right? In that case you'll need to specify win_bash=True in the recipe of the test_package, so conan runs the commands inside it. But indeed these recipes probably would need changes to declare the proper configs. Also the line self.options["pkgconf"]... should be changed to self.dependencies["pkgconf"].options.enable_lib.

About test_v1_package, yes, it is related to that. The underlying implementation uses the win_bash attribute from the recipe to compose the path differently. I don't really understand the recipe flow and what runs where, looks pretty complicated but it is related to that.

FYI: the win_bash attribute can be a property too and can be changed at any point to ON/OFF if needed.

https://docs.conan.io/en/latest/migrating_to_2.0/recipes.html#windows-subsystems

@SpaceIm
Copy link
Contributor Author

SpaceIm commented Sep 5, 2022

FYI: the win_bash attribute can be a property too and can be changed at any point to ON/OFF if needed.

https://docs.conan.io/en/latest/migrating_to_2.0/recipes.html#windows-subsystems

It should already come from msys2 recipe if included in tool_requires:

self.conf_info["tools.microsoft.bash:subsystem"] = "msys2"
self.conf_info["tools.microsoft.bash:path"] = os.path.join(msys_bin, "bash.exe")

In #12715, I've changed this definition to use define(), I guess it's better:

self.conf_info.define("tools.microsoft.bash:subsystem", "msys2")
self.conf_info.define("tools.microsoft.bash:path", os.path.join(msys_bin, "bash.exe"))

@SpaceIm
Copy link
Contributor Author

SpaceIm commented Sep 9, 2022

Also the line self.options["pkgconf"]... should be changed to self.dependencies["pkgconf"].options.enable_lib.

Can't be replaced in build() & test(), self.dependencies is None.

@jellespijker
Copy link
Contributor

jellespijker commented Sep 10, 2022

FYI: the win_bash attribute can be a property too and can be changed at any point to ON/OFF if needed.
https://docs.conan.io/en/latest/migrating_to_2.0/recipes.html#windows-subsystems

It should already come from msys2 recipe if included in tool_requires:

It would still need the the attribute win_bash as I set here:

I was wondering the same as you, so I did a bit of a dive in the source code of conan. The run method of a conanfile uses the command_env_runner as seen here: https://github.com/conan-io/conan/blob/eed935aecc627f5b09ed2f34132645d2064f03fa/conans/model/conan_file.py#L424

Which checks the conanfile.win_bash here: https://github.com/conan-io/conan/blob/eed935aecc627f5b09ed2f34132645d2064f03fa/conans/client/subsystems.py#L39

Would be great to if this would work:

    @property
    def win_bash(self):
        return self.conf.get("tools.microsoft.bash:path") is not None

@jellespijker
Copy link
Contributor

jellespijker commented Sep 10, 2022

@SpaceIm just tried this out and this work from a recipe nope doesn't work

    @property
    def win_bash(self):
        return self.conf.get("tools.microsoft.bash:path", "") != ""

But a better solution is a fix here: https://github.com/conan-io/conan/blob/eed935aecc627f5b09ed2f34132645d2064f03fa/conans/client/subsystems.py#L39
and check for the conf value like this:

    if platform.system() == "Windows" and (conanfile.win_bash or conanfile.conf.get("tools.microsoft.bash:path", "") != ""):

I could make a quick PR for this?

[ed]Nevermind it turns out that this isn't an easy 5 minute fix

@SpaceIm
Copy link
Contributor Author

SpaceIm commented Sep 10, 2022

@jellespijker I think windows is properly handled in test_package of pkgconf, with:

if self._settings_build.os == "Windows" and not self.conf.get("tools.microsoft.bash:path", default=False, check_type=bool):
self.tool_requires("msys2/cci.latest")

self.win_bash = True
autotools.autoreconf()
autotools.configure()
self.win_bash = False

The logic is quite simple:

  • on Windows, if conan consumer didn't manually specified a bash with tools.microsoft.bash:path, then we provide this bash through msys2.
  • before the call of autotools scripts, we set self.win_bash to True, then revert back to False (I think default value is None actually), so that self.run called under the hood by these autotools methods are executed in a bash (because autotools scripts can't work without a bash).

@jellespijker
Copy link
Contributor

jellespijker commented Sep 10, 2022

This has been the bane of my existence for the last three weeks. There are a couple of funky things going one with test_packages, with subsystems on Windows.: conan-io/conan#11975

When I run your branch I get the following error:

Using lockfile: 'C:\cura_wp\conan-center-index\recipes\pkgconf\all\test_package\build\generators/conan.lock'
Using cached profile from lockfile
[HOOK - conan-center.py] pre_build(): [FPIC MANAGEMENT (KB-H007)] 'fPIC' option not found
[HOOK - conan-center.py] pre_build(): [FPIC MANAGEMENT (KB-H007)] OK
pkgconf/1.7.4 (test package): Calling build()
pkgconf/1.7.4 (test package): Copied 1 '.pc' file: libexample1.pc
ERROR: pkgconf/1.7.4 (test package): Error in build() method, line 43
        autotools.autoreconf()
        ConanException: The config 'tools.microsoft.bash:subsystem' and 'tools.microsoft.bash:path' are needed to run commands in a Windows subsystem

Adding a quick printing debug statement in that function which prints the self.conf shows:

conf bash path: Conf: OrderedDict([('tools.gnu:define_libcxx11_abi', True), ('tools.env.virtualenv:auto_use', True), ('tools.cmake.cmaketoolchain:generator', 'Ninja')])

During my try-outs I noticed two things:

  1. The conf of the package you want to test with the test_package is simply not available.
  2. The order in which you place the msys2 tool_requires matters if you want to use the 'old' behavior to test if your recipe works in a Windows bash. msys2 must be the first.

I haven't got a clue how to solve this for now

Full log of the Conan create command
C:\cura_wp\conan-center-index\recipes\pkgconf\all [pkgconf-conan-v2+2 ~1 -0 !]> conan create . pkgconf/1.7.4@_/_ --build=missing --update
[HOOK - conan-center.py] pre_export(): [DEPRECATED GLOBAL CPPSTD (KB-H001)] OK
[HOOK - conan-center.py] pre_export(): [REFERENCE LOWERCASE (KB-H002)] OK
[HOOK - conan-center.py] pre_export(): [RECIPE METADATA (KB-H003)] OK
[HOOK - conan-center.py] pre_export(): [HEADER_ONLY, NO COPY SOURCE (KB-H005)] OK
[HOOK - conan-center.py] pre_export(): [FPIC OPTION (KB-H006)] OK
[HOOK - conan-center.py] pre_export(): [VERSION RANGES (KB-H008)] OK
[HOOK - conan-center.py] pre_export(): [RECIPE FOLDER SIZE (KB-H009)] Total recipe size: 17.908203125 KB
[HOOK - conan-center.py] pre_export(): [RECIPE FOLDER SIZE (KB-H009)] OK
[HOOK - conan-center.py] pre_export(): [EXPORT LICENSE (KB-H023)] exports: None
[HOOK - conan-center.py] pre_export(): [EXPORT LICENSE (KB-H023)] exports: None
[HOOK - conan-center.py] pre_export(): [EXPORT LICENSE (KB-H023)] OK
[HOOK - conan-center.py] pre_export(): [TEST PACKAGE FOLDER (KB-H024)] OK
[HOOK - conan-center.py] pre_export(): [META LINES (KB-H025)] OK
[HOOK - conan-center.py] pre_export(): [CONAN CENTER INDEX URL (KB-H027)] OK
[HOOK - conan-center.py] pre_export(): [CMAKE MINIMUM VERSION (KB-H028)] OK
[HOOK - conan-center.py] pre_export(): [TEST PACKAGE - RUN ENVIRONMENT (KB-H029)] OK
[HOOK - conan-center.py] pre_export(): [SYSTEM REQUIREMENTS (KB-H032)] OK
[HOOK - conan-center.py] pre_export(): [CONANDATA.YML FORMAT (KB-H030)] OK
[HOOK - conan-center.py] pre_export(): [TEST PACKAGE - NO IMPORTS() (KB-H034)] OK
[HOOK - conan-center.py] pre_export(): [NO AUTHOR (KB-H037)] OK
[HOOK - conan-center.py] pre_export(): [NOT ALLOWED ATTRIBUTES (KB-H039)] OK
[HOOK - conan-center.py] pre_export(): [NO TARGET NAME (KB-H040)] OK
[HOOK - conan-center.py] pre_export(): [NO FINAL ENDLINE (KB-H041)] OK
[HOOK - conan-center.py] pre_export(): [NO REQUIRES.ADD() (KB-H044)] OK
[HOOK - conan-center.py] pre_export(): [DELETE OPTIONS (KB-H045)] OK
[HOOK - conan-center.py] pre_export(): [CMAKE VERBOSE MAKEFILE (KB-H046)] OK
[HOOK - conan-center.py] pre_export(): [CMAKE VERSION REQUIRED (KB-H048)] OK
[HOOK - conan-center.py] pre_export(): [CMAKE WINDOWS EXPORT ALL SYMBOLS (KB-H049)] OK
[HOOK - conan-center.py] pre_export(): [DEFAULT OPTIONS AS DICTIONARY (KB-H051)] OK
[HOOK - conan-center.py] pre_export(): [CONFIG.YML HAS NEW VERSION (KB-H052)] OK
[HOOK - conan-center.py] pre_export(): [PRIVATE IMPORTS (KB-H053)] OK
[HOOK - conan-center.py] pre_export(): [SINGLE REQUIRES (KB-H055)] OK
[HOOK - conan-center.py] pre_export(): [TOOLS RENAME (KB-H057)] OK
[HOOK - conan-center.py] pre_export(): [ILLEGAL CHARACTERS (KB-H058)] OK
[HOOK - conan-center.py] pre_export(): [CLASS NAME (KB-H059)] OK
[HOOK - conan-center.py] pre_export(): ERROR: [NO CRLF (KB-H060)] The file 'configure.ac' uses CRLF. Please, replace by LF. (https://github.com/conan-io/conan-center-index/blob/master/docs/error_knowledge_base.md#KB-H060)
[HOOK - conan-center.py] pre_export(): ERROR: [NO CRLF (KB-H060)] The file 'test_package.c' uses CRLF. Please, replace by LF. (https://github.com/conan-io/conan-center-index/blob/master/docs/error_knowledge_base.md#KB-H060)
[HOOK - conan-center.py] pre_export(): [NO BUILD SYSTEM FUNCTIONS (KB-H061)] OK
[HOOK - conan-center.py] pre_export(): [TOOLS CROSS BUILDING (KB-H062)] OK
[HOOK - conan-center.py] pre_export(): [INVALID TOPICS (KB-H064)] OK
[HOOK - conan-center.py] pre_export(): [NO REQUIRED_CONAN_VERSION (KB-H065)] OK
[HOOK - conan-center.py] pre_export(): [TEST_TYPE MANAGEMENT (KB-H068)] OK
[HOOK - conan-center.py] pre_export(): [TEST PACKAGE - NO DEFAULT OPTIONS (KB-H069)] OK
[HOOK - conan-center.py] pre_export(): [MANDATORY SETTINGS (KB-H070)] OK
[HOOK - recipe_linter.py] pre_export(): Lint recipe 'C:\cura_wp\conan-center-index\recipes\pkgconf\all\conanfile.py'
[HOOK - recipe_linter.py] pre_export(): Command line:1:0: R0022: Useless option value for '--disable', 'no-absolute-import' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
[HOOK - recipe_linter.py] pre_export(): conanfile.py:81:9: W0511: TODO: fixed in conan 1.51.0? (fixme)
[HOOK - recipe_linter.py] pre_export(): conanfile.py:145:9: W0511: TODO: to remove in conan v2 once pkg_config generator removed (fixme)
[HOOK - recipe_linter.py] pre_export(): conanfile.py:1:0: C0114: Missing module docstring (missing-module-docstring)
[HOOK - recipe_linter.py] pre_export(): conanfile.py:11:0: C0103: Constant name "required_conan_version" doesn't conform to UPPER_CASE naming style (invalid-name)
[HOOK - recipe_linter.py] pre_export(): conanfile.py:14:0: C0115: Missing class docstring (missing-class-docstring)
[HOOK - recipe_linter.py] pre_export(): conanfile.py:34:4: C0116: Missing function or method docstring (missing-function-docstring)
[HOOK - recipe_linter.py] pre_export(): conanfile.py:35:12: C0103: Variable name "p" doesn't conform to snake_case naming style (invalid-name)
[HOOK - recipe_linter.py] pre_export(): conanfile.py:50:15: W0703: Catching too general exception Exception (broad-except)
[HOOK - recipe_linter.py] pre_export(): conanfile.py:54:15: W0703: Catching too general exception Exception (broad-except)
[HOOK - recipe_linter.py] pre_export(): conanfile.py:61:4: C0116: Missing function or method docstring (missing-function-docstring)
[HOOK - recipe_linter.py] pre_export(): conanfile.py:62:8: E1101: Instance of 'PkgConfConan' has no 'tool_requires' member (no-member)
[HOOK - recipe_linter.py] pre_export(): conanfile.py:64:4: C0116: Missing function or method docstring (missing-function-docstring)
[HOOK - recipe_linter.py] pre_export(): conanfile.py:75:4: C0116: Missing function or method docstring (missing-function-docstring)
[HOOK - recipe_linter.py] pre_export(): conanfile.py:76:8: C0103: Variable name "tc" doesn't conform to snake_case naming style (invalid-name)
[HOOK - recipe_linter.py] pre_export(): conanfile.py:142:25: C0209: Formatting a regular string which could be a f-string (consider-using-f-string)
[HOOK - recipe_linter.py] pre_export(): conanfile.py:155:4: C0415: Import outside toplevel (glob) (import-outside-toplevel)
[HOOK - recipe_linter.py] pre_export(): conanfile.py:9:0: C0411: standard import "import os" should be placed before "from conan import ConanFile" (wrong-import-order)
[HOOK - recipe_linter.py] pre_export(): Linter detected '1' errors
Exporting package recipe
pkgconf/1.7.4 exports: File 'conandata.yml' found. Exporting it...
pkgconf/1.7.4 exports: Copied 1 '.yml' file: conandata.yml
pkgconf/1.7.4: Calling export_sources()
pkgconf/1.7.4: Copied 1 '.patch' file: 1.7.4-0001-clang-12-strndup-not-in-string-h.patch
pkgconf/1.7.4: Copied 1 '.patch' file: 1.7.4-0002-fix-static-link.patch
pkgconf/1.7.4: Copied 1 '.patch' file: 1.7.4-0003-PKG_CONF_PATH-allow-colon+semicolon-separator.patch
[HOOK - conan-center.py] post_export(): [CONANDATA.YML REDUCE (KB-H031)] Saving conandata.yml: {'sources': {'1.7.4': {'url': 'https://distfiles.dereferenced.org/pkgconf/pkgconf-1.7.4.tar.xz', 'sh
a256': 'd73f32c248a4591139a6b17777c80d4deab6b414ec2b3d21d0a24be348c476ab'}}, 'patches': {'1.7.4': [{'patch_file': 'patches/1.7.4-0001-clang-12-strndup-not-in-string-h.patch'}, {'patch_file': 'patches/1.7.4-0002-fix-static-link.patch'}, {'patch_file': 'patches/1.7.4-0003-PKG_CONF_PATH-allow-colon+semicolon-separator.patch'}]}}
[HOOK - conan-center.py] post_export(): [CONANDATA.YML REDUCE (KB-H031)] New conandata.yml contents: patches:
  1.7.4:
  - patch_file: patches/1.7.4-0001-clang-12-strndup-not-in-string-h.patch
  - patch_file: patches/1.7.4-0002-fix-static-link.patch
  - patch_file: patches/1.7.4-0003-PKG_CONF_PATH-allow-colon+semicolon-separator.patch
sources:
  1.7.4:
    sha256: d73f32c248a4591139a6b17777c80d4deab6b414ec2b3d21d0a24be348c476ab
    url: https://distfiles.dereferenced.org/pkgconf/pkgconf-1.7.4.tar.xz

[HOOK - conan-center.py] post_export(): [CONANDATA.YML REDUCE (KB-H031)] OK
[HOOK - conan-center.py] post_export(): [DEFAULT SHARED OPTION VALUE (KB-H050)] OK
[HOOK - conan-center.py] post_export(): [LICENSE PUBLIC DOMAIN (KB-H056)] OK
pkgconf/1.7.4: The stored package has not changed
pkgconf/1.7.4: Using the exported files summary hash as the recipe revision: 5870efa71a3056a4d61796c48563d1de
ERROR :search.py      [151]: There is no ConanInfo: C:\.conan\40956b\1\conaninfo.txt [2022-09-10 20:23:51,679]
pkgconf/1.7.4: Exported revision: 5870efa71a3056a4d61796c48563d1de
Configuration (profile_host):
[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=msvc
compiler.cppstd=17
compiler.runtime=dynamic
compiler.runtime_type=Release
compiler.version=193
os=Windows
os_build=Windows
curaengine:compiler.cppstd=20
[options]
[build_requires]
[env]
[conf]
tools.cmake.cmaketoolchain:generator=Ninja
tools.env.virtualenv:auto_use=True
tools.gnu:define_libcxx11_abi=True

Configuration (profile_build):
[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=msvc
compiler.cppstd=17
compiler.runtime=dynamic
compiler.runtime_type=Release
compiler.version=193
os=Windows
os_build=Windows
[options]
[build_requires]
[env]
[conf]
tools.cmake.cmaketoolchain:generator=Ninja
tools.env.virtualenv:auto_use=True
tools.gnu:define_libcxx11_abi=True

conf bash path: Conf: OrderedDict([('tools.gnu:define_libcxx11_abi', True), ('tools.env.virtualenv:auto_use', True), ('tools.cmake.cmaketoolchain:generator', 'Ninja')])
m4/1.4.19: WARN: Can't update, no package in remote
autoconf/2.71: WARN: Can't update, no package in remote
pkgconf/1.7.4 (test package): Installing package
Requirements
    pkgconf/1.7.4 from local cache - No remote
Packages
    pkgconf/1.7.4:0a420ff5c47119e668867cdb51baff0eca1fdb68 - Cache
Build requirements
    autoconf/2.71 from 'cura-dev' - Cache
    automake/1.16.5 from local cache - No remote
    m4/1.4.19 from 'cura-dev' - Newer
    msys2/cci.latest from 'cura-dev' - Cache
    pkgconf/1.7.4 from local cache - No remote
Build requirements packages
    autoconf/2.71:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Cache
    automake/1.16.5:6b2bdff1aa6d679b0a50d7ca85c0ae3b3e6ebfbf - Cache
    m4/1.4.19:0a420ff5c47119e668867cdb51baff0eca1fdb68 - Cache
    msys2/cci.latest:eee3fba89db6d777329de604625af8c30d46f080 - Cache
    pkgconf/1.7.4:0a420ff5c47119e668867cdb51baff0eca1fdb68 - Cache

Installing (downloading, building) binaries...
m4/1.4.19: Already installed!
m4/1.4.19: Appending PATH environment variable: C:\.conan\bc0586\1\bin
m4/1.4.19: Define M4 with C:\.conan\bc0586\1\bin\m4.exe
m4/1.4.19: Defining path to M4 binary in configuration as `tools.m4:bin` with value: C:\.conan\bc0586\1\bin\m4.exe
msys2/cci.latest: Already installed!
msys2/cci.latest: Creating MSYS_ROOT env var : C:\.conan\7c3916\1\bin\msys64
msys2/cci.latest: Creating MSYS_BIN env var : C:\.conan\7c3916\1\bin\msys64\usr\bin
msys2/cci.latest: Appending PATH env var with : C:\.conan\7c3916\1\bin\msys64\usr\bin
pkgconf/1.7.4: Already installed!
pkgconf/1.7.4: Appending AUTOMAKE_CONAN_INCLUDES env var: C:/.conan/d869a2/1/bin/aclocal
[HOOK - conan-center.py] post_package_info(): [CMAKE FILE NOT IN BUILD FOLDERS (KB-H019)] OK
[HOOK - conan-center.py] post_package_info(): [LIBRARY DOES NOT EXIST (KB-H054)] OK
[HOOK - conan-center.py] post_package_info(): [INCLUDE PATH DOES NOT EXIST (KB-H071)] OK
pkgconf/1.7.4: Appending AUTOMAKE_CONAN_INCLUDES env var: C:/.conan/d869a2/1/bin/aclocal
[HOOK - conan-center.py] post_package_info(): [CMAKE FILE NOT IN BUILD FOLDERS (KB-H019)] OK
[HOOK - conan-center.py] post_package_info(): [LIBRARY DOES NOT EXIST (KB-H054)] OK
[HOOK - conan-center.py] post_package_info(): [INCLUDE PATH DOES NOT EXIST (KB-H071)] OK
autoconf/2.71: Already installed!
autoconf/2.71: Appending PATH env var with : C:\.conan\f2141b\1\bin\bin
autoconf/2.71: Setting AC_MACRODIR to C:\.conan\f2141b\1\bin\share\autoconf
autoconf/2.71: Setting AUTOCONF to C:\.conan\f2141b\1\bin\bin\autoconf
autoconf/2.71: Setting AUTORECONF to C:\.conan\f2141b\1\bin\bin\autoreconf
autoconf/2.71: Setting AUTOHEADER to C:\.conan\f2141b\1\bin\bin\autoheader
autoconf/2.71: Setting AUTOM4TE to C:\.conan\f2141b\1\bin\bin\autom4te
autoconf/2.71: Setting AUTOM4TE_PERLLIBDIR to C:\.conan\f2141b\1\bin\share\autoconf
automake/1.16.5: Already installed!
automake/1.16.5: Appending PATH environment variable:: C:\.conan\521ff3\1\bin\bin
automake/1.16.5: Setting ACLOCAL to C:\.conan\521ff3\1\bin\bin\aclocal.exe
automake/1.16.5: Setting AUTOMAKE_DATADIR to C:\.conan\521ff3\1\bin\share
automake/1.16.5: Setting AUTOMAKE_LIBDIR to C:\.conan\521ff3\1\bin\share\automake-1.16
automake/1.16.5: Setting AUTOMAKE_PERLLIBDIR to C:\.conan\521ff3\1\bin\share\automake-1.16
automake/1.16.5: Setting AUTOMAKE to C:\.conan\521ff3\1\bin\bin\automake.exe
automake/1.16.5: Define path to `compile` binary in user_info as: C:\.conan\521ff3\1\bin\share\automake-1.16\compile
automake/1.16.5: Defining path to `compile` binary in configuration as `tools.automake:compile` with value: C:\.conan\521ff3\1\bin\share\automake-1.16\compile
automake/1.16.5: Define path to `ar_lib` binary in user_info as: C:\.conan\521ff3\1\bin\share\automake-1.16\ar-lib
automake/1.16.5: Defining path to `ar-lib` binary in configuration as `tools.automake:ar-lib` with value: C:\.conan\521ff3\1\bin\share\automake-1.16\ar-lib
pkgconf/1.7.4 (test package): Applying build-requirement: pkgconf/1.7.4
pkgconf/1.7.4 (test package): Applying build-requirement: automake/1.16.5
pkgconf/1.7.4 (test package): Applying build-requirement: msys2/cci.latest
pkgconf/1.7.4 (test package): Applying build-requirement: autoconf/2.71
pkgconf/1.7.4 (test package): Applying build-requirement: m4/1.4.19
pkgconf/1.7.4 (test package): Generator 'AutotoolsToolchain' calling 'generate()'
pkgconf/1.7.4 (test package): Generator 'VirtualBuildEnv' calling 'generate()'
pkgconf/1.7.4 (test package): Generator txt created conanbuildinfo.txt
pkgconf/1.7.4 (test package): Generator 'VirtualRunEnv' calling 'generate()'
pkgconf/1.7.4 (test package): Calling generate()
pkgconf/1.7.4 (test package): Aggregating env generators
pkgconf/1.7.4 (test package): Generated conaninfo.txt
pkgconf/1.7.4 (test package): Generated graphinfo
Using lockfile: 'C:\cura_wp\conan-center-index\recipes\pkgconf\all\test_package\build\generators/conan.lock'
Using cached profile from lockfile
[HOOK - conan-center.py] pre_build(): [FPIC MANAGEMENT (KB-H007)] 'fPIC' option not found
[HOOK - conan-center.py] pre_build(): [FPIC MANAGEMENT (KB-H007)] OK
pkgconf/1.7.4 (test package): Calling build()
pkgconf/1.7.4 (test package): Copied 1 '.pc' file: libexample1.pc
ERROR: pkgconf/1.7.4 (test package): Error in build() method, line 44
        autotools.autoreconf()
        ConanException: The config 'tools.microsoft.bash:subsystem' and 'tools.microsoft.bash:path' are needed to run commands in a Windows subsystem

@jellespijker
Copy link
Contributor

jellespijker commented Sep 10, 2022

before the call of autotools scripts, we set self.win_bash to True, then revert back to False (I think default value is None actually), so that self.run called under the hood by these autotools methods are executed in a bash (because autotools scripts can't work without a bash).

Although I'm in favor of keeping the scope of variables as small as possible, I think the current one is quite limited.
It is needed in Autotool scenario's at least during, In my recipes it used during: generate, build and package.

To be honest I really dislike that variable win_bash, it feels out-of-place in a recipe which should service multiple OSes.

@conan-center-bot

This comment has been minimized.

@SpaceIm
Copy link
Contributor Author

SpaceIm commented Nov 9, 2022

/bin/sh: 1: None: not found
pkgconf/1.7.3 (test package): WARN: Using the new toolchains and generators without specifying a build profile (e.g: -pr:b=default) is discouraged and might cause failures and unexpected behavior
ERROR: pkgconf/1.7.3 (test package): Error in test() method, line 63
	self.run(f"{pkg_config} libexample1 --libs")
	ConanException: Error 127 while executing None libexample1 --libs

@jgsogo @prince-chrismc are there still agents running conan 1.52.0? This error shouldn't happen in conan 1.53.0

@uilianries
Copy link
Member

@SpaceIm weird, everything should be switched to 1.53.0 only. One possibility is some Docker image still running 1.52.0 but labeled as 1.53.0

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@ghost ghost mentioned this pull request Dec 13, 2022
4 tasks
@stale
Copy link

stale bot commented Dec 26, 2022

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@danimtb
Copy link
Member

danimtb commented Dec 27, 2022

relaunching the CI for this PR to verify its status

@conan-center-bot

This comment has been minimized.

@prince-chrismc prince-chrismc reopened this Jan 9, 2023
@prince-chrismc prince-chrismc self-assigned this Jan 9, 2023
Comment on lines +110 to +111
rename(self, os.path.join(self.package_folder, "share", "aclocal"),
os.path.join(self.package_folder, "bin", "aclocal"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this just to avoid the hooks? If yes I would like to fix those and added an exception 🙏

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think share folder is allowed now by hooks, so it may be avoided.

Comment on lines +132 to +134
# TODO: replace by conan.tools.microsoft.unix_path when stateless
# (see https://github.com/conan-io/conan/issues/12192)
automake_extra_includes = tools_legacy.unix_path(os.path.join(self.package_folder , "bin", "aclocal").replace("\\", "/"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be in 1.54 ? conan-io/conan#12178

Copy link
Contributor Author

@SpaceIm SpaceIm Jan 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure. What we need here is a conversion to unix_path by conan of all paths vars in build & run scope in consumers recipes when they run a command in win bash. From my experimentations it doesn't work yet, or I'm missing something.

/cc @memsharded

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/conan-io/conan/releases in beta8 and 1.57 unix_path_package_info_legacy was added that sounds like what was missing?

@prince-chrismc
Copy link
Contributor

This is required for 6 out of the last 39 packages for v2 any way I can help push this forward?

@conan-center-bot
Copy link
Collaborator

Conan v1 pipeline

Failure in build 21 (165fafa7fff7c480b7592104e37cb2a5673596ac):

  • pkgconf/1.9.3@:
    Didn't run or was cancelled before finishing

  • pkgconf/1.7.4@:
    CI failed to create some packages (All logs)

    Logs for packageID 24647d9fe8ec489125dfbae4b3ebefaf7581674c:
    [settings]
    arch=x86_64
    build_type=Release
    compiler=gcc
    compiler.libcxx=libstdc++11
    compiler.version=5
    os=Linux
    [options]
    pkgconf:shared=False
    
    [...]
    pkgconf/1.7.4 (test package): Generator cmake_find_package_multi created m4-config.cmake
    pkgconf/1.7.4 (test package): Generator cmake_find_package_multi created m4Targets.cmake
    pkgconf/1.7.4 (test package): Generator cmake_find_package_multi created m4Target-release.cmake
    pkgconf/1.7.4 (test package): Aggregating env generators
    pkgconf/1.7.4 (test package): Generated conaninfo.txt
    pkgconf/1.7.4 (test package): Generated graphinfo
    Using lockfile: '/home/conan/w/prod/BuildSingleReference/conan-center-index/recipes/pkgconf/all/test_v1_package/build/882726c1002337140ad656a23b0e4ec3d0cc08c1/conan.lock'
    Using cached profile from lockfile
    [HOOK - conan-center.py] pre_build(): [FPIC MANAGEMENT (KB-H007)] 'fPIC' option not found
    [HOOK - conan-center.py] pre_build(): [FPIC MANAGEMENT (KB-H007)] OK
    pkgconf/1.7.4 (test package): Calling build()
    
    ----Running------
    > /home/conan/w/prod/BuildSingleReference/.conan/data/autoconf/2.71/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/bin/autoreconf -fiv
    -----------------
    pkgconf/1.7.4 (test package): Calling:
     > ./configure '--prefix=/home/conan/w/prod/BuildSingleReference/conan-center-index/recipes/pkgconf/all/test_v1_package/build/882726c1002337140ad656a23b0e4ec3d0cc08c1/package' '--bindir=${prefix}/bin' '--sbindir=${prefix}/bin' '--libexecdir=${prefix}/bin' '--libdir=${prefix}/lib' '--includedir=${prefix}/include' '--oldincludedir=${prefix}/include' '--datarootdir=${prefix}/share' 
    
    ----Running------
    > ./configure '--prefix=/home/conan/w/prod/BuildSingleReference/conan-center-index/recipes/pkgconf/all/test_v1_package/build/882726c1002337140ad656a23b0e4ec3d0cc08c1/package' '--bindir=${prefix}/bin' '--sbindir=${prefix}/bin' '--libexecdir=${prefix}/bin' '--libdir=${prefix}/lib' '--includedir=${prefix}/include' '--oldincludedir=${prefix}/include' '--datarootdir=${prefix}/share' 
    -----------------
    checking pkg-config is at least version 0.9.0... yes
    pkg-config executable found at /home/conan/w/prod/BuildSingleReference/.conan/data/pkgconf/1.7.4/_/_/package/24647d9fe8ec489125dfbae4b3ebefaf7581674c/bin/pkgconf!
    SDL2 not found :(
    pkgconf/1.7.4 (test package): Running test()
    pkgconf/1.7.4 (test package): Read environment variable PKG_CONFIG='/home/conan/w/prod/BuildSingleReference/.conan/data/pkgconf/1.7.4/_/_/package/24647d9fe8ec489125dfbae4b3ebefaf7581674c/bin/pkgconf'
    pkgconf/1.7.4 (test package): Found pkgconf at '/home/conan/w/prod/BuildSingleReference/.conan/data/pkgconf/1.7.4/_/_/package/24647d9fe8ec489125dfbae4b3ebefaf7581674c/bin/pkgconf'
    
    ----Running------
    > /home/conan/w/prod/BuildSingleReference/.conan/data/pkgconf/1.7.4/_/_/package/24647d9fe8ec489125dfbae4b3ebefaf7581674c/bin/pkgconf libexample1 --libs
    -----------------
    -L/usr/lib -lexample1 
    
    ----Running------
    > /home/conan/w/prod/BuildSingleReference/.conan/data/pkgconf/1.7.4/_/_/package/24647d9fe8ec489125dfbae4b3ebefaf7581674c/bin/pkgconf libexample1 --cflags
    -----------------
    -I/usr/include/libexample1 -I/usr/include -DEXAMPLE1_STATIC 
    autoreconf: export WARNINGS=
    autoreconf: Entering directory '.'
    autoreconf: configure.ac: not using Gettext
    autoreconf: running: /home/conan/w/prod/BuildSingleReference/.conan/data/automake/1.16.3/_/_/package/258f6f05ca54813b3d7180161753df7f9ccf7e1d/bin/aclocal --force 
    autoreconf: configure.ac: tracing
    autoreconf: configure.ac: not using Libtool
    autoreconf: configure.ac: not using Intltool
    autoreconf: configure.ac: not using Gtkdoc
    autoreconf: running: /home/conan/w/prod/BuildSingleReference/.conan/data/autoconf/2.71/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/bin/autoconf --force
    /home/conan/w/prod/BuildSingleReference/.conan/data/autoconf/2.71/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/res/autoconf/autoconf/trailer.m4:4: warning: AC_OUTPUT was never used
    autoreconf: configure.ac: not using Autoheader
    autoreconf: configure.ac: not using Automake
    autoreconf: Leaving directory '.'
    
  • pkgconf/1.7.3@:
    Didn't run or was cancelled before finishing


Note: To save resources, CI tries to finish as soon as an error is found. For this reason you might find that not all the references have been launched or not all the configurations for a given reference. Also, take into account that we cannot guarantee the order of execution as it depends on CI workload and workers availability.


Conan v2 pipeline (informative, not required for merge)

Failure in build 17 (165fafa7fff7c480b7592104e37cb2a5673596ac):

  • pkgconf/1.9.3@:
    Error running command conan export --name pkgconf --version 1.9.3 recipes/pkgconf/all/conanfile.py:

    ERROR: Error loading conanfile at '/home/conan/w/prod-v2_cci_PR-12219/recipes/pkgconf/all/conanfile.py': Unable to load conanfile in /home/conan/w/prod-v2_cci_PR-12219/recipes/pkgconf/all/conanfile.py
      File "<frozen importlib._bootstrap_external>", line 728, in exec_module
      File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
      File "/home/conan/w/prod-v2_cci_PR-12219/recipes/pkgconf/all/conanfile.py", line 9, in <module>
        from conans import tools as tools_legacy
    ImportError: cannot import name 'tools' from 'conans' (/opt/pyenv/versions/3.7.13/lib/python3.7/site-packages/conans/__init__.py)
    
  • pkgconf/1.7.4@:
    Error running command conan export --name pkgconf --version 1.7.4 recipes/pkgconf/all/conanfile.py:

    ERROR: Error loading conanfile at '/home/conan/w/prod-v2_cci_PR-12219/recipes/pkgconf/all/conanfile.py': Unable to load conanfile in /home/conan/w/prod-v2_cci_PR-12219/recipes/pkgconf/all/conanfile.py
      File "<frozen importlib._bootstrap_external>", line 728, in exec_module
      File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
      File "/home/conan/w/prod-v2_cci_PR-12219/recipes/pkgconf/all/conanfile.py", line 9, in <module>
        from conans import tools as tools_legacy
    ImportError: cannot import name 'tools' from 'conans' (/opt/pyenv/versions/3.7.13/lib/python3.7/site-packages/conans/__init__.py)
    
  • pkgconf/1.7.3@:
    Error running command conan export --name pkgconf --version 1.7.3 recipes/pkgconf/all/conanfile.py:

    ERROR: Error loading conanfile at '/home/conan/w/prod-v2_cci_PR-12219/recipes/pkgconf/all/conanfile.py': Unable to load conanfile in /home/conan/w/prod-v2_cci_PR-12219/recipes/pkgconf/all/conanfile.py
      File "<frozen importlib._bootstrap_external>", line 728, in exec_module
      File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
      File "/home/conan/w/prod-v2_cci_PR-12219/recipes/pkgconf/all/conanfile.py", line 9, in <module>
        from conans import tools as tools_legacy
    ImportError: cannot import name 'tools' from 'conans' (/opt/pyenv/versions/3.7.13/lib/python3.7/site-packages/conans/__init__.py)
    

Note: To save resources, CI tries to finish as soon as an error is found. For this reason you might find that not all the references have been launched or not all the configurations for a given reference. Also, take into account that we cannot guarantee the order of execution as it depends on CI workload and workers availability.

@ghost ghost mentioned this pull request Feb 13, 2023
@prince-chrismc prince-chrismc removed their assignment Feb 13, 2023
@SpaceIm SpaceIm closed this Feb 26, 2023
@SpaceIm SpaceIm deleted the pkgconf-conan-v2 branch February 26, 2023 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants