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

Update to rand:0.8.0 #1113

Closed
CAD97 opened this issue Dec 21, 2020 · 1 comment · Fixed by #1114
Closed

Update to rand:0.8.0 #1113

CAD97 opened this issue Dec 21, 2020 · 1 comment · Fixed by #1114
Labels
C-Dependencies A change to the crates that Bevy depends on

Comments

@CAD97
Copy link
Contributor

CAD97 commented Dec 21, 2020

This is, roughly, intended to be a tracking issue of what's required to cleanly upgrade bevy's tree from rand:0.7 to rand:0.8. Thankfully: not much!

What problem does this solve or what need does it fill?

Update to the latest version of upstream. Randomness is not uncommon in games, and this saves people using the latest version of rand for their game code from having duplicate copies of rand in their dependency tree. This is also currently one of very few out-of-date dependency reported by cargo upgrade[1].

Describe the solution would you like?

The simple cargo upgrade rand --workspace isn't quite enough to purge rand:0.7 from the tree, as uuid:0.8.1 still uses rand:0.7. uuid:git:master currently uses getrandom:0.1.15 directly, and I've opened uuid-rs/uuid#501 to update to getrandom:0.2 (as used by rand:0.8.0 and already in tree via ahash).

Describe the alternative(s) you've considered?

  • Just don't upgrade, and stay on rand:0.7. Drifting behind upstream is definitely not ideal.

Additional context

All out-of-date dependencies:

bevy_ecs:
    Upgrading rand v0.7.3 -> v0.8.0
bevy_asset:
    Upgrading crossbeam-channel v0.4.4 -> v0.5.0
    Upgrading notify v5.0.0-pre.2 -> v5.0.0-pre.4
    Upgrading rand v0.7.3 -> v0.8.0
bevy_gltf:
    Upgrading base64 v0.12.3 -> v0.13.0
bevy_wgpu:
    Upgrading crossbeam-channel v0.4.4 -> v0.5.0
    Upgrading crossbeam-utils v0.7.2 -> v0.8.1
bevy:
    Upgrading rand v0.7.3 -> v0.8.0
@CAD97
Copy link
Contributor Author

CAD97 commented Dec 21, 2020

The following patch (relying on my patched version of uuid) successfully upgrades the tree cleanly:

diff --git a/Cargo.toml b/Cargo.toml
index 207cd123..62b27eaf 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -77,10 +77,13 @@ bevy_internal = {path = "crates/bevy_internal", version = "0.4.0", default-featu
 
 [dev-dependencies]
 anyhow = "1.0"
-rand = "0.7.3"
+rand = "0.8.0"
 ron = "0.6.2"
 serde = {version = "1", features = ["derive"]}
 
+[patch.crates-io]
+uuid = { git = "https://github.com/CAD97/uuid.git", branch = "for-bevy" }
+
 [[example]]
 name = "hello_world"
 path = "examples/hello_world.rs"
diff --git a/crates/bevy_asset/Cargo.toml b/crates/bevy_asset/Cargo.toml
index e5644853..8807125f 100644
--- a/crates/bevy_asset/Cargo.toml
+++ b/crates/bevy_asset/Cargo.toml
@@ -33,7 +33,7 @@ thiserror = "1.0"
 downcast-rs = "1.2.0"
 notify = { version = "5.0.0-pre.2", optional = true }
 parking_lot = "0.11.0"
-rand = "0.7.3"
+rand = "0.8.0"
 
 [target.'cfg(target_arch = "wasm32")'.dependencies]
 wasm-bindgen = { version = "0.2" }
diff --git a/crates/bevy_ecs/Cargo.toml b/crates/bevy_ecs/Cargo.toml
index e1355f3c..b70e874a 100644
--- a/crates/bevy_ecs/Cargo.toml
+++ b/crates/bevy_ecs/Cargo.toml
@@ -20,7 +20,7 @@ trace = []
 bevy_tasks = { path = "../bevy_tasks", version = "0.4.0" }
 bevy_utils = { path = "../bevy_utils", version = "0.4.0" }
 bevy_ecs_macros = { path = "macros", version = "0.4.0" }
-rand = "0.7.3"
+rand = "0.8.0"
 serde = "1.0"
 thiserror = "1.0"
 fixedbitset = "0.3.1"
diff --git a/crates/bevy_ecs/macros/Cargo.toml b/crates/bevy_ecs/macros/Cargo.toml
index 007751d3..4050c7fa 100644
--- a/crates/bevy_ecs/macros/Cargo.toml
+++ b/crates/bevy_ecs/macros/Cargo.toml
@@ -13,4 +13,4 @@ proc-macro = true
 syn = "1.0"
 quote = "1.0"
 proc-macro2 = "1.0"
-find-crate = "0.6"
\ No newline at end of file
+find-crate = "0.6"
diff --git a/crates/bevy_gilrs/Cargo.toml b/crates/bevy_gilrs/Cargo.toml
index 2480e7f7..50978369 100644
--- a/crates/bevy_gilrs/Cargo.toml
+++ b/crates/bevy_gilrs/Cargo.toml
@@ -17,4 +17,4 @@ bevy_input = { path = "../bevy_input", version = "0.4.0" }
 bevy_utils = { path = "../bevy_utils", version = "0.4.0" }
 
 # other
-gilrs = "0.8.0"
\ No newline at end of file
+gilrs = "0.8.0"

@memoryruins memoryruins added the C-Dependencies A change to the crates that Bevy depends on label Dec 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Dependencies A change to the crates that Bevy depends on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants