# cargo

**URL:** https://internals.rust-lang.org/c/tools-and-infrastructure/cargo/15.md?page=2

[Latest](https://internals.rust-lang.org/latest.md) · [Categories](https://internals.rust-lang.org/categories.md)

**Page:** 3

---

## [Would lazy initialization of OpenSSL in cargo be worth it?](https://internals.rust-lang.org/t/would-lazy-initialization-of-openssl-in-cargo-be-worth-it/22682)

<div class="topic-metadata">

**Author:** [@binarycat](https://internals.rust-lang.org/u/binarycat)\
**Replies:** 7\
**Last updated:** [April 4, 2025, 8:40am UTC](https://internals.rust-lang.org/t/would-lazy-initialization-of-openssl-in-cargo-be-worth-it/22682 "2025-04-04T08:40:01Z")

</div>

I ran perf record -F 99 --call-graph=dwarf cargo tree --offline in a moderately sized project, and the report had this line in it: + 15.09% 0.00% cargo cargo \[.\] openssl\_init it seems to me li…

---

## [A more stable alternatve to default-features=false](https://internals.rust-lang.org/t/a-more-stable-alternatve-to-default-features-false/21625)

<div class="topic-metadata">

**Author:** [@binarycat](https://internals.rust-lang.org/u/binarycat)\
**Replies:** 18\
**Last updated:** [April 3, 2025, 5:29am UTC](https://internals.rust-lang.org/t/a-more-stable-alternatve-to-default-features-false/21625 "2025-04-03T05:29:00Z")

</div>

currently, if you wish to disable a crate's default features, you must disable all its default features. i propose adding a way to list a number of default features that should be disabled, along with the existing list …

---

## [Serde+derive no longer compiles with glibc 3.38](https://internals.rust-lang.org/t/serde-derive-no-longer-compiles-with-glibc-3-38/22627)

<div class="topic-metadata">

**Author:** [@binarycat](https://internals.rust-lang.org/u/binarycat)\
**Replies:** 4\
**Last updated:** [March 22, 2025, 8:30pm UTC](https://internals.rust-lang.org/t/serde-derive-no-longer-compiles-with-glibc-3-38/22627 "2025-03-22T20:30:38Z")

</div>

Trying to compile serde with the derive feature enabled results in the following error: Compiling proc-macro2 v1.0.94 Compiling unicode-ident v1.0.0 Compiling ryu v1.0.0 Compiling serde v1.0.199 Compiling…

---

## [I Found That Cargo Workspace Is Not Very Friendly for Multi-Target Crates](https://internals.rust-lang.org/t/i-found-that-cargo-workspace-is-not-very-friendly-for-multi-target-crates/22595)

<div class="topic-metadata">

**Author:** [@jmjoy](https://internals.rust-lang.org/u/jmjoy)\
**Replies:** 3\
**Last updated:** [March 19, 2025, 1:32pm UTC](https://internals.rust-lang.org/t/i-found-that-cargo-workspace-is-not-very-friendly-for-multi-target-crates/22595 "2025-03-19T13:32:54Z")

</div>

Multi-target crates refer to projects where different parts are compiled for different targets, rather than all being built for a single target. Examples include embedded libraries (like Embassy) and web projects with a …

---

## [Can I open a Cargo pull request implementing a feature to suppress "Blocking"/"Finished"/"Running" from \`cargo run\` when they're the only output?](https://internals.rust-lang.org/t/can-i-open-a-cargo-pull-request-implementing-a-feature-to-suppress-blocking-finished-running-from-cargo-run-when-theyre-the-only-output/22513)

<div class="topic-metadata">

**Author:** [@samestep](https://internals.rust-lang.org/u/samestep)\
**Replies:** 8\
**Last updated:** [March 15, 2025, 5:46am UTC](https://internals.rust-lang.org/t/can-i-open-a-cargo-pull-request-implementing-a-feature-to-suppress-blocking-finished-running-from-cargo-run-when-theyre-the-only-output/22513 "2025-03-15T05:46:06Z")

</div>

Apologies if this is the wrong place to ask this; I haven't contributed much to Rust yet so I'm not entirely sure how the process works. I would like to have the Cargo feature described in rust-lang/cargo#8743. I'm happ…

---

## [Properly formatted \`cargo fix\` code](https://internals.rust-lang.org/t/properly-formatted-cargo-fix-code/22539)

<div class="topic-metadata">

**Author:** [@epage](https://internals.rust-lang.org/u/epage)\
**Replies:** 8\
**Last updated:** [March 12, 2025, 12:48pm UTC](https://internals.rust-lang.org/t/properly-formatted-cargo-fix-code/22539 "2025-03-12T12:48:17Z")

</div>

Being spoiled by my editor running rustfmt, I frequently find that when I run cargo fix or cargo clippy --fix, I forget that I need to manually run cargo fmt afterwards. Sometimes I don't notice until CI complains. @kp…

---

## [Use petnames for crates](https://internals.rust-lang.org/t/use-petnames-for-crates/22497)

<div class="topic-metadata">

**Author:** [@thk](https://internals.rust-lang.org/u/thk)\
**Replies:** 13\
**Last updated:** [March 7, 2025, 2:20am UTC](https://internals.rust-lang.org/t/use-petnames-for-crates/22497 "2025-03-07T02:20:32Z")

</div>

This proposal should solve the problem that names on crates.io could not be reclaimed if they are blocked by an abandoned package. See also Reclaim Inactive Package Names through Community Voting - #18 by 2e71828 - commu…

---

## [Anonymous utilities crates](https://internals.rust-lang.org/t/anonymous-utilities-crates/22504)

<div class="topic-metadata">

**Author:** [@ratmice](https://internals.rust-lang.org/u/ratmice)\
**Replies:** 14\
**Last updated:** [March 7, 2025, 1:43am UTC](https://internals.rust-lang.org/t/anonymous-utilities-crates/22504 "2025-03-07T01:43:55Z")

</div>

It seems like often when I have crates in a workspace, I run into situations where I want to use some utility code private to multiple crates, in which case I have two non-ideal options: Duplicate the code in question …

---

## [Dependency ranges, workspaces, and breaking changes](https://internals.rust-lang.org/t/dependency-ranges-workspaces-and-breaking-changes/22394)

<div class="topic-metadata">

**Author:** [@tmccombs](https://internals.rust-lang.org/u/tmccombs)\
**Replies:** 6\
**Last updated:** [February 17, 2025, 3:22pm UTC](https://internals.rust-lang.org/t/dependency-ranges-workspaces-and-breaking-changes/22394 "2025-02-17T15:22:09Z")

</div>

I maintain the tls-listener crate. When tokio-rustls 0.26 was released, I wanted to add support for it to my library, but my library only uses a small part of the API surface, and the breaking changes in that release do…

---

## [Publish a Workspace as a Super-crate ?!](https://internals.rust-lang.org/t/publish-a-workspace-as-a-super-crate/22397)

<div class="topic-metadata">

**Author:** [@rxdiscovery](https://internals.rust-lang.org/u/rxdiscovery)\
**Replies:** 2\
**Last updated:** [February 17, 2025, 12:51am UTC](https://internals.rust-lang.org/t/publish-a-workspace-as-a-super-crate/22397 "2025-02-17T00:51:00Z")

</div>

Hello, I often ask myself this question: wouldn’t it be more ergonomic to publish a Workspace as a whole, like, for example, a super-crate? Often, Rust libraries contain several internal sub-crates, but when we publish …

---

## [Ability to change a crate in the whole dependency graph?](https://internals.rust-lang.org/t/ability-to-change-a-crate-in-the-whole-dependency-graph/22389)

<div class="topic-metadata">

**Author:** [@Evian-Zhang](https://internals.rust-lang.org/u/Evian-Zhang)\
**Replies:** 5\
**Last updated:** [February 16, 2025, 3:01am UTC](https://internals.rust-lang.org/t/ability-to-change-a-crate-in-the-whole-dependency-graph/22389 "2025-02-16T03:01:44Z")

</div>

In some situations, there is a basic crate which provides fundamental functionalities, and several downstream crates depending on this basic crate. For example, log is the basic crate, and env\_logger or some other logger…

---

## [Thoughts on Allowing Crates with the Same Name](https://internals.rust-lang.org/t/thoughts-on-allowing-crates-with-the-same-name/22347)

<div class="topic-metadata">

**Author:** [@jmjoy](https://internals.rust-lang.org/u/jmjoy)\
**Replies:** 4\
**Last updated:** [February 5, 2025, 2:44pm UTC](https://internals.rust-lang.org/t/thoughts-on-allowing-crates-with-the-same-name/22347 "2025-02-05T14:44:15Z")

</div>

Current Issues The lack of namespaces for crates currently leads to several problems: Crate names being "squatted" or reserved unnecessarily. Popular crates being maintained by non-official parties, causing potential c…

---

## [Target directory stability](https://internals.rust-lang.org/t/target-directory-stability/22334)

<div class="topic-metadata">

**Author:** [@blonk](https://internals.rust-lang.org/u/blonk)\
**Replies:** 2\
**Last updated:** [February 3, 2025, 3:48pm UTC](https://internals.rust-lang.org/t/target-directory-stability/22334 "2025-02-03T15:48:55Z")

</div>

Is the layout of the target directory "stable"? We delivered a project to a client and as they were integrating it into their CI they wondered whether there's any risk that the location of the application binary in targ…

---

## [Help Implementing Custom Registry](https://internals.rust-lang.org/t/help-implementing-custom-registry/22202)

<div class="topic-metadata">

**Author:** [@kiran-4444](https://internals.rust-lang.org/u/kiran-4444)\
**Replies:** 4\
**Last updated:** [January 23, 2025, 4:12am UTC](https://internals.rust-lang.org/t/help-implementing-custom-registry/22202 "2025-01-23T04:12:59Z")

</div>

I'm currently working on implementing a custom cargo registry for GitLab. I've read about how git and sparse index work and thinking of implementing sparse index. Currently, I built a FastAPI-based web server with basic …

---

## [Default Compilation Mode in Cargo](https://internals.rust-lang.org/t/default-compilation-mode-in-cargo/22044)

<div class="topic-metadata">

**Author:** [@rxdiscovery](https://internals.rust-lang.org/u/rxdiscovery)\
**Replies:** 22\
**Last updated:** [January 20, 2025, 3:07am UTC](https://internals.rust-lang.org/t/default-compilation-mode-in-cargo/22044 "2025-01-20T03:07:54Z")

</div>

Hello, I have a small suggestion regarding the default behavior of "Cargo" during the compilation process. Normally, the standard behavior of a compiler is to compile code into a target output without adding any extra …

---

## [Pre-RFC: Allow packages to specify a set of supported targets](https://internals.rust-lang.org/t/pre-rfc-allow-packages-to-specify-a-set-of-supported-targets/21979)

<div class="topic-metadata">

**Author:** [@carloskiki](https://internals.rust-lang.org/u/carloskiki)\
**Replies:** 38\
**Last updated:** [January 10, 2025, 10:55am UTC](https://internals.rust-lang.org/t/pre-rfc-allow-packages-to-specify-a-set-of-supported-targets/21979 "2025-01-10T10:55:33Z")

</div>

Feature Name: (fill me in with a unique ident, my\_awesome\_feature) Start Date: (fill me in with today's date, YYYY-MM-DD) RFC PR: rust-lang/rfcs#0000 Rust Issue: rust-lang/rust#0000 The word target is extensively used …

---

## [Performance of \`cargo package\` / \`cargo publish\` and the purpose of the verify step](https://internals.rust-lang.org/t/performance-of-cargo-package-cargo-publish-and-the-purpose-of-the-verify-step/22135)

<div class="topic-metadata">

**Author:** [@epage](https://internals.rust-lang.org/u/epage)\
**Replies:** 7\
**Last updated:** [January 9, 2025, 5:24pm UTC](https://internals.rust-lang.org/t/performance-of-cargo-package-cargo-publish-and-the-purpose-of-the-verify-step/22135 "2025-01-09T17:24:35Z")

</div>

In short, I'm looking to feedback on the following questions: What packages or workflows are sensitive to cargo package or cargo publish times? Should cargo publish's verify step focus on smoke testing the packaging pr…

---

## [Cargo test should fail if the specified test to run isn't found](https://internals.rust-lang.org/t/cargo-test-should-fail-if-the-specified-test-to-run-isnt-found/22002)

<div class="topic-metadata">

**Author:** [@jvcmarcenes](https://internals.rust-lang.org/u/jvcmarcenes)\
**Replies:** 2\
**Last updated:** [December 10, 2024, 6:38pm UTC](https://internals.rust-lang.org/t/cargo-test-should-fail-if-the-specified-test-to-run-isnt-found/22002 "2024-12-10T18:38:21Z")

</div>

Currently, if the test passed to cargo test (as: cargo test my\_module::tests::my\_test) does not exist, the command raises no warning about not finding the test, and it writes test result: ok.. This has led me to think t…

---

## [How to assist with bug #5478](https://internals.rust-lang.org/t/how-to-assist-with-bug-5478/21819)

<div class="topic-metadata">

**Author:** [@metasim](https://internals.rust-lang.org/u/metasim)\
**Replies:** 7\
**Last updated:** [November 4, 2024, 11:25pm UTC](https://internals.rust-lang.org/t/how-to-assist-with-bug-5478/21819 "2024-11-04T23:25:51Z")

</div>

I've been regularly hitting up against Bug #5478, (Patching dependencies does not work if it's for the same location but a different branch) since I started writing Rust 4 years ago. Instead of continue to cursing it and…

---

## [\`cargo search\` returns prerelease versions](https://internals.rust-lang.org/t/cargo-search-returns-prerelease-versions/21649)

<div class="topic-metadata">

**Author:** [@Trem](https://internals.rust-lang.org/u/Trem)\
**Replies:** 2\
**Last updated:** [October 5, 2024, 3:57pm UTC](https://internals.rust-lang.org/t/cargo-search-returns-prerelease-versions/21649 "2024-10-05T15:57:07Z")

</div>

The output of cargo search currently returns prerelease versions, for example: $ cargo search rand rand = "0.9.0-alpha.2" # Random number generators and other randomness functionality. ... On the other hand, crat…

---

## [\`-Zminimal-versions\`, \`cargo update\`, and \`cargo upgrade\`](https://internals.rust-lang.org/t/zminimal-versions-cargo-update-and-cargo-upgrade/21335)

<div class="topic-metadata">

**Author:** [@epage](https://internals.rust-lang.org/u/epage)\
**Replies:** 19\
**Last updated:** [September 26, 2024, 5:53pm UTC](https://internals.rust-lang.org/t/zminimal-versions-cargo-update-and-cargo-upgrade/21335 "2024-09-26T17:53:44Z")

</div>

The Cargo team recently discussed how to stabilize -Zminimal-versions and how to get version-req updating into cargo update. I'm looking for wider input on the ideas we had. Use cases for minimal-version resolution ar…

---

## [Scoped packages to triage package squatting](https://internals.rust-lang.org/t/scoped-packages-to-triage-package-squatting/21597)

<div class="topic-metadata">

**Author:** [@mcandre](https://internals.rust-lang.org/u/mcandre)\
**Replies:** 1\
**Last updated:** [September 26, 2024, 3:49am UTC](https://internals.rust-lang.org/t/scoped-packages-to-triage-package-squatting/21597 "2024-09-26T03:49:04Z")

</div>

Last I checked, crates.io was littered with hundreds of useless parking packages, similar to how domain names encourage squatters. As a developer, it's often difficult to come up with a meaningful, unique name, which ha…

---

## [Make \`cargo install\` a \`sudo\` operation](https://internals.rust-lang.org/t/make-cargo-install-a-sudo-operation/21532)

<div class="topic-metadata">

**Author:** [@amab8901](https://internals.rust-lang.org/u/amab8901)\
**Replies:** 7\
**Last updated:** [September 21, 2024, 6:33am UTC](https://internals.rust-lang.org/t/make-cargo-install-a-sudo-operation/21532 "2024-09-21T06:33:52Z")

</div>

When we install something via apt or pacman, etc, we have to use sudo for security reasons, because otherwise a hacker might be free to install malware. But this is not a problem for the hacker, because they can just run…

---

## [Can we do something about RUSTFLAGS != RUSTDOCFLAGS?](https://internals.rust-lang.org/t/can-we-do-something-about-rustflags-rustdocflags/21513)

<div class="topic-metadata">

**Author:** [@Kixunil](https://internals.rust-lang.org/u/Kixunil)\
**Replies:** 3\
**Last updated:** [September 13, 2024, 4:05pm UTC](https://internals.rust-lang.org/t/can-we-do-something-about-rustflags-rustdocflags/21513 "2024-09-13T16:05:53Z")

</div>

Numerous times I forgot that RUSTFLAGS != RUSTDOCFLAGS and got bit by it. I've also seen other people with the same problem. Annoyingly, in addition to wasting my time, today I've also wasted some of Ralf's time reportin…

---

## [What dependencies go into a \`\[c\]dylib\`?](https://internals.rust-lang.org/t/what-dependencies-go-into-a-c-dylib/21489)

<div class="topic-metadata">

**Author:** [@fosterbrereton](https://internals.rust-lang.org/u/fosterbrereton)\
**Replies:** 2\
**Last updated:** [September 6, 2024, 3:05pm UTC](https://internals.rust-lang.org/t/what-dependencies-go-into-a-c-dylib/21489 "2024-09-06T15:05:14Z")

</div>

I am reading through the linkage documentation (which is very helpful), and I see this line in the staticlib section: The purpose of this output type is to create a static library containing all of the local crate's co…

---

## [Introduce env var CARGO\_RUN\_ID for identifying related processes/threads](https://internals.rust-lang.org/t/introduce-env-var-cargo-run-id-for-identifying-related-processes-threads/21134)

<div class="topic-metadata">

**Author:** [@bonega](https://internals.rust-lang.org/u/bonega)\
**Replies:** 15\
**Last updated:** [September 5, 2024, 9:16pm UTC](https://internals.rust-lang.org/t/introduce-env-var-cargo-run-id-for-identifying-related-processes-threads/21134 "2024-09-05T21:16:33Z")

</div>

Hello Cargo team, I'd like to propose a new feature for Cargo: the introduction of a CARGO\_RUN\_ID environment variable. This would solve an issue in identifying which processes or threads are spawned from the same Cargo…

---

## [Cargo features - spooky action at a distance?](https://internals.rust-lang.org/t/cargo-features-spooky-action-at-a-distance/21426)

<div class="topic-metadata">

**Author:** [@HjVT](https://internals.rust-lang.org/u/HjVT)\
**Replies:** 9\
**Last updated:** [August 24, 2024, 5:10pm UTC](https://internals.rust-lang.org/t/cargo-features-spooky-action-at-a-distance/21426 "2024-08-24T17:10:40Z")

</div>

The situation is as following: crate A depends on L, using feature F, but not enabling the feature in Cargo.toml crate B depends on A and L, enabling feature F in it's Cargo.toml crate A on itself does not build succesf…

---

## [Using credential providers](https://internals.rust-lang.org/t/using-credential-providers/21331)

<div class="topic-metadata">

**Author:** [@blonk](https://internals.rust-lang.org/u/blonk)\
**Replies:** 0\
**Last updated:** [August 8, 2024, 3:01pm UTC](https://internals.rust-lang.org/t/using-credential-providers/21331 "2024-08-08T15:01:31Z")

</div>

I posted a question on URLO, but then realized that the people who actually did the work are probably more likely to hang out here, on internals. I'm trying to use the cargo:macos-keychain credential provider, but am un…

---

## [Pre-RFC: cargo doc --no-indirect-deps](https://internals.rust-lang.org/t/pre-rfc-cargo-doc-no-indirect-deps/21316)

<div class="topic-metadata">

**Author:** [@binarycat](https://internals.rust-lang.org/u/binarycat)\
**Replies:** 7\
**Last updated:** [August 7, 2024, 4:02pm UTC](https://internals.rust-lang.org/t/pre-rfc-cargo-doc-no-indirect-deps/21316 "2024-08-07T16:02:51Z")

</div>

this would only document direct dependancies found in Cargo.toml, as well as the crate itself Alternatives add an optional argument to --no-deps, eg. --no-deps=indirect. add a different option like --document-deps that…

---

## [Crate equivalent of Edition](https://internals.rust-lang.org/t/crate-equivalent-of-edition/21173)

<div class="topic-metadata">

**Author:** [@cornmonger](https://internals.rust-lang.org/u/cornmonger)\
**Replies:** 9\
**Last updated:** [July 15, 2024, 2:32pm UTC](https://internals.rust-lang.org/t/crate-equivalent-of-edition/21173 "2024-07-15T14:32:02Z")

</div>

A discussion concerning SemVer popped up on Reddit last week over a blog article. It had the usual suspects as far as complaints are concerned. I keep coming back to the idea that maybe crates need their own "edition" i…

[Previous page](https://internals.rust-lang.org/c/tools-and-infrastructure/cargo/15.md?page=1)

[Next page](https://internals.rust-lang.org/c/tools-and-infrastructure/cargo/15.md?page=3)
