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 error message for deploy folder #16723

Merged
merged 2 commits into from
Jul 24, 2024
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
5 changes: 4 additions & 1 deletion conan/internal/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ def _load(path):


def do_deploys(conan_api, graph, deploy, deploy_package, deploy_folder):
mkdir(deploy_folder)
try:
mkdir(deploy_folder)
except Exception as e:
raise ConanException(f"Deployer folder cannot be created '{deploy_folder}':\n{e}")
# handle the recipe deploy()
if deploy_package:
# Similar processing as BuildMode class
Expand Down
12 changes: 12 additions & 0 deletions test/functional/command/test_install_deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,18 @@ def package_info(self):
assert f'export MYPATH="{some_abs_path}/mypath"' in env


def test_deploy_incorrect_folder():
# https://github.com/conan-io/cmake-conan/issues/658
c = TestClient()
c.save({"conanfile.txt": ""})
c.run('install . --deployer=full_deploy --deployer-folder="mydep fold"')
assert os.path.exists(os.path.join(c.current_folder, "mydep fold"))
if platform.system() == "Windows": # This only fails in Windows
c.run(r'install . --deployer=full_deploy --deployer-folder="\"mydep fold\""',
assert_error=True)
assert "ERROR: Deployer folder cannot be created" in c.out


class TestRuntimeDeployer:
def test_runtime_deploy(self):
c = TestClient()
Expand Down