Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to publish to crates.io with source replacement #10640

Closed
Jzow opened this issue May 8, 2022 · 6 comments
Closed

Unable to publish to crates.io with source replacement #10640

Jzow opened this issue May 8, 2022 · 6 comments
Labels
A-source-replacement Area: [source] replacement Command-publish

Comments

@Jzow
Copy link

Jzow commented May 8, 2022

[package]
name = "macros"
version = "1.0.0"
description = "mybatis macro driver 高性能Rust orM框架 宏系统支持"
readme = "Readme.md"
authors = ["James Zow <[email protected]>"]
edition = "2021"
license = "Apache"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[features]
default = []
debug_mode = []
[lib]
proc-macro = true

[dependencies]
proc-macro2 = "1.0"
quote = "1.0"
syn = { version = "1.0", features = ["full"] }
html_parser = "0.6.2"
base64 = "0.13"
url = "2.2.2"

error::

macros git:(v-1.0.1) ✗ cargo publish --allow-dirty
warning: profiles for the non root package will be ignored, specify profiles at the workspace root:
package:   /Users/jameszow/Documents/RustWorkSpace/summer-mybatis/mybatis-plus/Cargo.toml
workspace: /Users/jameszow/Documents/RustWorkSpace/summer-mybatis/Cargo.toml
    Updating `ustc` index
error: crates cannot be published to crates.io with dependencies sourced from other
registries. `base64` needs to be published to crates.io before publishing this crate.
(crate `base64` is pulled from registry `crates-io`)
@Jzow
Copy link
Author

Jzow commented May 8, 2022

I rely on base64, crates.io How should I publish the package

@Eh2406
Copy link
Contributor

Eh2406 commented May 8, 2022

Do you have config files set? If so what is in them?

@Jzow
Copy link
Author

Jzow commented May 8, 2022

@Eh2406

hi, this is my loacal .cargo config file:

[source.crates-io]
registry = "https://github.com/rust-lang/crates.io-index"
replace-with = 'ustc'
[source.ustc]
registry = "git://mirrors.ustc.edu.cn/crates.io-index"

@Jzow
Copy link
Author

Jzow commented May 8, 2022

this error report url: error

@ehuss
Copy link
Contributor

ehuss commented May 9, 2022

Cargo currently doesn't support publishing with source replacement. If possible, you'll need to temporarily disable the config.

Issue #6722 is open to track providing a better error message.

I'm not sure, but it may be possible to detect the source-replacement scenario and try to publish anyways. It could possibly cause issues if the replacement is out of sync, but crates.io will catch any missing dependencies. I'm not sure how hard that will be to implement, though.

@ehuss ehuss changed the title I encountered some problems when trying to publish Unable to publish to crates.io with source replacement May 9, 2022
@ehuss ehuss added Command-publish A-source-replacement Area: [source] replacement labels May 9, 2022
@ehuss
Copy link
Contributor

ehuss commented Dec 7, 2022

Closing since I believe this is now fixed via #10907. The new error message is:

error: crates-io is replaced with non-remote-registry source registry `mirror`;
include `--registry crates-io` to use crates.io

Using --registry crates-io can be used to explicitly set the registry.

@ehuss ehuss closed this as completed Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-source-replacement Area: [source] replacement Command-publish
Projects
None yet
Development

No branches or pull requests

3 participants