@@ -602,7 +602,7 @@ def configure(self):
602602
603603def test_transitive_build_scripts_error ():
604604 # https://github.com/conan-io/conan/issues/18235
605- c = TestClient ()
605+ c = TestClient (light = True )
606606 meta = textwrap .dedent ("""
607607 from conan import ConanFile
608608
@@ -631,3 +631,29 @@ def requirements(self):
631631 c .run ("create meta" )
632632 c .run ("install product" )
633633 # It doesn't crash
634+
635+
636+ def test_transitive_build_scripts_library_error ():
637+ # https://github.com/conan-io/conan/issues/18856
638+ c = TestClient (light = True )
639+ tool = textwrap .dedent ("""
640+ from conan import ConanFile
641+
642+ class Product(ConanFile):
643+ name = "tool"
644+ version = "0.1"
645+ package_type = "build-scripts"
646+ def requirements(self):
647+ self.requires("dep/0.1")
648+ """ )
649+
650+ c .save ({"dep/conanfile.py" : GenConanfile ("dep" , "0.1" ).with_package_type ("static-library" ),
651+ "tool/conanfile.py" : tool })
652+ c .run ("create dep" )
653+ c .run ("create tool" )
654+ # Tool-requires, not an issue
655+ c .run ("install --tool-requires=tool/0.1" )
656+ # requires, it crashed with traceback, now a clear error message
657+ c .run ("install --requires=tool/0.1" , assert_error = True )
658+ assert ("ERROR: Package 'tool/0.1' with type 'build-scripts' cannot have "
659+ "a 'static-library' dependency to 'dep/0.1'" ) in c .out
0 commit comments