Failed to load source for a dependency on `ocl`


#1

So recently I got a very weird error on trying to do cargo update:

alex@botev-ThinkPad-T440:~/work/metadiff/gir$ cargo update 
    Updating registry `https://github.com/rust-lang/crates.io-index`
    Updating git repository `https://github.com/Metadiff/symbolic_polynomials`
    Updating git repository `https://github.com/cogciprocate/ocl/`
error: failed to load source for a dependency on `ocl`

Caused by:
  Unable to update https://github.com/cogciprocate/ocl/

Caused by:
  Could not find `Cargo.toml` in `/home/nick/src/github.com/cogciprocate/ocl`

Weird thing is that my username is not nick so /home/nick does not even exist. Any ideas where this is coming from?


#2

Possibly has something to do with this commit. @c0gent any ideas?


#3

Yeah actually I’ve posted this too prematurly… after a bit of time I realized it must have been hard coded somewhere and raised an issue.


#4

Slightly delayed response (didn’t receive e-mail for some reason) …

The cause of this was that I had moved an example sub-project (a self contained project within the examples folder) into another sub-folder within the examples folder. That second sub-folder also happened to be a workspace of the primary crate. Because of this, the originally moved example sub-crate was still being searched for a Cargo.toml which now happened to contain a path that was no longer valid. Because this all happened during the process of a bunch of local development, Cargo must have had the dependency for the invalid path cached on my machine and it never gave me any problems.

Had I tried to publish the base crate in this configuration it would have errored and I would have eventually found the problem. In this case however, Botev pulled directly from Github and ran into the error above.

After cloning the repo myself on another machine I got the same, head-scratching, error and really just by luck happened to track the problem down pretty quickly by disabling all workspaces (since it was something I knew I had added recently).

Anyway I just put this here in case anyone finds this post in the future. I’ve been meaning to file a bug report about the inadequate error message but I never could decide how to describe the problem and well… I’m lazy.