conan-io / conan-center-index

Recipes for the ConanCenter repository
https://conan.io/center
MIT License
945 stars 1.72k forks source link

[question] Error knowledge base doesn't contain entry for KB-H061 #8123

Open samuel-emrys opened 2 years ago

samuel-emrys commented 2 years ago

Failing builds in #7919 (https://github.com/conan-io/conan-center-index/pull/7919#issuecomment-974190776) give the following error message due to usage of tools.os_info.detect_windows_subsystem() in config_options():

[HOOK - conan-center.py] pre_export(): ERROR: [NO BUILD SYSTEM FUNCTIONS (KB-H061)] ... Build system dependent functions detected. (Use of tools.os_info is forbidden in config_options) (https://github.com/conan-io/conan-center-index/blob/master/docs/error_knowledge_base.md#KB-H061) 

KB-H061 doesn't seem to be documented in error_knowledge_base.md - is anybody able to provide an explanation of why we aren't allowed to/supposed to use tools.os_info in config_options()? And if there is a good reason, the documentation should be updated to reflect this.

samuel-emrys commented 2 years ago

@uilianries can you provide any guidance here?

prince-chrismc commented 2 years ago

@SpaceIm @madebr I recall there was a good reason for this hook but I am not able to find the PR that started it, if you have a chance please let us know if you recall the motivation.

I'll make sure to improve the docs (there's no 61) https://github.com/conan-io/conan-center-index/blob/master/docs/error_knowledge_base.md#kb-h060-no-crlf

SpaceIm commented 2 years ago

Because this method might be called on another machine than the build machine, and it shouldn't have any effect on its behavior.