Skip to content

Commit

Permalink
fix(script): Don't override the release profile (#14925)
Browse files Browse the repository at this point in the history
This has been around since #12224 and isn't in the RFC, so its being
removed.

This is part of #12207.

<!--
Thanks for submitting a pull request 🎉! Here are some tips for you:

* If this is your first contribution, read "Cargo Contribution Guide"
first:
  https://doc.crates.io/contrib/
* Run `cargo fmt --all` to format your code changes.
* Small commits and pull requests are always preferable and easy to
review.
* If your idea is large and needs feedback from the community, read how:
  https://doc.crates.io/contrib/process/#working-on-large-features
* Cargo takes care of compatibility. Read our design principles:
  https://doc.crates.io/contrib/design.html
* When changing help text of cargo commands, follow the steps to
generate docs:

https://github.com/rust-lang/cargo/tree/master/src/doc#building-the-man-pages
* If your PR is not finished, set it as "draft" PR or add "WIP" in its
title.
* It's ok to use the CI resources to test your PR, but please don't
abuse them.

### What does this PR try to resolve?

Explain the motivation behind this change.
A clear overview along with an in-depth explanation are helpful.

You can use `Fixes #<issue number>` to associate this PR to an existing
issue.

### How should we test and review this PR?

Demonstrate how you test this change and guide reviewers through your
PR.
With a smooth review process, a pull request usually gets reviewed
quicker.

If you don't know how to write and run your tests, please read the
guide:
https://doc.crates.io/contrib/tests

### Additional information

Other information you want to mention in this PR, such as prior arts,
future extensions, an unresolved problem, or a TODO list.
-->
  • Loading branch information
weihanglo authored Dec 12, 2024
2 parents 94d274d + ab7469e commit 3cd245c
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions src/cargo/util/toml/embedded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,19 +141,6 @@ fn expand_manifest_(
toml::Value::Array(vec![toml::Value::Table(bin)]),
);

let release = manifest
.entry("profile".to_owned())
.or_insert_with(|| toml::Value::Table(Default::default()))
.as_table_mut()
.ok_or_else(|| anyhow::format_err!("`profile` must be a table"))?
.entry("release".to_owned())
.or_insert_with(|| toml::Value::Table(Default::default()))
.as_table_mut()
.ok_or_else(|| anyhow::format_err!("`profile.release` must be a table"))?;
release
.entry("strip".to_owned())
.or_insert_with(|| toml::Value::Boolean(true));

Ok(manifest)
}

Expand Down Expand Up @@ -588,9 +575,6 @@ build = false
edition = "2024"
name = "test-"
[profile.release]
strip = true
[workspace]
"#]]
Expand Down Expand Up @@ -626,9 +610,6 @@ build = false
edition = "2024"
name = "test-"
[profile.release]
strip = true
[workspace]
"#]]
Expand Down

0 comments on commit 3cd245c

Please sign in to comment.