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

[feature] Add option to delete necessary files / directories when running conan config install #9885

Closed
1 task done
jwillikers opened this issue Oct 27, 2021 · 6 comments · Fixed by #9908
Closed
1 task done

Comments

@jwillikers
Copy link
Contributor

jwillikers commented Oct 27, 2021

An issue that I've run into is that restructuring the structure of Conan profiles in a shared Conan configuration via Git can fail when switching a file to a directory of the same name or vice versa.
This pretty much fails without explanation, so the error message should probably be improved.
Perhaps it would be best to make this default behavior, which wouldn't require anything special to ensure scheduled runs of conan config install don't break. Otherwise, there could be an option like --force which would all overwriting any conflicting directories / files.

To reproduce this issue:

  1. Create a git repository to share Conan configuration through conan config install.
mkdir conan-config
cd conan-config
mkdir profiles
mkdir -p profiles/debug
touch profiles/debug/address-sanitizer
git init
git add -A
git commit -m "Initial commit"
  1. Install the repository using conan config install.
conan config install .
  1. Now re-organize such that a directory is now a file in the conan-config repository.
mv profiles/debug/address-sanitizer profiles/address-sanitizer
rmdir profiles/debug
touch profiles/debug
git add -A
git commit -m "Restructure profiles"
  1. Re-run conan config install to update the profiles.
conan config install
Config install:  /var/home/jordan/Projects/test/conan-config
Copying file address-sanitizer to /var/home/jordan/.conan/profiles
Copying file debug to /var/home/jordan/.conan/profiles
ERROR: Failed conan config install:

Note the vague error message.

@lasote lasote self-assigned this Oct 28, 2021
@lasote
Copy link
Contributor

lasote commented Oct 28, 2021

Hi, I think I understand but do you have an error trace you can share? Sounds a bit like a corner case, right?

@jwillikers
Copy link
Contributor Author

jwillikers commented Oct 28, 2021

@lasote Sorry, I probably should have filed this using the bug template. I'll update the issue to describe the exact steps to make this happen. I don't think this is quite a corner case, though, as I think this could reasonably happen under normal usage of the conan config install command, especially as things are better organized as they grow and evolve over time.

@jwillikers
Copy link
Contributor Author

@lasote I've added steps to reproduce the issue including the error trace... not that it is much of an error trace.

@lasote
Copy link
Contributor

lasote commented Oct 29, 2021

Thanks, I see not that is not that weird and is totally unexpected. I'll check what can we improve.

@lasote
Copy link
Contributor

lasote commented Oct 29, 2021

A fix will be released in 1.43.
It will remove the previous file if a directory is going to be copied and it will remove the directory if now a file is going to be copied.

@jwillikers
Copy link
Contributor Author

Awesome, that's fantastic!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants