Home > Enterprise >  Removed dev Pkg before free (1.6 and 1.7)
Removed dev Pkg before free (1.6 and 1.7)

Time:12-05

Crosspost here.

I added a package and then deved it and then removed it before freeing it. Now I am getting an error that I can’t fix. I removed the registries directory and also downloaded julia 1.7 and started fresh (for new Manifest and Project files), but I get the following error:

(@v1.7) pkg> add https://github.com/jacob-roth/PowerDynamics.jl.git
     Cloning git-repo `https://github.com/jacob-roth/PowerDynamics.jl.git`
ERROR: failed to clone from https://github.com/jacob-roth/PowerDynamics.jl.git, error: GitError(Code:ERROR, Class:OS, could not remove directory /Users/myuser/.julia/clones/231828409692979274/refs/remotes/origin/compathelper/new_version/2020-08-01-00-06-19-852-2271493462': parent is not directory: Not a directory)

The clone /Users/myuser/.julia/clones/231828409692979274/ does not exist. What can I do? I've tried rming the package PowerDynamics, downloading a fresh version of julia and retrying, and also deleting the whole .julia/ directory, but i still get the same error.

CodePudding user response:

The repository at https://github.com/jacob-roth/PowerDynamics.jl.git is (whether accidentally or deliberately) unfriendly to macOS and Windows users: there is one branch there named CompatHelper, and then a series of three branches named compathelper/new_version/date. You can see these in the GitHub view by going to this URL.

On a Linux or Unix box, CompatHelper is a completely different file-or-directory name from compathelper. So it's possible to create both a file named CompatHelper, and a directory named compathelper, in the same location in the file system. But on the default setup on your macOS system, it is not possible to do this. Git thinks it should just happen automatically, and hence just work, but it doesn't, and this is causing your git clone to fail.

This particular Git bug will probably eventually be fixed, but for now, clone the repository into a case-sensitive file system. You can create one easily on your macOS system; see my answer here. This will sidestep most other problems, although macOS still can't create certain names that Linux can.

CodePudding user response:

Can't reproduce but maybe

>rm PowerDynamics

would help. Also, you can delete PowerDynamics from Manifest.toml and Project.toml manually if it's stuck.

  • Related