diff --git a/.c3i/authorized_users.yml b/.c3i/authorized_users.yml index 43bb0daf550e60..6e6068e0e11872 100644 --- a/.c3i/authorized_users.yml +++ b/.c3i/authorized_users.yml @@ -1048,3 +1048,4 @@ authorized_users: - ahmed192a - maxpagani - tim-goto +- tannerbitz diff --git a/.c3i/config_v2.yml b/.c3i/config_v2.yml index 430257ca16ba4b..0062897c305947 100644 --- a/.c3i/config_v2.yml +++ b/.c3i/config_v2.yml @@ -46,7 +46,7 @@ tasks: configurations: - id: linux-gcc - epochs: [0, 20220628] + epochs: [0, 20211221, 20220120, 20220628] hrname: "Linux, GCC" build_profile: os: "Linux" @@ -59,7 +59,7 @@ configurations: compiler.version: ["11"] build_type: ["Release"] - id: configs/macos-clang - epochs: [0, 20220628] + epochs: [0, 20211221, 20220120, 20220628] hrname: "macOS, Clang" build_profile: os: "Macos" @@ -72,7 +72,7 @@ configurations: compiler.libcxx: [ "libc++" ] build_type: [ "Release"] - id: configs/macos-m1-clang - epochs: [0, 20220628] + epochs: [0, 20211221, 20220120, 20220628] hrname: "macOS M1, Clang" build_profile: os: "Macos" @@ -86,7 +86,7 @@ configurations: compiler.libcxx: [ "libc++" ] build_type: [ "Release"] - id: configs/windows-msvc - epochs: [0, 20220628] + epochs: [0, 20211221, 20220120, 20220628] hrname: "Windows, MSVC" build_profile: os: "Windows" diff --git a/.github/workflows/alert-community.yml b/.github/workflows/alert-community.yml index 8830cbca773790..5eeed68fcfd6cd 100644 --- a/.github/workflows/alert-community.yml +++ b/.github/workflows/alert-community.yml @@ -64,7 +64,7 @@ jobs: - uses: ./.github/actions/alert-community with: files: "recipes/boost/*/*" - reviewers: "@Hopobcn @jwillikers" + reviewers: "@grafikrobot @Hopobcn @jwillikers" - uses: ./.github/actions/alert-community with: diff --git a/docs/faqs.md b/docs/faqs.md index d950fc51c3d9db..ee0c09a480f3fc 100644 --- a/docs/faqs.md +++ b/docs/faqs.md @@ -438,3 +438,27 @@ Generally no, these sorts of options can most likely be set from a profile or do and would otherwise dynamically embed this into the CMake config files or generated pkg-config files then it should be allowed. Doing so requires [deleting the option from the `package_id`](adding_packages/conanfile_attributes.md#removing-from-package_id). + +## Can I use full_package_mode for a requirement in my recipe? + +For some irregular projects, they may need to be aligned when being used as a requirement, using the very same version, options, and settings and maybe not mixing shared with static linkage. +Those projects usually break between patch versions and are very sensitive, so we can not use different versions through Conan graph dependencies, +otherwise, it may result in unexpected behavior or even runtime errors. + +A very known project is GLib, which requires the very same configuration to prevent multiple instances when using static linkage. +As a solution, we could consume GLib on full package id mode, like: + +```python +def package_id(self): + self.info.requires["glib"].full_package_mode() +``` + +Perfect solution on the consumer side, but there is a side-effect: CCI will not re-generate all involved packages for any change in the dependencies graph with which glib is associated, which means, users will start to see **MISSING_PACKAGES** error during their pull requests. +As a trade-off, it would be necessary to update all recipes involved, by opening new PRs, +then it should generate new packages, but it takes many days and still is a process that is not supported by CCI internally. + +To have more context about it, please, visit issues #11684 and #11022 + +In summary, we do not recommend `full_package_mode` or any other custom package id mode for requirements on CCI, it will break other PRs soon or later. +Instead, prefer using `shared=True` by default, when needed. +Also, when having a similar situation, do not hesitate in opening an issue explaining your case, and ask for support from the community. diff --git a/recipes/b2/config.yml b/recipes/b2/config.yml index 72ab4de1e5c670..0c5e840b204a27 100644 --- a/recipes/b2/config.yml +++ b/recipes/b2/config.yml @@ -41,3 +41,5 @@ versions: folder: portable "4.9.3": folder: portable + "4.9.4": + folder: portable diff --git a/recipes/b2/portable/conandata.yml b/recipes/b2/portable/conandata.yml index 0ce27c0e93f9c0..a0a9743d8c2eb7 100644 --- a/recipes/b2/portable/conandata.yml +++ b/recipes/b2/portable/conandata.yml @@ -50,3 +50,6 @@ sources: "4.9.3": url: "https://github.com/bfgroup/b2/archive/4.9.3.tar.gz" sha256: "4524b8ecf138a9087aa24b8889c44ea7ae9f2d373acc9535d72fb048c213e1b9" + "4.9.4": + url: "https://github.com/bfgroup/b2/releases/download/4.9.4/b2-4.9.4.tar.bz2" + sha256: "1996d8098955ad3fdecab242d784afaef0fba80dd5d2ef0b3a41592e26772312" diff --git a/recipes/libtool/all/conanfile.py b/recipes/libtool/all/conanfile.py index 3843f0c1e4e32f..6f90b31da6ebcc 100644 --- a/recipes/libtool/all/conanfile.py +++ b/recipes/libtool/all/conanfile.py @@ -45,12 +45,16 @@ def configure(self): self.options.rm_safe("fPIC") self.settings.rm_safe("compiler.libcxx") self.settings.rm_safe("compiler.cppstd") + def layout(self): basic_layout(self, src_folder="src") def requirements(self): self.requires("automake/1.16.5") - #self.requires("m4/1.4.19") TODO: add as runtime dependency + + #TODO: consider adding m4 as direct dependency, perhaps when we start using version ranges. + # https://github.com/conan-io/conan-center-index/pull/16248#discussion_r1116332095 + #self.requires("m4/1.4.19") @property def _settings_build(self): @@ -221,8 +225,6 @@ def package_info(self): # Define environment variables such that libtool m4 files are seen by Automake libtool_aclocal_dir = os.path.join(self._datarootdir, "aclocal") - self.output.info("Appending ACLOCAL_PATH env: {}".format(libtool_aclocal_dir)) - self.output.info("Appending AUTOMAKE_CONAN_INCLUDES environment variable: {}".format(libtool_aclocal_dir)) self.buildenv_info.append_path("ACLOCAL_PATH", libtool_aclocal_dir) self.buildenv_info.append_path("AUTOMAKE_CONAN_INCLUDES", libtool_aclocal_dir) @@ -231,7 +233,7 @@ def package_info(self): # For Conan 1.x downstream consumers, can be removed once recipe is Conan 1.x only: bin_path = os.path.join(self.package_folder, "bin") - self.output.info("Appending PATH env: {}".format(bin_path)) + self.output.info(f"Appending PATH env: bin_path{bin_path}") self.env_info.PATH.append(bin_path) self.env_info.ACLOCAL_PATH.append(unix_path_package_info_legacy(self, libtool_aclocal_dir)) diff --git a/recipes/libtool/all/test_package/conanfile.py b/recipes/libtool/all/test_package/conanfile.py index 6c3b7744e119e1..fa6b79d0ca968f 100644 --- a/recipes/libtool/all/test_package/conanfile.py +++ b/recipes/libtool/all/test_package/conanfile.py @@ -1,4 +1,4 @@ -from conan import ConanFile, conan_version +from conan import ConanFile from conan.tools.build import cross_building, can_run from conan.tools.env import Environment, VirtualBuildEnv, VirtualRunEnv from conan.tools.files import chdir, mkdir, rmdir @@ -7,7 +7,7 @@ from conan.tools.gnu import AutotoolsToolchain, Autotools from conan.tools.microsoft import is_msvc, unix_path from conan.tools.apple import is_apple_os -from conan.tools.scm import Version + import glob import os import shutil diff --git a/recipes/libtool/all/test_v1_package/conanfile.py b/recipes/libtool/all/test_v1_package/conanfile.py index 1446b8742cd0d7..4b29d6a395ef77 100644 --- a/recipes/libtool/all/test_v1_package/conanfile.py +++ b/recipes/libtool/all/test_v1_package/conanfile.py @@ -46,9 +46,7 @@ def _build_autotools(self): # Copy autotools directory to build folder shutil.copytree(os.path.join(self.source_folder, "autotools"), os.path.join(self.build_folder, "autotools")) with tools.chdir("autotools"): - # Work around the fact that "used_special_vars" in conans/client/tools/win.py doesn't handle ACLOCAL_PATH - aclocal_path = "$ACLOCAL_PATH:" + self.deps_env_info.vars["ACLOCAL_PATH"][0].lower() - self.run("ACLOCAL_PATH={} autoreconf --install --verbose -Wall".format(aclocal_path), win_bash=tools.os_info.is_windows) + self.run("autoreconf --install --verbose -Wall", win_bash=tools.os_info.is_windows) tools.mkdir(self._package_folder) conf_args = [ @@ -120,9 +118,7 @@ def _build_static_lib_in_shared(self): # Copy autotools directory to build folder with tools.chdir(autotools_folder): - # Work around the fact that "used_special_vars" in conans/client/tools/win.py doesn't handle ACLOCAL_PATH - aclocal_path = "$ACLOCAL_PATH:" + self.deps_env_info.vars["ACLOCAL_PATH"][0].lower() - self.run("ACLOCAL_PATH={} autoreconf -ifv -Wall".format(aclocal_path), win_bash=tools.os_info.is_windows) + self.run("autoreconf -ifv -Wall", win_bash=tools.os_info.is_windows) with tools.chdir(autotools_folder): conf_args = [ diff --git a/recipes/libudev/all/conanfile.py b/recipes/libudev/all/conanfile.py index bb1bde611d37b1..5e4c2d609e88c7 100644 --- a/recipes/libudev/all/conanfile.py +++ b/recipes/libudev/all/conanfile.py @@ -1,7 +1,7 @@ from conan import ConanFile -from conan.errors import ConanException, ConanInvalidConfiguration +from conan.errors import ConanInvalidConfiguration from conan.tools.system import package_manager -from conans import tools +from conan.tools.gnu import PkgConfig required_conan_version = ">=1.47" @@ -21,27 +21,7 @@ def validate(self): raise ConanInvalidConfiguration("libudev is only supported on Linux.") def package_id(self): - self.info.header_only() - - def _fill_cppinfo_from_pkgconfig(self, name): - pkg_config = tools.PkgConfig(name) - if not pkg_config.provides: - raise ConanException("libudev development files aren't available, give up") - libs = [lib[2:] for lib in pkg_config.libs_only_l] - lib_dirs = [lib[2:] for lib in pkg_config.libs_only_L] - ldflags = [flag for flag in pkg_config.libs_only_other] - include_dirs = [include[2:] for include in pkg_config.cflags_only_I] - cflags = [flag for flag in pkg_config.cflags_only_other if not flag.startswith("-D")] - defines = [flag[2:] for flag in pkg_config.cflags_only_other if flag.startswith("-D")] - - self.cpp_info.system_libs = libs - self.cpp_info.libdirs = lib_dirs - self.cpp_info.sharedlinkflags = ldflags - self.cpp_info.exelinkflags = ldflags - self.cpp_info.defines = defines - self.cpp_info.includedirs = include_dirs - self.cpp_info.cflags = cflags - self.cpp_info.cxxflags = cflags + self.info.clear() def system_requirements(self): dnf = package_manager.Dnf(self) @@ -62,4 +42,5 @@ def system_requirements(self): def package_info(self): self.cpp_info.includedirs = [] self.cpp_info.libdirs = [] - self._fill_cppinfo_from_pkgconfig("libudev") + pkg_config = PkgConfig(self, "libudev") + pkg_config.fill_cpp_info(self.cpp_info) diff --git a/recipes/libudev/all/test_package/CMakeLists.txt b/recipes/libudev/all/test_package/CMakeLists.txt index f20128e28a1d5d..c22649f436e095 100644 --- a/recipes/libudev/all/test_package/CMakeLists.txt +++ b/recipes/libudev/all/test_package/CMakeLists.txt @@ -1,9 +1,6 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.15) project(test_package C) -include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) -conan_basic_setup(TARGETS) - find_package(libudev REQUIRED CONFIG) diff --git a/recipes/libudev/all/test_package/conanfile.py b/recipes/libudev/all/test_package/conanfile.py index 49a3a66ea5bad4..07906beea6e200 100644 --- a/recipes/libudev/all/test_package/conanfile.py +++ b/recipes/libudev/all/test_package/conanfile.py @@ -1,10 +1,18 @@ -from conans import ConanFile, CMake, tools +from conan import ConanFile +from conan.tools.cmake import cmake_layout, CMake +from conan.tools.build import can_run import os - class TestPackageConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - generators = "cmake", "cmake_find_package_multi" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) def build(self): cmake = CMake(self) @@ -12,6 +20,6 @@ def build(self): cmake.build() def test(self): - if not tools.cross_building(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindirs[0], "test_package") + self.run(bin_path, env="conanrun") diff --git a/recipes/libudev/all/test_v1_package/CMakeLists.txt b/recipes/libudev/all/test_v1_package/CMakeLists.txt new file mode 100644 index 00000000000000..925ecbe19e448d --- /dev/null +++ b/recipes/libudev/all/test_v1_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup(TARGETS) + +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../test_package/ + ${CMAKE_CURRENT_BINARY_DIR}/test_package/) diff --git a/recipes/libudev/all/test_v1_package/conanfile.py b/recipes/libudev/all/test_v1_package/conanfile.py new file mode 100644 index 00000000000000..5a05af3c2dfd2f --- /dev/null +++ b/recipes/libudev/all/test_v1_package/conanfile.py @@ -0,0 +1,18 @@ +from conans import ConanFile, CMake +from conan.tools.build import cross_building +import os + + +class TestPackageV1Conan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "cmake", "cmake_find_package_multi" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if not cross_building(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/pkgconf/all/conanfile.py b/recipes/pkgconf/all/conanfile.py index 3e6fa1cbfd1c2a..33928609ef2e5a 100644 --- a/recipes/pkgconf/all/conanfile.py +++ b/recipes/pkgconf/all/conanfile.py @@ -1,7 +1,6 @@ import os from conan import ConanFile -from conan.tools.build import cross_building from conan.tools.env import VirtualBuildEnv from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rename, rm, rmdir, replace_in_file from conan.tools.layout import basic_layout @@ -53,10 +52,6 @@ def configure(self): self.settings.rm_safe("compiler.libcxx") self.settings.rm_safe("compiler.cppstd") - def validate(self): - if cross_building(self): - raise ConanInvalidConfiguration("Cross-building is not implemented in the recipe, contributions welcome.") - def build_requirements(self): self.tool_requires("meson/1.0.0") diff --git a/recipes/zstd/all/conandata.yml b/recipes/zstd/all/conandata.yml index ba5017ac339e20..b1f62bc5ebf115 100644 --- a/recipes/zstd/all/conandata.yml +++ b/recipes/zstd/all/conandata.yml @@ -40,6 +40,10 @@ patches: - patch_file: "patches/1.5.2-cmake-remove-asm-except-x86_64.patch" patch_description: "use assembler codes only on x86_64" patch_type: "portability" + - patch_file: "patches/1.5.4-decrease-min-cmake-version.patch" + patch_description: "Don't require CMake 3.18 or later" + patch_type: "portability" + patch_source: "https://github.com/facebook/zstd/pull/3510" "1.5.2": - patch_file: "patches/1.5.2-cmake-remove-asm-except-x86_64.patch" patch_description: "use assembler codes only on x86_64" diff --git a/recipes/zstd/all/conanfile.py b/recipes/zstd/all/conanfile.py index 13756c49621214..0b3e82a7fef9c8 100644 --- a/recipes/zstd/all/conanfile.py +++ b/recipes/zstd/all/conanfile.py @@ -15,6 +15,7 @@ class ZstdConan(ConanFile): topics = ("zstandard", "compression", "algorithm", "decoder") license = "BSD-3-Clause" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -43,22 +44,6 @@ def configure(self): def layout(self): cmake_layout(self, src_folder="src") - def _cmake_new_enough(self, required_version): - try: - import re - from io import StringIO - output = StringIO() - self.run("cmake --version", output=output) - m = re.search(r'cmake version (\d+\.\d+\.\d+)', output.getvalue()) - return Version(m.group(1)) >= required_version - except: - return False - - def build_requirements(self): - # zstd/>=1.5.4 uses `check_linker_flag` which is introduced since cmake 3.1.8. - if Version(self.version) >= "1.5.4" and not self._cmake_new_enough("3.18"): - self.tool_requires("cmake/3.25.2") - def source(self): get(self, **self.conan_data["sources"][self.version], strip_root=True) diff --git a/recipes/zstd/all/patches/1.5.4-decrease-min-cmake-version.patch b/recipes/zstd/all/patches/1.5.4-decrease-min-cmake-version.patch new file mode 100644 index 00000000000000..d846e0df710df5 --- /dev/null +++ b/recipes/zstd/all/patches/1.5.4-decrease-min-cmake-version.patch @@ -0,0 +1,36 @@ +--- a/build/cmake/CMakeModules/AddZstdCompilationFlags.cmake ++++ b/build/cmake/CMakeModules/AddZstdCompilationFlags.cmake +@@ -1,6 +1,15 @@ + include(CheckCXXCompilerFlag) + include(CheckCCompilerFlag) +-include(CheckLinkerFlag) ++# VERSION_GREATER_EQUAL requires CMake 3.7 or later. ++# https://cmake.org/cmake/help/latest/command/if.html#version-greater-equal ++if (CMAKE_VERSION VERSION_LESS 3.18) ++ set(ZSTD_HAVE_CHECK_LINKER_FLAG false) ++else () ++ set(ZSTD_HAVE_CHECK_LINKER_FLAG true) ++endif () ++if (ZSTD_HAVE_CHECK_LINKER_FLAG) ++ include(CheckLinkerFlag) ++endif() + + function(EnableCompilerFlag _flag _C _CXX _LD) + string(REGEX REPLACE "\\+" "PLUS" varname "${_flag}") +@@ -20,7 +29,15 @@ function(EnableCompilerFlag _flag _C _CXX _LD) + endif () + endif () + if (_LD) +- CHECK_LINKER_FLAG(C ${_flag} LD_FLAG_${varname}) ++ # We never add a linker flag with CMake < 3.18. We will ++ # implement CHECK_LINKER_FLAG() like feature for CMake < 3.18 ++ # or require CMake >= 3.18 when we need to add a required ++ # linker flag in future. ++ if (ZSTD_HAVE_CHECK_LINKER_FLAG) ++ CHECK_LINKER_FLAG(C ${_flag} LD_FLAG_${varname}) ++ else () ++ set(LD_FLAG_${varname} false) ++ endif () + if (LD_FLAG_${varname}) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${_flag}" PARENT_SCOPE) + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${_flag}" PARENT_SCOPE)