Skip to content
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
1 change: 1 addition & 0 deletions conan/api/subapi/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ def find_folder(ref):
# To inject things like cmd_wrapper to the consumer conanfile, so self.run() works
helpers = ConanApp(self._conan_api).loader._conanfile_helpers # noqa
conanfile._conan_helpers = helpers
conanfile._conan_is_consumer = True
initialize_conanfile_profile(conanfile, profile_build, profile_host, CONTEXT_HOST,
is_build_require=False)
# consumer_definer(conanfile, profile_host, profile_build)
Expand Down
22 changes: 22 additions & 0 deletions test/integration/workspace/test_workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -825,6 +825,28 @@ def package(self):
assert "pkg" not in folders
assert os.path.isfile(os.path.join(deploy_folder, "dep", "1.0", "myfile.txt"))

def test_customize_generator_per_package(self):
# https://github.com/conan-io/conan/issues/19326
c = TestClient(light=True)

pkg = GenConanfile("pkg", "0.1")
workspace = textwrap.dedent("""\
from conan import Workspace, ConanFile

class MyWs(ConanFile):
pass

class Ws(Workspace):
def root_conanfile(self):
return MyWs
""")
c.save({"pkg/conanfile.py": pkg,
"conanws.py": workspace})
c.run("workspace add pkg")
c.run("workspace super-install -c acme*:tools.cmake.cmaketoolchain:generator=Ninja")
# It no longer crashes
assert "Install finished successfully" in c.out


def test_workspace_with_local_recipes_index():
c3i_folder = temp_folder()
Expand Down
Loading