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

Improve the error message when trying to use a build-scripts package as a regular requirement #15366

Open
wants to merge 1 commit into
base: develop2
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions conans/model/requires.py
Expand Up @@ -289,6 +289,8 @@ def transform_downstream(self, pkg_type, require, dep_pkg_type):
downstream_require = Requirement(require.ref, headers=False, libs=False, run=require.run)
elif pkg_type is PackageType.HEADER:
downstream_require = Requirement(require.ref, headers=require.headers, libs=require.libs, run=require.run)
elif pkg_type is PackageType.BUILD_SCRIPTS:
raise ConanError("build-scripts package must be used as a tool_requires(), not a regular requirement")
Copy link
Member

Choose a reason for hiding this comment

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

This check is about a build-script depending on a library, not really about it being used as regular requires. This might be an extra check to do, but it seems we want to do a general check over build-scripts being used only as tool-requires

else:
assert pkg_type == PackageType.UNKNOWN
# TODO: This is undertested, changing it did not break tests
Expand Down