Cargo_toml no longer able to load Manifest

I have a wrapper tool that needs to parse Cargo.toml. I use cargo_toml for this, and it has been working fine until recently when I noticed that it would not load 2024 edition Cargo.toml. I updated the cargo_toml dependency, but now it instead fails with:

Manifest error; can't load root workspace: No such file or directory (os error 2)

This is a standalone crate, not in a workspace, but I can't see any way to tell cargo_toml to not try to treat a crate as being part of a workspace.

Anyone know how to do this?

(One has to go back to 0.19 of cargo_toml for it to not fail, but that hits the edition problem instead).

The logic for computing whether a package needs a workspace or not can be found here:

Maybe your manifest hasn't set one of the keys in a way that satisfies cargo_toml that it belongs to a standalone package?

1 Like

That is exactly it -- thank you!

My tool is used as a wrapper for crate maintenance, and it supports publishing to a private registry. One of the reasons for this tool, and the registry, is to support work-in-progress crates, so I don't have to fill in all the metadata that's required by crates.io. :upside_down_face:

1 Like

Haha, I guess you tricked Kornel with that one :sweat_smile:

1 Like