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: encode URL params correctly for SourceId in Cargo.lock #12280

Merged
merged 5 commits into from
Jul 23, 2023

Conversation

weihanglo
Copy link
Member

What does this PR try to resolve?

Fixes #11085, also as a part of #12120.

When serialize Resolve for Cargo.lock, previously Cargo relys on SourceId::as_url, which is good for user-facing string. However, it leads to an incorrect deserialization since url crate always assume the given string is correctly url-encoded.

impl ser::Serialize for SourceId {
fn serialize<S>(&self, s: S) -> Result<S::Ok, S::Error>
where
S: ser::Serializer,
{
if self.is_path() {
None::<String>.serialize(s)
} else {
s.collect_str(&self.as_url())
}
}
}

This fixes by adding a wrapper for encoding SourceId during the serialization for Cargo.lock.

How should we test and review this PR?

This is a conitnuation of #12279. #12279 should be reviewed first.

We use form_urlencoded::byte_serialize, which is re-exported by url crate. Tests are copied from #11086. Kudos to the original author!

@rustbot
Copy link
Collaborator

rustbot commented Jun 17, 2023

r? @ehuss

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

@rustbot rustbot added A-dependency-resolution Area: dependency resolution and the resolver A-git Area: anything dealing with git A-lockfile Area: Cargo.lock issues A-manifest Area: Cargo.toml issues A-unstable Area: nightly unstable support S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 17, 2023
@weihanglo weihanglo force-pushed the git-ref-ambiguity branch from c1840a7 to e268400 Compare June 17, 2023 09:55
weihanglo and others added 4 commits June 17, 2023 15:57
These tests verify the existing buggy behavior.
Function `SourceId::as_encoded_url()` is added for that purpose.

Co-authored-by: Gabriel de Perthuis <g2p.code@gmail.com>
The `Display` of SourceId stays the same, keeping it human-readable.
This will happen in lockfile format v4.
@weihanglo weihanglo force-pushed the git-ref-ambiguity branch from e268400 to 65b292f Compare June 17, 2023 14:58
@weihanglo weihanglo removed A-manifest Area: Cargo.toml issues A-unstable Area: nightly unstable support labels Jun 17, 2023
@ehuss
Copy link
Contributor

ehuss commented Jun 20, 2023

I'm a little uncertain about having different serializations of SourceId. Can you say more about why it wouldn't have the same form as what is in Cargo.lock? I'm a little concerned about having them out of sync, though I don't have a specific scenario where that would be an issue.

(Out of sync in the sense of cargo metadata or JSON messages (or any other messages?) having different forms than Cargo.lock.)

@weihanglo
Copy link
Member Author

My original thought was to keep the human-readable message as good as possible. That was my mistake not thinking too much on cargo metadata and JSON messages.

Now I lean toward making all of them use URL encode, except lockfile version 3. Old lockfiles will remain in the “wrong” format to avoid unnecessary churns. Do you think this new approach would be a compatibility hazard for cargo metadata and others?

@ehuss
Copy link
Contributor

ehuss commented Jun 22, 2023

Do you think this new approach would be a compatibility hazard for cargo metadata and others?

No. I don't think the package ID's and such have stability guarantees.

@ehuss ehuss added the T-cargo Team: Cargo label Jun 22, 2023
@ehuss
Copy link
Contributor

ehuss commented Jun 22, 2023

I think I'd like to go ahead and kick of an fcp to merge this, though not strictly necessary since this is still unstable. I think we should be extra cautious about lockfile changes. Also, please confirm my rehashing of the issue.

@rfcbot fcp merge

@rust-lang/cargo This is an unstable change to Cargo.lock encoding. This will be part of the version 4 encoding, which is currently unstable and can only be used with -Znext-lockfile-bump on nightly. We may accumulate other changes to roll up in the version 4 change to reduce churn (described in #12120).

For a rollout, eventually in the future we will stabilize the ability for cargo to read the version 4 lock files, but cargo won't create them. Eventually, after at least 6 months after that, cargo will start writing version 4 lock files when creating them from scratch. Otherwise, lock file versions are sticky, and they aren't updated automatically (which we may want to reconsider, at least for this specific case).

This change involves changing the serialization of git dependencies. Git dependencies are encoded as a URL in the lock file:

[[package]]
name = "regex"
version = "1.8.4"
source = "git+https://github.com/rust-lang/regex.git?branch=branchname#5a34a39b72d85730065d3ffe4ce3715f2731e49a"

Unfortunately the serialization code blindly includes the git branch, tag, or revision as a string in the URL without properly escaping the contents (with % encoding). But the deserialization is expecting a URL and does proper decoding. This results in a few different problems:

  • A + symbol gets changed to a space. When cargo loads that, it sees ?branch=foo+bar does not match ?branch=foo bar and assumes it has changed, forcing it to fetch the git repo and rewrite Cargo.lock every time.
  • A # symbol confuses the fragment parser. ?branch=foo#bar#SHA1 is interpreted as branch=foo. This causes cargo to think Cargo.lock is out of date (because the branch is actually foo#bar), and re-fetches the git repo, and rewrites Cargo.lock (again with the broken #).
  • A % symbol is interpreted as % encoding when it shouldn't. If the next two letters are hex-like, then it will decode them. For example, foo%bar would be decoded as foo�r, causing the same refetch/rewrite cycle as mentioned above.

We can't just change this without a lock version bump, because older versions of Cargo will see the % encoding and convert it back to the non-% encoding, overwrite Cargo.lock, and start the cycle of refetching and updating Cargo.lock.

@rfcbot
Copy link
Collaborator

rfcbot commented Jun 22, 2023

Team member @ehuss has proposed to merge this. The next step is review by the rest of the tagged team members:

Concerns:

Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

See this document for info about what commands tagged team members can give me.

@rfcbot rfcbot added proposed-final-comment-period An FCP proposal has started, but not yet signed off. disposition-merge FCP with intent to merge labels Jun 22, 2023
@ehuss
Copy link
Contributor

ehuss commented Jun 22, 2023

@rfcbot concern consistency

Raising a concern to have SourceId serialized consistently in JSON messages to match that in Cargo.lock mentioned at #12280 (comment). I'm not sure how feasible that is to do properly. For example, should it be dependent on the current version of Cargo.lock? Or should it always use the new format? For simplicity, I would lean towards always using the new format, but I'm uncertain about what considerations are needed here.

@weihanglo
Copy link
Member Author

No. I don't think the package ID's and such have stability guarantees.

Does that mean user should see id and source file in cargo metadata output as opaque strings? If this is the case, should we document it?

concern consistency

Agree with ehuss on always using the new format. If we see it as a bug, it should be fine just fixing JSON message and SourceId serialization together. We don't do that for Cargo.lock because it may mess up version control systems.

However, maybe we shouldn't change until we are going to stabilize lockfile v4? That could make things more consistent.

@ehuss
Copy link
Contributor

ehuss commented Jun 25, 2023

Does that mean user should see id and source file in cargo metadata output as opaque strings? If this is the case, should we document it?

I was thinking be essence that it is specified as a "unique ID" and nothing else that it is otherwise not defined. It might be good to explicitly say it is opaque (I did include that in the unit graph docs).

However, maybe we shouldn't change until we are going to stabilize lockfile v4? That could make things more consistent.

That seems fine with me. Is there some way we can track that so it isn't forgotten? Maybe just in #12120?

To make things more consistent, we will change to `pretty_ref(true)`
when we are going to stabilize lockfile v4.
@weihanglo
Copy link
Member Author

That seems fine with me. Is there some way we can track that so it isn't forgotten? Maybe just in #12120?

Does that mean this pull request is good to go if we can remember set them to true when stabilizing?

BTW, just added a new commit for reminding us inline in source code. Also left a comment there in #12120 (comment).

@ehuss
Copy link
Contributor

ehuss commented Jun 26, 2023

Seems good enough to resolve my concern.

@rfcbot resolve consistency

@rfcbot rfcbot added final-comment-period FCP — a period for last comments before action is taken and removed proposed-final-comment-period An FCP proposal has started, but not yet signed off. labels Jul 11, 2023
@rfcbot
Copy link
Collaborator

rfcbot commented Jul 11, 2023

🔔 This is now entering its final comment period, as per the review above. 🔔

@rfcbot rfcbot added finished-final-comment-period FCP complete to-announce and removed final-comment-period FCP — a period for last comments before action is taken labels Jul 21, 2023
@rfcbot
Copy link
Collaborator

rfcbot commented Jul 21, 2023

The final comment period, with a disposition to merge, as per the review above, is now complete.

As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed.

This will be merged soon.

@ehuss
Copy link
Contributor

ehuss commented Jul 23, 2023

Thanks!

@bors r+

@bors
Copy link
Contributor

bors commented Jul 23, 2023

📌 Commit 273285f has been approved by ehuss

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 Jul 23, 2023
@bors
Copy link
Contributor

bors commented Jul 23, 2023

⌛ Testing commit 273285f with merge 7c82ff2...

@bors
Copy link
Contributor

bors commented Jul 23, 2023

☀️ Test successful - checks-actions
Approved by: ehuss
Pushing 7c82ff2 to master...

@bors bors merged commit 7c82ff2 into rust-lang:master Jul 23, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 25, 2023
Update cargo

8 commits in 1b15556767f4b78a64e868eedf4073c423f02b93..7ac9416d82cd4fc5e707c9ec3574d22dff6466e5
2023-07-18 14:44:47 +0000 to 2023-07-24 14:29:38 +0000
- fix(cargo-credential): should enable feature `serde/derive` (rust-lang/cargo#12396)
- fix: encode URL params correctly for SourceId in Cargo.lock (rust-lang/cargo#12280)
- docs: format config override caveat as a note (rust-lang/cargo#12392)
- credential provider implementation (rust-lang/cargo#12334)
- feat(crates-io): expose HTTP headers and Error type (rust-lang/cargo#12310)
- chore: Don't update test data (rust-lang/cargo#12380)
- fix: only skip mtime check on `~/.cargo/{git,registry}` (rust-lang/cargo#12369)
- Update docs for artifact JSON debuginfo levels. (rust-lang/cargo#12376)

Since rust-lang/cargo#12334 makes built-in credential providers part of the cargo binary, it's no longer needed to build them in bootstrap.
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Jul 26, 2023
Update cargo

8 commits in 1b15556767f4b78a64e868eedf4073c423f02b93..7ac9416d82cd4fc5e707c9ec3574d22dff6466e5
2023-07-18 14:44:47 +0000 to 2023-07-24 14:29:38 +0000
- fix(cargo-credential): should enable feature `serde/derive` (rust-lang/cargo#12396)
- fix: encode URL params correctly for SourceId in Cargo.lock (rust-lang/cargo#12280)
- docs: format config override caveat as a note (rust-lang/cargo#12392)
- credential provider implementation (rust-lang/cargo#12334)
- feat(crates-io): expose HTTP headers and Error type (rust-lang/cargo#12310)
- chore: Don't update test data (rust-lang/cargo#12380)
- fix: only skip mtime check on `~/.cargo/{git,registry}` (rust-lang/cargo#12369)
- Update docs for artifact JSON debuginfo levels. (rust-lang/cargo#12376)

Since rust-lang/cargo#12334 makes built-in credential providers part of the cargo binary, it's no longer needed to build them in bootstrap.
@ehuss ehuss added this to the 1.73.0 milestone Jul 30, 2023
@weihanglo weihanglo deleted the git-ref-ambiguity branch August 3, 2023 13:16
wip-sync pushed a commit to NetBSD/pkgsrc-wip that referenced this pull request Oct 6, 2023
Language
--------

- [Uplift `clippy::fn_null_check` lint as `useless_ptr_null_checks`.]
  (rust-lang/rust#111717)
- [Make `noop_method_call` warn by default.]
  (rust-lang/rust#111916)
- [Support interpolated block for `try` and `async` in macros.]
  (rust-lang/rust#112953)
- [Make `unconditional_recursion` lint detect recursive drops.]
  (rust-lang/rust#113902)
- [Future compatibility warning for some impls being incorrectly
  considered not overlapping.]
  (rust-lang/rust#114023)
- [The `invalid_reference_casting` lint is now **deny-by-default**
  (instead of allow-by-default)]
  (rust-lang/rust#112431)

Compiler
--------

- [Write version information in a `.comment` section like GCC/Clang.]
  (rust-lang/rust#97550)
- [Add documentation on v0 symbol mangling.]
  (rust-lang/rust#97571)
- [Stabilize `extern "thiscall"` and `"thiscall-unwind"` ABIs.]
  (rust-lang/rust#114562)
- [Only check outlives goals on impl compared to trait.]
  (rust-lang/rust#109356)
- [Infer type in irrefutable slice patterns with fixed length as array.]
  (rust-lang/rust#113199)
- [Discard default auto trait impls if explicit ones exist.]
  (rust-lang/rust#113312)
- Add several new tier 3 targets:
    - [`aarch64-unknown-teeos`]
      (rust-lang/rust#113480)
    - [`csky-unknown-linux-gnuabiv2`]
      (rust-lang/rust#113658)
    - [`riscv64-linux-android`]
      (rust-lang/rust#112858)
    - [`riscv64gc-unknown-hermit`]
      (rust-lang/rust#114004)
    - [`x86_64-unikraft-linux-musl`]
      (rust-lang/rust#113411)
    - [`x86_64-unknown-linux-ohos`]
      (rust-lang/rust#113061)
- [Add `wasm32-wasi-preview1-threads` as a tier 2 target.]
  (rust-lang/rust#112922)

Refer to Rust's [platform support page][platform-support-doc]
for more information on Rust's tiered platform support.

Libraries
---------

- [Add `Read`, `Write` and `Seek` impls for `Arc<File>`.]
  (rust-lang/rust#94748)
- [Merge functionality of `io::Sink` into `io::Empty`.]
  (rust-lang/rust#98154)
- [Implement `RefUnwindSafe` for `Backtrace`]
  (rust-lang/rust#100455)
- [Make `ExitStatus` implement `Default`]
  (rust-lang/rust#106425)
- [`impl SliceIndex<str> for (Bound<usize>, Bound<usize>)`]
  (rust-lang/rust#111081)
- [Change default panic handler message format.]
  (rust-lang/rust#112849)
- [Cleaner `assert_eq!` & `assert_ne!` panic messages.]
  (rust-lang/rust#111071)
- [Correct the (deprecated) Android `stat` struct definitions.]
  (rust-lang/rust#113130)

Stabilized APIs
---------------

- [Unsigned `{integer}::div_ceil`]
  (https://doc.rust-lang.org/stable/std/primitive.u32.html#method.div_ceil)
- [Unsigned `{integer}::next_multiple_of`]
  (https://doc.rust-lang.org/stable/std/primitive.u32.html#method.next_multiple_of)
- [Unsigned `{integer}::checked_next_multiple_of`]
  (https://doc.rust-lang.org/stable/std/primitive.u32.html#method.checked_next_multiple_of)
- [`std::ffi::FromBytesUntilNulError`]
  (https://doc.rust-lang.org/stable/std/ffi/struct.FromBytesUntilNulError.html)
- [`std::os::unix::fs::chown`]
  (https://doc.rust-lang.org/stable/std/os/unix/fs/fn.chown.html)
- [`std::os::unix::fs::fchown`]
  (https://doc.rust-lang.org/stable/std/os/unix/fs/fn.fchown.html)
- [`std::os::unix::fs::lfchown`]
  (https://doc.rust-lang.org/stable/std/os/unix/fs/fn.lchown.html)
- [`LocalKey::<Cell<T>>::get`]
  (https://doc.rust-lang.org/stable/std/thread/struct.LocalKey.html#method.get)
- [`LocalKey::<Cell<T>>::set`]
  (https://doc.rust-lang.org/stable/std/thread/struct.LocalKey.html#method.set)
- [`LocalKey::<Cell<T>>::take`]
  (https://doc.rust-lang.org/stable/std/thread/struct.LocalKey.html#method.take)
- [`LocalKey::<Cell<T>>::replace`]
  (https://doc.rust-lang.org/stable/std/thread/struct.LocalKey.html#method.replace)
- [`LocalKey::<RefCell<T>>::with_borrow`]
  (https://doc.rust-lang.org/stable/std/thread/struct.LocalKey.html#method.with_borrow)
- [`LocalKey::<RefCell<T>>::with_borrow_mut`]
  (https://doc.rust-lang.org/stable/std/thread/struct.LocalKey.html#method.with_borrow_mut)
- [`LocalKey::<RefCell<T>>::set`]
  (https://doc.rust-lang.org/stable/std/thread/struct.LocalKey.html#method.set-1)
- [`LocalKey::<RefCell<T>>::take`]
  (https://doc.rust-lang.org/stable/std/thread/struct.LocalKey.html#method.take-1)
- [`LocalKey::<RefCell<T>>::replace`]
  (https://doc.rust-lang.org/stable/std/thread/struct.LocalKey.html#method.replace-1)

These APIs are now stable in const contexts:

- [`rc::Weak::new`]
  (https://doc.rust-lang.org/stable/alloc/rc/struct.Weak.html#method.new)
- [`sync::Weak::new`]
  (https://doc.rust-lang.org/stable/alloc/sync/struct.Weak.html#method.new)
- [`NonNull::as_ref`]
  (https://doc.rust-lang.org/stable/core/ptr/struct.NonNull.html#method.as_ref)

Cargo
-----

- [Encode URL params correctly for `SourceId` in `Cargo.lock`.]
  (rust-lang/cargo#12280)
- [Bail out an error when using `cargo::` in custom build script.]
  (rust-lang/cargo#12332)

Compatibility Notes
-------------------

- [Update the minimum external LLVM to 15.]
  (rust-lang/rust#114148)
- [Check for non-defining uses of return position `impl Trait`.]
  (rust-lang/rust#112842)

Internal Changes
----------------

These changes do not affect any public interfaces of Rust, but they represent
significant improvements to the performance or internals of rustc and related
tools.

- [Remove LLVM pointee types, supporting only opaque pointers.]
  (rust-lang/rust#105545)
- [Port PGO/LTO/BOLT optimized build pipeline to Rust.]
  (rust-lang/rust#112235)
- [Replace in-tree `rustc_apfloat` with the new version of the crate.]
  (rust-lang/rust#113843)
- [Update to LLVM 17.]
  (rust-lang/rust#114048)
- [Add `internal_features` lint for internal unstable features.]
  (rust-lang/rust#108955)
- [Mention style for new syntax in tracking issue template.]
  (rust-lang/rust#113586)
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Nov 16, 2023
Pkgsrc changes:
 * Adjust patches and cargo checksums to new versions.
 * For an external LLVM, set dependency of llvm >= 15, in accordance
   with the upstream changes.
 * Add a patch with a backport from LLVM 17.0.3 fixing codegen for
   PPC, ref. rust-lang/rust#116845

Upstream changes:

Version 1.73.0 (2023-10-05)
==========================

Language
--------

- [Uplift `clippy::fn_null_check` lint as `useless_ptr_null_checks`.]
  (rust-lang/rust#111717)
- [Make `noop_method_call` warn by default.]
  (rust-lang/rust#111916)
- [Support interpolated block for `try` and `async` in macros.]
  (rust-lang/rust#112953)
- [Make `unconditional_recursion` lint detect recursive drops.]
  (rust-lang/rust#113902)
- [Future compatibility warning for some impls being incorrectly
  considered not overlapping.]
  (rust-lang/rust#114023)
- [The `invalid_reference_casting` lint is now **deny-by-default**
  (instead of allow-by-default)]
  (rust-lang/rust#112431

Compiler
--------

- [Write version information in a `.comment` section like GCC/Clang.]
  (rust-lang/rust#97550)
- [Add documentation on v0 symbol mangling.]
  (rust-lang/rust#97571)
- [Stabilize `extern "thiscall"` and `"thiscall-unwind"` ABIs.]
  (rust-lang/rust#114562)
- [Only check outlives goals on impl compared to trait.]
  (rust-lang/rust#109356)
- [Infer type in irrefutable slice patterns with fixed length as array.]
  (rust-lang/rust#113199)
- [Discard default auto trait impls if explicit ones exist.]
  (rust-lang/rust#113312)
- Add several new tier 3 targets:
    - [`aarch64-unknown-teeos`]
      (rust-lang/rust#113480)
    - [`csky-unknown-linux-gnuabiv2`]
      (rust-lang/rust#113658)
    - [`riscv64-linux-android`]
      (rust-lang/rust#112858)
    - [`riscv64gc-unknown-hermit`]
      (rust-lang/rust#114004)
    - [`x86_64-unikraft-linux-musl`]
      (rust-lang/rust#113411)
    - [`x86_64-unknown-linux-ohos`]
      (rust-lang/rust#113061)
- [Add `wasm32-wasi-preview1-threads` as a tier 2 target.]
  (rust-lang/rust#112922)

Refer to Rust's [platform support page][platform-support-doc]
for more information on Rust's tiered platform support.

Libraries
---------

- [Add `Read`, `Write` and `Seek` impls for `Arc<File>`.]
  (rust-lang/rust#94748)
- [Merge functionality of `io::Sink` into `io::Empty`.]
  (rust-lang/rust#98154)
- [Implement `RefUnwindSafe` for `Backtrace`]
  (rust-lang/rust#100455)
- [Make `ExitStatus` implement `Default`]
  (rust-lang/rust#106425)
- [`impl SliceIndex<str> for (Bound<usize>, Bound<usize>)`]
  (rust-lang/rust#111081)
- [Change default panic handler message format.]
  (rust-lang/rust#112849)
- [Cleaner `assert_eq!` & `assert_ne!` panic messages.]
  (rust-lang/rust#111071)
- [Correct the (deprecated) Android `stat` struct definitions.]
  (rust-lang/rust#113130)

Stabilized APIs
---------------

- [Unsigned `{integer}::div_ceil`]
  (https://doc.rust-lang.org/stable/std/primitiv e.u32.html#method.div_ceil)
- [Unsigned `{integer}::next_multiple_of`]
  (https://doc.rust-lang.org/stable/std/primitive.u32.html#method.next_multiple_of)
- [Unsigned `{integer}::checked_next_multiple_of`]
  (https://doc.rust-lang.org/stable/std/primitive.u32.html#method.checked_next_multiple_of)
- [`std::ffi::FromBytesUntilNulError`]
  (https://doc.rust-lang.org/stable/std/ffi/struct.FromBytesUntilNulError.html)
- [`std::os::unix::fs::chown`]
  (https://doc.rust-lang.org/stable/std/os/unix/fs/fn.chown.html)
- [`std::os::unix::fs::fchown`]
  (https://doc.rust-lang.org/stable/std/os/unix/fs/fn.fchown.html)
- [`std::os::unix::fs::lfchown`]
  (https://doc.rust-lang.org/stable/std/os/unix/fs/fn.lchown.html)
- [`LocalKey::<Cell<T>>::get`]
  (https://doc.rust-lang.org/stable/std/thread/struct.LocalKey.html#method.get)
- [`LocalKey::<Cell<T>>::set`]
  (https://doc.rust-lang.org/stable/std/thread/struct.LocalKey.html#method.set)
- [`LocalKey::<Cell<T>>::take`]
  (https://doc.rust-lang.org/stable/std/thread/struct.LocalKey.html#method.take)
- [`LocalKey::<Cell<T>>::replace`]
  (https://doc.rust-lang.org/stable/std/thread/struct.LocalKey.html#method.replace)
- [`LocalKey::<RefCell<T>>::with_borrow`]
  (https://doc.rust-lang.org/stable/std/thread/struct.LocalKey.html#method.with_borrow)
- [`LocalKey::<RefCell<T>>::with_borrow_mut`]
  (https://doc.rust-lang.org/stable/std/thread/struct.LocalKey.html#method.with_borrow_mut)
- [`LocalKey::<RefCell<T>>::set`]
  (https://doc.rust-lang.org/stable/std/thread/struct.LocalKey.html#method.set-1)
- [`LocalKey::<RefCell<T>>::take`]
  (https://doc.rust-lang.org/stable/std/thread/struct.LocalKey.html#method.take-1)
- [`LocalKey::<RefCell<T>>::replace`]
  (https://doc.rust-lang.org/stable/std/thread/struct.LocalKey.html#method.replace-1)

These APIs are now stable in const contexts:

- [`rc::Weak::new`]
  (https://doc.rust-lang.org/stable/alloc/rc/struct.Weak.html#method.new)
- [`sync::Weak::new`]
  (https://doc.rust-lang.org/stable/alloc/sync/struct.Weak.html#method.new)
- [`NonNull::as_ref`]
  (https://doc.rust-lang.org/stable/core/ptr/struct.NonNull.html#method.as_ref)

Cargo
-----

- [Encode URL params correctly for `SourceId` in `Cargo.lock`.]
  (rust-lang/cargo#12280)
- [Bail out an error when using `cargo::` in custom build script.]
  (rust-lang/cargo#12332)

Misc
----

Compatibility Notes
-------------------

- [Update the minimum external LLVM to 15.]
  (rust-lang/rust#114148)
- [Check for non-defining uses of return position `impl Trait`.]
  (rust-lang/rust#112842)

Internal Changes
----------------

These changes do not affect any public interfaces of Rust, but they
represent significant improvements to the performance or internals
of rustc and related tools.

- [Remove LLVM pointee types, supporting only opaque pointers.]
  (rust-lang/rust#105545)
- [Port PGO/LTO/BOLT optimized build pipeline to Rust.]
  (rust-lang/rust#112235)
- [Replace in-tree `rustc_apfloat` with the new version of the crate.]
  (rust-lang/rust#113843)
- [Update to LLVM 17.]
  (rust-lang/rust#114048)
- [Add `internal_features` lint for internal unstable features.]
  (rust-lang/rust#108955)
- [Mention style for new syntax in tracking issue template.]
  (rust-lang/rust#113586)
SifraiTeam pushed a commit to grandinetech/grandine that referenced this pull request May 25, 2024
Cargo.lock was updated to version 4 manually.
All Git refs in our Cargo.lock appear to be encoded correctly.
See:
- rust-lang/cargo#12280
- rust-lang/cargo#12852

The clippy::incompatible_msrv lint may be useful in the future.
We currently do not specify rust-version in Cargo.toml.
Our libraries are not designed to be used outside Grandine.
rust-toolchain.toml makes rust-version redundant for builds inside this repository.
See:
- https://doc.rust-lang.org/1.78.0/cargo/reference/manifest.html#the-rust-version-field
- https://rust-lang.github.io/rust-clippy/rust-1.78.0/#/incompatible_msrv

The clippy::lint_groups_priority lint produces false positives:
- rust-lang/cargo#12918 (comment)
- rust-lang/rust-clippy#12270
Luckily, lints inherited from a workspace do not trigger it.
The issue appears to be fixed in rust-lang/rust-clippy#12827.

The reason public functions trigger clippy::single_call_fn is actually our setting of avoid-breaking-exported-api.
We assumed it was a bug.
SifraiTeam pushed a commit to grandinetech/grandine that referenced this pull request Jul 12, 2024
Cargo.lock was updated to version 4 manually.
All Git refs in our Cargo.lock appear to be encoded correctly.
See:
- rust-lang/cargo#12280
- rust-lang/cargo#12852

The clippy::incompatible_msrv lint may be useful in the future.
We currently do not specify rust-version in Cargo.toml.
Our libraries are not designed to be used outside Grandine.
rust-toolchain.toml makes rust-version redundant for builds inside this repository.
See:
- https://doc.rust-lang.org/1.78.0/cargo/reference/manifest.html#the-rust-version-field
- https://rust-lang.github.io/rust-clippy/rust-1.78.0/#/incompatible_msrv

The clippy::lint_groups_priority lint produces false positives:
- rust-lang/cargo#12918 (comment)
- rust-lang/rust-clippy#12270
Luckily, lints inherited from a workspace do not trigger it.
The issue appears to be fixed in rust-lang/rust-clippy#12827.

The reason public functions trigger clippy::single_call_fn is actually our setting of avoid-breaking-exported-api.
We assumed it was a bug.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-dependency-resolution Area: dependency resolution and the resolver A-git Area: anything dealing with git A-lockfile Area: Cargo.lock issues A-manifest Area: Cargo.toml issues disposition-merge FCP with intent to merge finished-final-comment-period FCP complete S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-cargo Team: Cargo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SourceId serialization is ambiguous due to lack of escaping
5 participants