After spending more time with this I got my project to successfully compile offline. By replacing my version dependencies with path dependencies and then compiling online, I am able to compile offline. Indeed, the previously mentioned link provides this solution but it comes with its own problems:
- There is an initial need to compile online before any compilation offline can be done. This happens even if the only things that have changed are path dependencies.
- I cannot individually publish modules like this because they have path dependencies in them. This is the issue I was trying to resolve by using ‘.cargo/config’. The top level of my project is a typescript/electron program which loads an exe (backend) and dlls (plugins) and provides a GUI for them. The two rust modules (the .exe and .dll) share another module in the project and ideally would be published separately. If I wanted to work offline, it looks like I would have to maintain two cargo.toml files for each module, one for developing, and one for publishing.
Combining 1 and 2, I would have to know I was going to be offline before hand so that I could switch to the .toml files with path dependencies and then do a cargo fetch while still online.
Note: to be a little more clear about my setup, this is what it looks like:
|- frontend (typescript)
|- backend (rust, .exe, depends on environment)
|- plugins (rust, .dll, depends on environment, there may be multiple plugins)
|- environment (rust, .rlib)