Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.
If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!
ProGet 2025.17: Errors building downloaded Cargo packages
-
Hi! I'm using ProGet 2025.17 (Build 7) and am trying to set up ProGet as a proxy for https://crates.io. I've set up a Cargo feed and added a connector to https://crates.io.
However, when I try to build Rust code using ProGet as the registry, I get compilation errors that I don't get when using another registry, for example:
error[E0432]: unresolved import `once_cell::sync` --> /mypath/.cargo/registry/src/mydomain-f880e82129ec5ba0/tracing-core-0.1.34/src/lazy.rs:2:27 | 2 | pub(crate) use once_cell::sync::Lazy; | ^^^^ could not find `sync` in `once_cell` | note: found an item that was configured out --> /mypath/.cargo/registry/src/mydomain-f880e82129ec5ba0/once_cell-1.21.3/src/lib.rs:863:9 | 862 | #[cfg(any(feature = "std", feature = "critical-section"))] | ----------------------------------------------- the item is gated here 863 | pub mod sync { | ^^^^I've done some debugging, and think I found the reason: ProGet seems to sometimes change the "default_features" flag of indirect dependencies, which causes Cargo to try to build the code with the incorrect features enabled.
As an example, this is (part of) what ProGet returns for http://mydomain/cargo/public-cargo/tr/ac/tracing-core (where public-cargo is my feed name):
... other versions { "name": "tracing-core", "vers": "0.1.34", "deps": [ { "name": "once_cell", "req": "1.13.0", "optional": true, "kind": "normal", "default_features": false, "features": [], "registry": null, "target": null }, { "name": "valuable", "req": "0.1.0", "optional": true, "kind": "normal", "default_features": false, "features": [], "registry": null, "target": "cfg(tracing_unstable)" } ], "cksum": "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678", "features": { "default": [ "std", "valuable?/std" ], "std": [ "once_cell" ] }, "v": 2, "rust_version": "1.65.0", "yanked": false } ... other versionsNote that for the "once_cell" dependency, "default_features" is false. However, getting the same package from crates.io (https://index.crates.io/tr/ac/tracing-core) returns:
... other versions { "name": "tracing-core", "vers": "0.1.34", "deps": [ { "name": "once_cell", "req": "^1.13.0", "features": [], "optional": true, "default_features": true, "target": null, "kind": "normal" }, { "name": "valuable", "req": "^0.1.0", "features": [], "optional": true, "default_features": false, "target": "cfg(tracing_unstable)", "kind": "normal" } ], "cksum": "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678", "features": { "std": [ "once_cell" ] }, "features2": { "default": [ "std", "valuable?/std" ] }, "yanked": false, "rust_version": "1.65.0", "v": 2 } ... other versionsHere, "once_cell"'s "default_features" is true. This doesn't seem to happen for all versions (only version 0.1.34 for the tracing-core crate).
I've found the same error for some other crates and versions:
- regex-automata (http://mydomain/cargo/public-cargo/re/ge/regex-automata) version 0.2: default_features is incorrectly set to false for dependencies fst, lazy_static, regex, regex-syntax, serde, serde_bytes, serde_derive and toml
- regex-automata (http://mydomain/cargo/public-cargo/re/ge/regex-automata) version 0.4.9: default_features is incorrectly set to false for dependencies anyhow, doc-comment, log and regex-test
- anyhow (http://mydomain/cargo/public-cargo/an/yh/anyhow) version 1.0.86: default_features is incorrectly set to false for dependencies backtrace, rustversion, syn, thiserror and trybuild
-
Hi @coboj59760_1341,
Thank you very much for all the information on how to recreate the error. In Cargo 1.84.0 (released in January 2025), they changed the default value for
default_featuresfrom false to true. In the case of the examples you provided, these cargo manifests did specify a value fordefault_featurescausing it to change to false once the package is cached in ProGet.I have created a ticket, PG-3182, to track the fix. This will be released in next weeks release of ProGet. I can also provide a pre-release version of ProGet if you would like. Just let me know!
Thanks,
Rich
-
Hi @rhessinger,
Thanks for the quick reply. I'd love to try out a pre-release version when it's available.
-
Hi @coboj59760_1341,
I just pushed a pre-release that includes the fix. Please install ProGet 25.0.17-ci.12 and that should resolve this issue. Please let us know if that resolves your issue.
Thanks,
Rich
-
Hi @rhessinger,
I just tested the pre-release and the build now works as expected. Thanks again for the quick fix!