Skip to content

Conversation

ehuss
Copy link
Contributor

@ehuss ehuss commented Sep 18, 2023

This updates the documentation cautioning against removing optional dependencies with more up-to-date information about using the dep: syntax in the features table. This documentation was written before dep:, and I just forgot to update these docs when it was stabilized.

@rustbot
Copy link
Collaborator

rustbot commented Sep 18, 2023

r? @weihanglo

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added A-documenting-cargo-itself Area: Cargo's documentation S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 18, 2023
Comment on lines +2162 to +2173
```toml
# MINOR CHANGE
#
# This example shows how to avoid breaking changes with optional dependencies.

###########################################################
# Before
[dependencies]
curl = { version = "0.4.31", optional = true }

[features]
networking = ["dep:curl"]
Copy link
Contributor

@epage epage Sep 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think its fine for us to suggest this be treated as minor. The main risk is rust-lang/rust#109005 as people might be seeing the internal names and using them. I actually saw someone mislead by this when demoing the compiler error (the entire serde example was driven by what the compiler said) .

Copy link
Contributor

@epage epage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r= me when you can

@ehuss ehuss force-pushed the semver-remove-opt-dep branch from c9262bd to 8fe995f Compare September 18, 2023 19:01
@ehuss
Copy link
Contributor Author

ehuss commented Sep 18, 2023

@bors r=epage

@bors
Copy link
Contributor

bors commented Sep 18, 2023

📌 Commit 8fe995f has been approved by epage

It is now in the queue for this repository.

@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 Sep 18, 2023
@bors
Copy link
Contributor

bors commented Sep 18, 2023

⌛ Testing commit 8fe995f with merge 952bcab...

bors added a commit that referenced this pull request Sep 18, 2023
SemVer: Update documentation about removing optional dependencies

This updates the documentation cautioning against removing optional dependencies with more up-to-date information about using the `dep:` syntax in the features table. This documentation was written before `dep:`, and I just forgot to update these docs when it was stabilized.
@bors
Copy link
Contributor

bors commented Sep 18, 2023

💔 Test failed - checks-actions

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

ehuss commented Sep 18, 2023

@bors retry

0xc0000374 (STATUS_HEAP_CORRUPTION) when running rust-lld on x86_64-pc-windows-gnu. I have not seen that before, not sure what is up.

---- custom_target::custom_bin_target stdout ----
running `D:\a\cargo\cargo\target\debug\cargo.exe build --target custom-bin-target.json -v`
thread 'custom_target::custom_bin_target' panicked at tests\testsuite\custom_target.rs:132:57:

test failed running `D:\a\cargo\cargo\target\debug\cargo.exe build --target custom-bin-target.json -v`
error: process exited with code 101 (expected 0)
--- stdout

--- stderr
   Compiling foo v0.0.1 (D:\a\cargo\cargo\target\tmp\cit\t1096\foo)
     Running `rustc --crate-name foo src\main.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C metadata=f9e88282337cd66d -C extra-filename=-f9e88282337cd66d --out-dir D:\a\cargo\cargo\target\tmp\cit\t1096\foo\target\custom-bin-target\debug\deps --target \\?\D:\a\cargo\cargo\target\tmp\cit\t1096\foo\custom-bin-target.json -L dependency=D:\a\cargo\cargo\target\tmp\cit\t1096\foo\target\custom-bin-target\debug\deps -L dependency=D:\a\cargo\cargo\target\tmp\cit\t1096\foo\target\debug\deps`
error: linking with `rust-lld` failed: exit code: 0xc0000374
  |
  = note: "rust-lld" "-flavor" "gnu" "D:\\a\\cargo\\cargo\\target\\tmp\\cit\\t1096\\foo\\target\\custom-bin-target\\debug\\deps\\foo-f9e88282337cd66d.foo.9076a0c5959399b7-cgu.0.rcgu.o" "--as-needed" "-L" "D:\\a\\cargo\\cargo\\target\\tmp\\cit\\t1096\\foo\\target\\custom-bin-target\\debug\\deps" "-L" "D:\\a\\cargo\\cargo\\target\\tmp\\cit\\t1096\\foo\\target\\debug\\deps" "-L" "C:\\Users\\runneradmin\\.rustup\\toolchains\\nightly-x86_64-pc-windows-gnu\\lib\\rustlib\\custom-bin-target\\lib" "-Bdynamic" "--eh-frame-hdr" "-z" "noexecstack" "-L" "C:\\Users\\runneradmin\\.rustup\\toolchains\\nightly-x86_64-pc-windows-gnu\\lib\\rustlib\\custom-bin-target\\lib" "-o" "D:\\a\\cargo\\cargo\\target\\tmp\\cit\\t1096\\foo\\target\\custom-bin-target\\debug\\deps\\foo-f9e88282337cd66d" "--gc-sections"
  = note: rust-lld: warning: cannot find entry symbol _start; not setting start address
          

error: could not compile `foo` (bin "foo") due to previous error

Caused by:
  process didn't exit successfully: `rustc --crate-name foo src\main.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C metadata=f9e88282337cd66d -C extra-filename=-f9e88282337cd66d --out-dir D:\a\cargo\cargo\target\tmp\cit\t1096\foo\target\custom-bin-target\debug\deps --target \\?\D:\a\cargo\cargo\target\tmp\cit\t1096\foo\custom-bin-target.json -L dependency=D:\a\cargo\cargo\target\tmp\cit\t1096\foo\target\custom-bin-target\debug\deps -L dependency=D:\a\cargo\cargo\target\tmp\cit\t1096\foo\target\debug\deps` (exit code: 1)

note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    custom_target::custom_bin_target

@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 Sep 18, 2023
@bors
Copy link
Contributor

bors commented Sep 18, 2023

⌛ Testing commit 8fe995f with merge e4de526...

@bors
Copy link
Contributor

bors commented Sep 18, 2023

☀️ Test successful - checks-actions
Approved by: epage
Pushing e4de526 to master...

@bors bors merged commit e4de526 into rust-lang:master Sep 18, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 22, 2023
Update cargo

19 commits in b4ddf95ad9954118ac0dae835f2966394ad04c02..414d9e3a6d8096f3e276234ce220c868767a8792
2023-09-18 03:48:09 +0000 to 2023-09-22 07:03:57 +0000
- refactor(TomlManifest): fail when package_root is not a directory (rust-lang/cargo#12722)
- Better suggestion for unsupported mode in build command (rust-lang/cargo#12693)
- Update curl-sys to pull in curl 8.3.0 (rust-lang/cargo#12718)
- chore(ci): Ignore patch version in MSRV (rust-lang/cargo#12716)
- refactor: move cached crates.io SourceID to config module (rust-lang/cargo#12711)
- fix: typos in registry authentication documentation (rust-lang/cargo#12714)
- doc: mention unstable flag `-Z asymmetric-token` (rust-lang/cargo#12712)
- fix: copy PDBs for EFI targets (rust-lang/cargo#12688)
- infra: add auto-trigger rules for new labels (rust-lang/cargo#12713)
- fix: use channel-specific link for registry auth error (rust-lang/cargo#12709)
- Add some enhancements to `cargo clean` (rust-lang/cargo#12638)
- chore: Fix typos (rust-lang/cargo#12707)
- Shortest path (rust-lang/cargo#12678)
- doc/reference/manifest: Adjust `keywords` description (rust-lang/cargo#12705)
- Cargo add displays either feature list or summarized count (rust-lang/cargo#12702)
- SemVer: Update documentation about removing optional dependencies (rust-lang/cargo#12687)
- publish.py: Remove obsolete `sleep()` calls (rust-lang/cargo#12686)
- generalise suggestion on abiguous spec (rust-lang/cargo#12685)
- util/toml: Remove duplicate `serde(rename)` attributes (rust-lang/cargo#12682)

r? ghost
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 22, 2023
Update cargo

19 commits in b4ddf95ad9954118ac0dae835f2966394ad04c02..414d9e3a6d8096f3e276234ce220c868767a8792
2023-09-18 03:48:09 +0000 to 2023-09-22 07:03:57 +0000
- refactor(TomlManifest): fail when package_root is not a directory (rust-lang/cargo#12722)
- Better suggestion for unsupported mode in build command (rust-lang/cargo#12693)
- Update curl-sys to pull in curl 8.3.0 (rust-lang/cargo#12718)
- chore(ci): Ignore patch version in MSRV (rust-lang/cargo#12716)
- refactor: move cached crates.io SourceID to config module (rust-lang/cargo#12711)
- fix: typos in registry authentication documentation (rust-lang/cargo#12714)
- doc: mention unstable flag `-Z asymmetric-token` (rust-lang/cargo#12712)
- fix: copy PDBs for EFI targets (rust-lang/cargo#12688)
- infra: add auto-trigger rules for new labels (rust-lang/cargo#12713)
- fix: use channel-specific link for registry auth error (rust-lang/cargo#12709)
- Add some enhancements to `cargo clean` (rust-lang/cargo#12638)
- chore: Fix typos (rust-lang/cargo#12707)
- Shortest path (rust-lang/cargo#12678)
- doc/reference/manifest: Adjust `keywords` description (rust-lang/cargo#12705)
- Cargo add displays either feature list or summarized count (rust-lang/cargo#12702)
- SemVer: Update documentation about removing optional dependencies (rust-lang/cargo#12687)
- publish.py: Remove obsolete `sleep()` calls (rust-lang/cargo#12686)
- generalise suggestion on abiguous spec (rust-lang/cargo#12685)
- util/toml: Remove duplicate `serde(rename)` attributes (rust-lang/cargo#12682)

r? ghost
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 23, 2023
Update cargo

19 commits in b4ddf95ad9954118ac0dae835f2966394ad04c02..414d9e3a6d8096f3e276234ce220c868767a8792
2023-09-18 03:48:09 +0000 to 2023-09-22 07:03:57 +0000
- refactor(TomlManifest): fail when package_root is not a directory (rust-lang/cargo#12722)
- Better suggestion for unsupported mode in build command (rust-lang/cargo#12693)
- Update curl-sys to pull in curl 8.3.0 (rust-lang/cargo#12718)
- chore(ci): Ignore patch version in MSRV (rust-lang/cargo#12716)
- refactor: move cached crates.io SourceID to config module (rust-lang/cargo#12711)
- fix: typos in registry authentication documentation (rust-lang/cargo#12714)
- doc: mention unstable flag `-Z asymmetric-token` (rust-lang/cargo#12712)
- fix: copy PDBs for EFI targets (rust-lang/cargo#12688)
- infra: add auto-trigger rules for new labels (rust-lang/cargo#12713)
- fix: use channel-specific link for registry auth error (rust-lang/cargo#12709)
- Add some enhancements to `cargo clean` (rust-lang/cargo#12638)
- chore: Fix typos (rust-lang/cargo#12707)
- Shortest path (rust-lang/cargo#12678)
- doc/reference/manifest: Adjust `keywords` description (rust-lang/cargo#12705)
- Cargo add displays either feature list or summarized count (rust-lang/cargo#12702)
- SemVer: Update documentation about removing optional dependencies (rust-lang/cargo#12687)
- publish.py: Remove obsolete `sleep()` calls (rust-lang/cargo#12686)
- generalise suggestion on abiguous spec (rust-lang/cargo#12685)
- util/toml: Remove duplicate `serde(rename)` attributes (rust-lang/cargo#12682)

r? ghost
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Sep 23, 2023
Update cargo

19 commits in b4ddf95ad9954118ac0dae835f2966394ad04c02..414d9e3a6d8096f3e276234ce220c868767a8792
2023-09-18 03:48:09 +0000 to 2023-09-22 07:03:57 +0000
- refactor(TomlManifest): fail when package_root is not a directory (rust-lang/cargo#12722)
- Better suggestion for unsupported mode in build command (rust-lang/cargo#12693)
- Update curl-sys to pull in curl 8.3.0 (rust-lang/cargo#12718)
- chore(ci): Ignore patch version in MSRV (rust-lang/cargo#12716)
- refactor: move cached crates.io SourceID to config module (rust-lang/cargo#12711)
- fix: typos in registry authentication documentation (rust-lang/cargo#12714)
- doc: mention unstable flag `-Z asymmetric-token` (rust-lang/cargo#12712)
- fix: copy PDBs for EFI targets (rust-lang/cargo#12688)
- infra: add auto-trigger rules for new labels (rust-lang/cargo#12713)
- fix: use channel-specific link for registry auth error (rust-lang/cargo#12709)
- Add some enhancements to `cargo clean` (rust-lang/cargo#12638)
- chore: Fix typos (rust-lang/cargo#12707)
- Shortest path (rust-lang/cargo#12678)
- doc/reference/manifest: Adjust `keywords` description (rust-lang/cargo#12705)
- Cargo add displays either feature list or summarized count (rust-lang/cargo#12702)
- SemVer: Update documentation about removing optional dependencies (rust-lang/cargo#12687)
- publish.py: Remove obsolete `sleep()` calls (rust-lang/cargo#12686)
- generalise suggestion on abiguous spec (rust-lang/cargo#12685)
- util/toml: Remove duplicate `serde(rename)` attributes (rust-lang/cargo#12682)

r? ghost
@ehuss ehuss added this to the 1.74.0 milestone Sep 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-documenting-cargo-itself Area: Cargo's documentation 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.

5 participants