rust-lang / rust-lang/cargo

Change the build profile for bin-deps

Open
#11,680 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-feature-request S-needs-info Z-bindeps
Dominant language
Rust
Stars
15.5k
Forks
3k
Avg merge
23h 30m
Merged PRs (30d)
51

Description

Problem

I am writing my own kernel. Now, I am trying to add support for test, for that I am getting inspiration on Phil's Blog. I added it, but when I tried to build it with cargo test, my kernel crate is built as normal.

Proposed Solution

The solution that I propose is to add support for changing profiles on binary dependencies, it will look like:
kernel = { path = "kernel", artifact = "bin", target = "x86_64-unknown-none", profile = "test" }

Notes

I think that this is the simplest solution, but if you know something better or more elegant for fixing this, let me know.

Thanks!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with cargo test and the binary dependency manifest syntax shown in the proposal. Read how Cargo currently handles profiles and binary dependencies, then determine the expected behavior for profile = "test" and verify it with a focused build or test case. Done means the binary dependency is built with the requested profile without changing unrelated dependencies.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.