-
Notifications
You must be signed in to change notification settings - Fork 358
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
opam switch create . fails when _opam exists #5073
Comments
Can you precise the use case ? opam display a message when a local switch is already existing, and ask to clean up in case of failing initialisation:
|
The use case was having created a switch on one branch, checking out a new branch, and trying to create a new switch. E.g.
I've since realized |
That sounds like a better solution than what we were doing! Apologies, I think this is just a case of me being unfamiliar with OCaml's tooling. Perhaps prompting the user to |
My use case probably only applies to Meta employees, but we have a related issue. I'd love to see a We use Eden for our source control, which uses a virtual filesystem to download files on demand and track all local changes. Writing into But |
Here's a simple (but admittedly impulsive/careless) way how new users end up with a broken switch:
Saving grace is that searching the Internet for For this use case, either of the proposals mentioned by @RyanGibb (interactively prompting, or appending a message that gives a hint on how to remove the switch) would be helpful, as it means that the new user doesn't need to do an Internet search to resolve their issue. |
What about prompting a link to a FAQ entry that summarises all cases (switch to remove and checkout new branch for the moment). The message will be cleaner and it is fast to update when a new case appears. |
That would be a big improvement for struggling new users, I think. The advantage of being able to update the FAQ without having to do a release is a strong point in favor of this solution. That leaves @mroch's issue, which is separate from the new user experience. |
Just showing @RyanGibb how to setup an opam environment from scratch, and we observed that it's quite confusing when
opam switch create .
fails that it's not idempotent. If an _opam directory exists, then it fails but doesn't give a hint on how to continue. We had torm -rf _opam
(which doesn't seem safe to a beginner) and thenopam switch create .
again once the underlying issue was fixed.It would be nice if
opam switch create
would give a direction on how to recover from the fact that an _opam directory exists already, perhaps with a deletion instruction or a-f
to continue regardless.The text was updated successfully, but these errors were encountered: