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

fix(install): Keep v1 file formatting the same #10349

Merged
merged 1 commit into from
Feb 1, 2022
Merged

Conversation

epage
Copy link
Contributor

@epage epage commented Jan 31, 2022

Inspired by #10345, I looked for other cases where
toml_edit::easy::to_string is used (which outputs inline tables) to
see if we should switch to to_string_pretty. The crates v1 file was
the only case I found.

As a side effect, we can no longer elide the empty dev-dependencies
table in published manifests. This was the behavior before toml_edit,
so not much of a loss.

@rust-highfive
Copy link

r? @ehuss

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 31, 2022
@epage
Copy link
Contributor Author

epage commented Jan 31, 2022

The remaining test failure highlights a bug in the current toml_edit::easy::to_string_pretty. We conditionally mark tables as "implicit". This is intended to hide empty intermediate tables but we shouldn't be hiding any terminal tables. We seemed to forget to force showing empty ones.

epage added a commit to epage/toml_edit that referenced this pull request Jan 31, 2022
I considered making it so we always showed empty implicit tables but I
figured that in the editing case, we could show tables that were
originally hidden just by deleting entries.  This seems surprising for a
user and they shouldn't have to account for it.

So I limited the fix to `to_string_pretty`.

This was found by rust-lang/cargo#10349.
epage added a commit to toml-rs/toml that referenced this pull request Jan 31, 2022
I considered making it so we always showed empty implicit tables but I
figured that in the editing case, we could show tables that were
originally hidden just by deleting entries.  This seems surprising for a
user and they shouldn't have to account for it.

So I limited the fix to `to_string_pretty`.

This was found by rust-lang/cargo#10349.
Inspired by rust-lang#10345, I looked for other cases where
`toml_edit::easy::to_string` is used (which outputs inline tables) to
see if we should switch to `to_string_pretty`.  The crates v1 file was
the only case I found.

As a side effect, we can no longer elide the empty `dev-dependencies`
table in published manifests.  This was the behavior before `toml_edit`,
so not much of a loss.
epage added a commit to epage/cargo that referenced this pull request Jan 31, 2022
`toml_edit` fixed a bug in 0.13.4 that this test was relying on that is
meant to help with rust-lang#10349.  This basically restores us
back to the pre-toml_edit behavior for published manifests.
bors added a commit that referenced this pull request Jan 31, 2022
test: Fix compatibilty with new toml_edit

`toml_edit` fixed a bug in 0.13.4 that this test was relying on that is
meant to help with #10349.  This basically restores us
back to the pre-toml_edit behavior for published manifests.

I included the `Cargo.toml` change to ensure any existing lock files on people's machines get updated so the test won't mysteriously start failing for them when doing a `pull`.
@ehuss
Copy link
Contributor

ehuss commented Feb 1, 2022

Thanks!

@bors r+

@bors
Copy link
Contributor

bors commented Feb 1, 2022

📌 Commit 24defcb has been approved by ehuss

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 1, 2022
@bors
Copy link
Contributor

bors commented Feb 1, 2022

⌛ Testing commit 24defcb with merge 25fcb13...

@bors
Copy link
Contributor

bors commented Feb 1, 2022

☀️ Test successful - checks-actions
Approved by: ehuss
Pushing 25fcb13 to master...

@bors bors merged commit 25fcb13 into rust-lang:master Feb 1, 2022
ehuss added a commit to ehuss/rust that referenced this pull request Feb 1, 2022
Update cargo

10 commits in 1c034752de0df744fcd7788fcbca158830b8bf85..25fcb135d02ea897ce894b67ae021f48107d522b
2022-01-25 22:36:53 +0000 to 2022-02-01 01:32:48 +0000
- fix(install): Keep v1 file formatting the same (rust-lang/cargo#10349)
- fix(vendor): Use tables for sample config (rust-lang/cargo#10348)
- Add bash completion for `cargo clippy` (rust-lang/cargo#10347)
- Do not ignore `--features` when `--all-features` is present (rust-lang/cargo#10337)
- test: Fix compatibilty with new toml_edit (rust-lang/cargo#10350)
- extra-link-arg-etc: support all link types (credit `@davidhewitt)` (rust-lang/cargo#10274)
- Make clippy happy (rust-lang/cargo#10340)
- Update publishing link for semver rules. (rust-lang/cargo#10338)
- Normalize --path when install bin outside current workspace (rust-lang/cargo#10335)
- Bump clap to v3.0.13 (rust-lang/cargo#10336)
@epage epage deleted the install branch February 1, 2022 14:03
@ehuss ehuss added this to the 1.60.0 milestone Feb 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants