-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Update all Cargo.toml files to use workspace dependency versions #6501
Conversation
CodSpeed Performance ReportMerging #6501 will degrade performances by 17.31%Comparing Summary
Benchmarks breakdown
|
ba0e9d3
to
ff3c935
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just a few comments.
Closes #5845 |
Awesome to see this. so much cleaner. |
ff3c935
to
cb684bf
Compare
771d4ad
to
0df0880
Compare
4692b0e
to
52b4570
Compare
6780e76
to
8c73032
Compare
@@ -1201,6 +1201,7 @@ impl<'a> TypeCheckContext<'a> { | |||
} | |||
|
|||
if !maybe_method_decl_refs.is_empty() { | |||
#[allow(clippy::mutable_key_type)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we shouldn't enforce this clippy lint since we need to disable it in quite a few places...
@@ -65,8 +68,8 @@ pretty_assertions = "1.4.0" | |||
rand = "0.8" | |||
regex = "^1.10.2" | |||
sway-lsp-test-utils = { path = "tests/utils" } | |||
tikv-jemallocator = "0.5" | |||
tower = { version = "0.4.12", default-features = false, features = ["util"] } | |||
tikv-jemallocator = "0.6.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally prefer using "x.y" instead of "x.y.z" for dependency versions, as it automatically incorporates bug fixes and security updates within the x.y.* range. What are your thoughts about adopting this approach?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work Alfie, just a couple of small nits.
@@ -423,32 +426,40 @@ jobs: | |||
contents: write | |||
steps: | |||
- uses: actions/checkout@v3 | |||
- name: Install toolchain | |||
- name: Install Rust toolchain | |||
if: ${{ !env.ACT }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I'd prefer to do the act-related stuff in a separate PR since it's not related to updating the dependencies
bytes = "1.3.0" | ||
chrono = { version = "0.4", default-features = false } | ||
cid = "0.11" | ||
clap = "4.5.4" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
num-bigint = "0.4.3" | ||
num-traits = "0.2.16" | ||
object = "0.36.4" | ||
once_cell = "1.18.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
object = "0.36.4" | ||
once_cell = "1.18.0" | ||
opener = "0.7.2" | ||
parking_lot = "0.12.1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
serde_ignored = "0.1.9" | ||
serde_json = "1.0.91" | ||
serde_with = "3.3.0" | ||
serde_yaml = "0.9.27" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
latest is "0.9.34"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah i think we should just be setting it to use 0.9 and leave the minor version part off. Same everywhere really.
tempfile = "3" | ||
term-table = "1.3" | ||
termion = "4.0.2" | ||
textwrap = "0.16.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall, just a few nits. I highlighted some other dependencies that have newer versions since it looks like you're aiming to upgrade everything in this PR now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like i forgot to post my review 🤦 anyways it seems like the generated bytecode for the proxy contract changed after this one. I wan't to take a closer look but it is not nice (also not sure how this is possible) that dependency updates are causing bytecode changes in the compiler.
Do we know why?
@@ -341,7 +341,7 @@ async fn test_simple_deploy() { | |||
node.kill().unwrap(); | |||
let expected = vec![DeployedContract { | |||
id: ContractId::from_str( | |||
"50fe882cbef5f3da6da82509a66b7e5e0a64a40d70164861c01c908a332198ae", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we know why these are changed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've turned this PR back into draft, and am pulling out all the changes so that we can see which crates can be updated with no code changes, and which ones end up doing changes like these.
Unfortunately it's a bit time consuming because you end up having to wait for the whole ci.yml
to finish before the next 'edit -> test -> debug` cycle
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I finally found the cause! Bumping rustc-hash
from 1.1
to 2.0
changes the bytecode. I guess it makes sense given the name of the crate, but dang it's not reproducible.
Oh... from the 1.3.0 changelog:
This replaces the previous "fxhash" algorithm originating in Firefox with a custom hasher
I'm going to have a good guess that the old and new hashers don't produce the same output. Ah, yep... all the fixtures for test_hash!()
changed between the algo switch.
## Description For #6179, PR #6501 kept bumping into errors as it was doing too many things, so I've split that PR into multiple PRs. This is the first, and the only thing it does is move all of the various `Cargo.toml` dependencies into the single workspace `Cargo.toml`. Future PRs will: - Update dependency versions - Update code that breaks from the version bumps ## Checklist - [x] I have linked to any relevant issues. - [x] I have commented my code, particularly in hard-to-understand areas. - [x] I have updated the documentation where relevant (API docs, the reference, and the Sway book). - [x] If my change requires substantial documentation changes, I have [requested support from the DevRel team](https://github.com/FuelLabs/devrel-requests/issues/new/choose) - [x] I have added tests that prove my fix is effective or that my feature works. - [x] I have added (or requested a maintainer to add) the necessary `Breaking*` or `New Feature` labels where relevant. - [x] I have done my best to ensure that my PR adheres to [the Fuel Labs Code Review Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md). - [x] I have requested a review from the relevant team or maintainers.
## Description This is a continuation of #6179, and follows on from PR #6501. These are broken into separate PRs so that we can discuss each PR `HEAD` separately so that the PRs that can get merged, do so quickly. Otherwise, the further along they get stale the more work they all need in order to keep up to `master` without being hard to find which change introduced a possible broken build. This PR only does a version bump to every crate dependency that does not need any code changes to apply cleanly. Following this PR will be a new PR, where every commit updates a single crate along with the files that were needed to be changed in order to work again. The crates that will need code changes are: - tokio 1.12: -> 1.40 - rustc-hash: 1.1 -> 2.0 - miden-core: 0.3 -> 0.10 - notify: 5.0 -> 6.1 - notify-debouncer-mini: 0.2 -> 0.4 - revm: 2.3 -> 14.0 - syn: 1.0 -> 2.0 - tikv-jemallocator: 0.5 -> 0.6 - toml_edit: 0.21 -> 0.22 There should also be a commit to upgrade Rust itself to >= `1.81.0`. ... and for another day, there's 3 crates that will take a bit of time to get working, and so will go under a different issue #6536: - annotate-snippets - lsp-types - uint ## Checklist - [x] I have linked to any relevant issues. - [x] I have commented my code, particularly in hard-to-understand areas. - [x] I have updated the documentation where relevant (API docs, the reference, and the Sway book). - [x] If my change requires substantial documentation changes, I have [requested support from the DevRel team](https://github.com/FuelLabs/devrel-requests/issues/new/choose) - [x] I have added tests that prove my fix is effective or that my feature works. - [x] I have added (or requested a maintainer to add) the necessary `Breaking*` or `New Feature` labels where relevant. - [x] I have done my best to ensure that my PR adheres to [the Fuel Labs Code Review Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md). - [x] I have requested a review from the relevant team or maintainers. Co-authored-by: Joshua Batty <[email protected]>
Description
This PR relates to #6179 which aims to simplify individual workspace member dependency versioning by deferring upstream to the workspace dependencies itself.
I've also extended #6179 as it currently only relates to external dependencies - I've noticed that whenever Sway has a version bump, the diffs manually update all of the many
Cargo.toml
files to the new globally shared version. We can also use workspaces here to defer eachCargo.toml
package version to the workspace package version as well.This PR is in 3 parts:
Cargo.toml
external dependencies to use the shared versions defined in the workspace dependenciesCargo.toml
package version to defer to the workspace package version.If an individual workspace member needs to break away from the shared workspace package version, we can still do that:
Cargo.toml
to the new version (as normal)Notes:
[dev-dependencies]
was not factored out since[workspace.dev-dependencies]
is currently not supported byCargo.toml
, meaning all dev dependencies would have to be brought into[workspace.dependencies]
which I assume is not what we would want to do.[target.'cfg(not(target_os = "macos"))'.dependencies]
was not factored out since these crates should only be brought in if the condition is met, but again as the only way to do this would be to move it to[workspace.dependencies]
, I would advise to keep them separated.Checklist
Breaking*
orNew Feature
labels where relevant.