sailfishos / sailfish-browser

Sailfish Browser
https://github.com/sailfishos/sailfish-browser/wiki/Sailfish-Browser-wiki
Mozilla Public License 2.0
307 stars 87 forks source link

Fix gfx/wgpu/wgpu-core/src/device/mod.rs with newer Rust #1066

Closed rainemak closed 1 month ago

rainemak commented 4 months ago

Fix gfx/wgpu/wgpu-core/src/device/mod.rs with newer Rust 1.75 (and glibc 2.30). Interesting I think this error is not visible for @llewelld. Let's see what's causing it.

Currently I have just commented out offending code which might be bad thing to do but dropping this and updating related cargo hash the gecko builds successfully.

4:56.90 error[E0597]: desc_set does not live long enough 4:56.90 --> gfx/wgpu/wgpu-core/src/device/mod.rs:1795:26 4:56.90 | 4:56.90 1782 | let mut desc_set = desc_sets.pop().unwrap(); 4:56.90 | ------------ binding desc_set declared here 4:56.90 ... 4:56.90 1795 | set: desc_set.raw_mut(), 4:56.91 | ^^^^^^^^ borrowed value does not live long enough 4:56.91 ... 4:56.91 1816 | } 4:56.91 | - 4:56.91 | | 4:56.91 | desc_set dropped here while still borrowed 4:56.91 | borrow might be used here, when write_map is dropped and runs the Drop code for type BTreeMap 4:56.91 | 4:56.91 = note: values in a scope are dropped in the opposite order they are defined 4:57.61 For more information about this error, try rustc --explain E0597. 4:57.63 warning: wgpu-core (lib) generated 1 warning 4:57.63 error: could not compile wgpu-core (lib) due to previous error; 1 warning emitted

This issue looks same as this: https://github.com/rust-lang/rust/issues/70919

Above in turn points to: https://github.com/typst/typst/pull/2058

Other inputs: https://quinedot.github.io/rust-learning/pf-borrow-forever.html https://quinedot.github.io/rust-learning/pf-shared-nested.html

rainemak commented 1 month ago

Fixed here https://github.com/sailfishos/gecko-dev/blob/sailfishos-esr91/rpm/0076-sailfishos-gecko-Fix-build-failure-due-to-rust-lang-.patch