From 786abbf3f5e5be4b89c6b53d2d03162079f8e1f4 Mon Sep 17 00:00:00 2001 From: Mike Date: Sat, 30 Dec 2023 01:07:31 -0800 Subject: [PATCH] Fix ci xvfb (#11143) # Objective Fix ci hang, so we can merge pr's again. ## Solution - switch ppa action to use mesa stable versions https://launchpad.net/~kisak/+archive/ubuntu/turtle - use commit from #11123 --------- Co-authored-by: Stepan Koltsov --- .github/workflows/validation-jobs.yml | 4 ++-- crates/bevy_ecs/src/entity/mod.rs | 2 ++ crates/bevy_ecs/src/query/state.rs | 6 +++--- crates/bevy_ecs/src/storage/blob_vec.rs | 2 +- crates/bevy_gltf/src/loader.rs | 3 ++- crates/bevy_reflect/src/impls/std.rs | 2 +- crates/bevy_ui/src/ui_node.rs | 12 ++++++------ crates/bevy_utils/src/lib.rs | 5 +---- examples/3d/transmission.rs | 15 ++++++--------- 9 files changed, 24 insertions(+), 27 deletions(-) diff --git a/.github/workflows/validation-jobs.yml b/.github/workflows/validation-jobs.yml index 9b728bb2a0f1a..288a175e7a7c5 100644 --- a/.github/workflows/validation-jobs.yml +++ b/.github/workflows/validation-jobs.yml @@ -74,7 +74,7 @@ jobs: - name: install xvfb, llvmpipe and lavapipe run: | sudo apt-get update -y -qq - sudo add-apt-repository ppa:kisak/kisak-mesa -y + sudo add-apt-repository ppa:kisak/turtle -y sudo apt-get update sudo apt install -y xvfb libegl1-mesa libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers - uses: actions/checkout@v4 @@ -148,7 +148,7 @@ jobs: - name: install xvfb, llvmpipe and lavapipe run: | sudo apt-get update -y -qq - sudo add-apt-repository ppa:kisak/kisak-mesa -y + sudo add-apt-repository ppa:kisak/turtle -y sudo apt-get update sudo apt install -y xvfb libegl1-mesa libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers diff --git a/crates/bevy_ecs/src/entity/mod.rs b/crates/bevy_ecs/src/entity/mod.rs index 61c12e2fa7f5d..72c562d6089c1 100644 --- a/crates/bevy_ecs/src/entity/mod.rs +++ b/crates/bevy_ecs/src/entity/mod.rs @@ -436,6 +436,7 @@ impl Entities { /// Reserve entity IDs concurrently. /// /// Storage for entity generation and location is lazily allocated by calling [`flush`](Entities::flush). + #[allow(clippy::unnecessary_fallible_conversions)] // Because `IdCursor::try_from` may fail on 32-bit platforms. pub fn reserve_entities(&self, count: u32) -> ReserveEntitiesIterator { // Use one atomic subtract to grab a range of new IDs. The range might be // entirely nonnegative, meaning all IDs come from the freelist, or entirely @@ -627,6 +628,7 @@ impl Entities { } /// Ensure at least `n` allocations can succeed without reallocating. + #[allow(clippy::unnecessary_fallible_conversions)] // Because `IdCursor::try_from` may fail on 32-bit platforms. pub fn reserve(&mut self, additional: u32) { self.verify_flushed(); diff --git a/crates/bevy_ecs/src/query/state.rs b/crates/bevy_ecs/src/query/state.rs index 8da4e2fcca9c3..4971ad7bf3f4f 100644 --- a/crates/bevy_ecs/src/query/state.rs +++ b/crates/bevy_ecs/src/query/state.rs @@ -996,7 +996,7 @@ impl QueryState { } /// Runs `func` on each query result for the given [`World`]. This is faster than the equivalent - /// iter() method, but cannot be chained like a normal [`Iterator`]. + /// `iter()` method, but cannot be chained like a normal [`Iterator`]. /// /// This can only be called for read-only queries, see [`Self::for_each_mut`] for write-queries. /// @@ -1024,7 +1024,7 @@ impl QueryState { } /// Runs `func` on each query result for the given [`World`]. This is faster than the equivalent - /// iter() method, but cannot be chained like a normal [`Iterator`]. + /// `iter()` method, but cannot be chained like a normal [`Iterator`]. /// /// # Safety /// @@ -1086,7 +1086,7 @@ impl QueryState { /// Runs `func` on each query result in parallel for the given [`World`], where the last change and /// the current change tick are given. This is faster than the equivalent - /// iter() method, but cannot be chained like a normal [`Iterator`]. + /// `iter()` method, but cannot be chained like a normal [`Iterator`]. /// /// # Panics /// The [`ComputeTaskPool`] is not initialized. If using this from a query that is being diff --git a/crates/bevy_ecs/src/storage/blob_vec.rs b/crates/bevy_ecs/src/storage/blob_vec.rs index 45a47b671a370..e0032cb646ccd 100644 --- a/crates/bevy_ecs/src/storage/blob_vec.rs +++ b/crates/bevy_ecs/src/storage/blob_vec.rs @@ -306,7 +306,7 @@ impl BlobVec { /// The removed element is replaced by the last element of the `BlobVec`. /// /// # Safety - /// It is the caller's responsibility to ensure that `index` is < self.len() + /// It is the caller's responsibility to ensure that `index` is `< self.len()`. #[inline] pub unsafe fn swap_remove_and_drop_unchecked(&mut self, index: usize) { debug_assert!(index < self.len()); diff --git a/crates/bevy_gltf/src/loader.rs b/crates/bevy_gltf/src/loader.rs index 4d1d3e772f3a8..44ea3caf5e2dd 100644 --- a/crates/bevy_gltf/src/loader.rs +++ b/crates/bevy_gltf/src/loader.rs @@ -893,7 +893,7 @@ fn load_material( } /// Loads a glTF node. -#[allow(clippy::too_many_arguments)] +#[allow(clippy::too_many_arguments, clippy::result_large_err)] fn load_node( gltf_node: &Node, world_builder: &mut WorldChildBuilder, @@ -1291,6 +1291,7 @@ fn texture_address_mode(gltf_address_mode: &WrappingMode) -> ImageAddressMode { } /// Maps the `primitive_topology` form glTF to `wgpu`. +#[allow(clippy::result_large_err)] fn get_primitive_topology(mode: Mode) -> Result { match mode { Mode::Points => Ok(PrimitiveTopology::PointList), diff --git a/crates/bevy_reflect/src/impls/std.rs b/crates/bevy_reflect/src/impls/std.rs index 2a6e7dde005ba..da60e73875e7d 100644 --- a/crates/bevy_reflect/src/impls/std.rs +++ b/crates/bevy_reflect/src/impls/std.rs @@ -1295,7 +1295,7 @@ impl FromReflect for Cow<'static, [T]> { for field in ref_list.iter() { temp_vec.push(T::from_reflect(field)?); } - temp_vec.try_into().ok() + Some(temp_vec.into()) } else { None } diff --git a/crates/bevy_ui/src/ui_node.rs b/crates/bevy_ui/src/ui_node.rs index b687528c46eb8..aa4661f4ab97b 100644 --- a/crates/bevy_ui/src/ui_node.rs +++ b/crates/bevy_ui/src/ui_node.rs @@ -1035,7 +1035,7 @@ impl GridTrack { .into() } - /// Create a fit-content() grid track with fixed pixel limit + /// Create a `fit-content()` grid track with fixed pixel limit. /// /// pub fn fit_content_px>(limit: f32) -> T { @@ -1046,7 +1046,7 @@ impl GridTrack { .into() } - /// Create a fit-content() grid track with percentage limit + /// Create a `fit-content()` grid track with percentage limit. /// /// pub fn fit_content_percent>(limit: f32) -> T { @@ -1057,7 +1057,7 @@ impl GridTrack { .into() } - /// Create a minmax() grid track + /// Create a `minmax()` grid track. /// /// pub fn minmax>(min: MinTrackSizingFunction, max: MaxTrackSizingFunction) -> T { @@ -1198,7 +1198,7 @@ impl RepeatedGridTrack { .into() } - /// Create a repeating set of fit-content() grid tracks with fixed pixel limit + /// Create a repeating set of `fit-content()` grid tracks with fixed pixel limit pub fn fit_content_px>(repetition: u16, limit: f32) -> T { Self { repetition: GridTrackRepetition::Count(repetition), @@ -1207,7 +1207,7 @@ impl RepeatedGridTrack { .into() } - /// Create a repeating set of fit-content() grid tracks with percentage limit + /// Create a repeating set of `fit-content()` grid tracks with percentage limit pub fn fit_content_percent>(repetition: u16, limit: f32) -> T { Self { repetition: GridTrackRepetition::Count(repetition), @@ -1216,7 +1216,7 @@ impl RepeatedGridTrack { .into() } - /// Create a repeating set of minmax() grid track + /// Create a repeating set of `minmax()` grid track pub fn minmax>( repetition: impl Into, min: MinTrackSizingFunction, diff --git a/crates/bevy_utils/src/lib.rs b/crates/bevy_utils/src/lib.rs index dd65ea435f35e..1689a1b849253 100644 --- a/crates/bevy_utils/src/lib.rs +++ b/crates/bevy_utils/src/lib.rs @@ -127,11 +127,8 @@ pub struct Hashed { impl Hashed { /// Pre-hashes the given value using the [`BuildHasher`] configured in the [`Hashed`] type. pub fn new(value: V) -> Self { - let builder = H::default(); - let mut hasher = builder.build_hasher(); - value.hash(&mut hasher); Self { - hash: hasher.finish(), + hash: H::default().hash_one(&value), value, marker: PhantomData, } diff --git a/examples/3d/transmission.rs b/examples/3d/transmission.rs index 0c25b8a588bfc..34a9ae99ae463 100644 --- a/examples/3d/transmission.rs +++ b/examples/3d/transmission.rs @@ -80,15 +80,12 @@ fn setup( let plane_mesh = meshes.add(shape::Plane::from_size(2.0).into()); - let cylinder_mesh = meshes.add( - Mesh::try_from(shape::Cylinder { - radius: 0.5, - height: 2.0, - resolution: 50, - segments: 1, - }) - .unwrap(), - ); + let cylinder_mesh = meshes.add(Mesh::from(shape::Cylinder { + radius: 0.5, + height: 2.0, + resolution: 50, + segments: 1, + })); // Cube #1 commands.spawn((