Having crates that are both workspace members and not
Problem
I'd like to treat some crates in my workspace as independent packages because they will be built in the Cloud independently from the other crates in the workspace. On the other hand, I use the workspace to improve the local development experience.
I've got a shared lib. I install it as a git URL to be independent.
But I overwrite it in the .cargo/config.toml to use my local path instead, during the development.
Currently, because of the workspace I get a single Cargo.lock file and a single target folder in the root. The package update also doesn't work because of the override. So I cannot treat it independently. I manually have to remove it from the workspace, and disable the override, when I release.
I'd like to have another Cargo.lock inside the "independent" member crates. With target folder as well.
Proposed Solution
It would be good to have a cargo --treat-independently flag, that would ignore the existence of workspace for that command only.
It would be also good to have a cargo --ignore-patch flag that would ignore the overrides like this:
[patch.'ssh://[email protected]/Final-Mile/dropit-service-lib.git']
dropit-service-lib = { path = './dropit-service-lib' }
So that I could update the dependencies.
Notes
No response
For ignoring patches, you can rename the config file to something like .carog/myconfig.toml and load it on demand with --config flag. It accepts a path to extra config file.
For treating independently, can you expand more on this? I can't see why they don't fit in the same workspace.