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

fix build-scripts creation #13433

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion conan/cli/commands/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@ def create(conan_api, parser, *args):
# TODO: This section might be overlapping with ``graph_compute()``
requires = [ref] if not args.build_require else None
tool_requires = [ref] if args.build_require else None

# FIXME: Dirty: package type still raw, not processed yet
# TODO: Why not for package_type = "application" like cmake to be used as build-require?
if conanfile.package_type == "build-scripts" and not args.build_require:
# swap them
requires, tool_requires = tool_requires, requires
deps_graph = conan_api.graph.load_graph_requires(requires, tool_requires,
profile_host=profile_host,
profile_build=profile_build,
Expand Down
14 changes: 12 additions & 2 deletions conans/test/integration/graph/test_skip_binaries.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import re

from conans.test.assets.genconanfile import GenConanfile
from conans.test.utils.tools import TestClient, NO_SETTINGS_PACKAGE_ID

Expand Down Expand Up @@ -82,3 +80,15 @@ def test_test_requires():
client.save({"conanfile.py": GenConanfile().with_requires("pkg/1.0")})
client.run("create . --name=app --version=1.0")
client.assert_listed_binary({"gtest/1.0": (package_id, "Skip")}, test=True)


def test_build_scripts_no_skip():
c = TestClient()
c.save({"scripts/conanfile.py": GenConanfile("script", "0.1").with_package_type("build-scripts"),
"app/conanfile.py": GenConanfile().with_tool_requires("script/0.1")})
c.run("create scripts")
c.assert_listed_binary({"script/0.1": ("da39a3ee5e6b4b0d3255bfef95601890afd80709", "Build")},
build=True)
c.run("install app")
c.assert_listed_binary({"script/0.1": ("da39a3ee5e6b4b0d3255bfef95601890afd80709", "Cache")},
build=True)