cargo-workspaces icon indicating copy to clipboard operation
cargo-workspaces copied to clipboard

cannot publish workspace to custom registry sometimes

Open maaft opened this issue 1 year ago • 7 comments

First I did cargo workspace version to bump the version of all packages.

then cargo workspace publish fails with:

Current HEAD is already released, skipping versioning
error: config value `http.cainfo` is not set
info success ok

Also tried with --publish-as-is but that does not work with private registries:

cargo workspaces publish --registry private-registry --publish-as-is
error: config value `http.cainfo` is not set
error: crates index error: status code '401 Unauthorized': the request was not authorized

regular cargo publish works with tat registry. I'm authenticated and should be good to go.

maaft avatar Oct 24 '24 15:10 maaft

Using --publish-as-is is correct. It looks like your registry configuration is not set correctly. Were you able to fix this?

pksunkara avatar Mar 10 '25 08:03 pksunkara

no, i was not able to fix it yet.

I just use regular cargo publish.

That being said, I'd rather use cargo workspace.

Iis the registry configuration used by cargo workspace different then the one used by cargo publish? If so, how? Because cargo publish works on the same machine.

maaft avatar Mar 10 '25 09:03 maaft

Hmm.. it should not be any different. Can you provide me some logs please? Use the -v option.

pksunkara avatar Mar 16 '25 13:03 pksunkara

Hello @pksunkara I just encountered this as well. Had to debug for a few hours. I had to just do manual separate publish and they did work i.e. cargo publish -p <member1>; cargo publish -p <member2>;...

maulberto3 avatar May 07 '25 04:05 maulberto3

@maulberto3 Would appreciate any links to code (if public) or logs or even error messages.

pksunkara avatar May 08 '25 10:05 pksunkara

@maulberto3 Do you also use a custom registry?

pksunkara avatar May 10 '25 12:05 pksunkara

Hi,

I can confirm that publishing to a custom registry doesn't work. Here you have an example output in a very simple workspace with a single package.

My custom registry is from https://shipyard.rs/. I'm pretty sure cargo is correctly configured to use it, since I can publish crates without a problem (even multiple ones at once with cargo +nightly -p ... -p ...).

Please let me know what kind of info I can give you to help diagnose the issue. I cannot share this codebase since it's from work, but I assume that any crate would work. In Shipyard, you can create a free account with space for 5 crates, or I guess I can give you publish access to a test crate in our account.

Image

glueball avatar Sep 13 '25 16:09 glueball