Hooks does not like header_only=True and still looks for shared artifacts
Hooks does not like header_only=True and still looks for shared artifacts
Logs for packageID 5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9:
[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.libcxx=libstdc++11
compiler.version=5
os=Linux
[options]
spdlog:header_only=True
[...]
fmt/9.1.0 from 'conan-center' - Downloaded
spdlog/1.11.0 from local cache - Cache
Packages
fmt/9.1.0:a5622e849a9e9eb7139d949a99ea937ba24b3bef - Download
spdlog/1.11.0:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Build
Installing (downloading, building) binaries...
fmt/9.1.0: Retrieving package a5622e849a9e9eb7139d949a99ea937ba24b3bef from remote 'conan-center'
Downloading conanmanifest.txt
Downloading conaninfo.txt
Downloading conan_package.tgz
fmt/9.1.0: Package installed a5622e849a9e9eb7139d949a99ea937ba24b3bef
fmt/9.1.0: Downloaded package revision 62aab665a04b855fd97444f290578ab2
[HOOK - conan-center.py] pre_source(): [IMMUTABLE SOURCES (KB-H010)] OK
spdlog/1.11.0: Configuring sources in /home/conan/w/prod/BuildSingleReference/.conan/data/spdlog/1.11.0/_/_/source/src
spdlog/1.11.0:
[HOOK - conan-center.py] post_source(): [LIBCXX MANAGEMENT (KB-H011)] OK
[HOOK - conan-center.py] post_source(): [CPPSTD MANAGEMENT (KB-H022)] OK
[HOOK - conan-center.py] post_source(): [SHORT_PATHS USAGE (KB-H066)] OK
spdlog/1.11.0: Copying sources to build folder
spdlog/1.11.0: Building your package in /home/conan/w/prod/BuildSingleReference/.conan/data/spdlog/1.11.0/_/_/build/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9
spdlog/1.11.0: Generator txt created conanbuildinfo.txt
spdlog/1.11.0: Calling generate()
spdlog/1.11.0: Aggregating env generators
[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
spdlog/1.11.0: Calling build()
spdlog/1.11.0: Package '5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9' built
spdlog/1.11.0: Build folder /home/conan/w/prod/BuildSingleReference/.conan/data/spdlog/1.11.0/_/_/build/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/build/Release
spdlog/1.11.0: Generated conaninfo.txt
spdlog/1.11.0: Generated conanbuildinfo.txt
spdlog/1.11.0: Generating the package
spdlog/1.11.0: Package folder /home/conan/w/prod/BuildSingleReference/.conan/data/spdlog/1.11.0/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9
spdlog/1.11.0: Calling package()
spdlog/1.11.0: Copied 1 file: LICENSE
spdlog/1.11.0: Copied 99 '.h' files
[HOOK - conan-center.py] post_package(): [PACKAGE LICENSE (KB-H012)] OK
[HOOK - conan-center.py] post_package(): [DEFAULT PACKAGE LAYOUT (KB-H013)] OK
[HOOK - conan-center.py] post_package(): [MATCHING CONFIGURATION (KB-H014)] OK
[HOOK - conan-center.py] post_package(): [SHARED ARTIFACTS (KB-H015)] OK
[HOOK - conan-center.py] post_package(): [PC-FILES (KB-H020)] OK
[HOOK - conan-center.py] post_package(): [CMAKE-MODULES-CONFIG-FILES (KB-H016)] OK
[HOOK - conan-center.py] post_package(): [PDB FILES NOT ALLOWED (KB-H017)] OK
[HOOK - conan-center.py] post_package(): [LIBTOOL FILES PRESENCE (KB-H018)] OK
[HOOK - conan-center.py] post_package(): [MS RUNTIME FILES (KB-H021)] OK
[HOOK - conan-center.py] post_package(): [SHORT_PATHS USAGE (KB-H066)] OK
[HOOK - conan-center.py] post_package(): [MISSING SYSTEM LIBS (KB-H043)] OK
spdlog/1.11.0: 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
[HOOK - conan-center.py] post_package(): ERROR: [STATIC ARTIFACTS (KB-H074)] Package with 'shared=False' option did not contain any static artifact (https://github.com/conan-io/conan-center-index/blob/master/docs/error_knowledge_base.md#KB-H074)
ERROR: [HOOK - conan-center.py] post_package(): Some checks failed running the hook, check the output
Originally posted by @conan-center-bot in https://github.com/conan-io/conan-center-index/issues/14634#issuecomment-1341723616
https://github.com/conan-io/hooks/pull/457#issuecomment-1337066764
This PR was correct AFAIK, the configure delete should not be required with self.info.clear() in package_id
IMHO, options which are not used at all should be removed in configure() not package_id(). Options which are used in build(), package() etc but don't change package id should be removed in package_id().
When header_only=True, shared option doesn't make sense anymore, it has not effect and therefore should be removed in configure(). It's not like a convenient option which for example enable a verbose build or something like this, but lead to the same package artifacts, this option changes what happens during the build (but end result is the same).
So for me no this PR was not correct by allowing illformed recipes.