The Rust template is broken
When creating a new Rust GTK template in Builder (3.38 or the current nightly: 3.38.0-80-g39f79014), building it, and running it, it instantaneously crashes with the following error: thread 'main' panicked at 'Could not load resources: Error { domain: g-file-error-quark, code: 4, message: "Failed to open file “/usr/local/share/rust-tuto/rust-tuto.gresource”: open() failed: No such file or directory" }', src/main.rs:17:10
.
After searching a bit, I noticed that on a brand new project the PKGDATADIR
config variable has the right path for a split second and then it's overwritten with a wrong path:
I also noticed that dropping config.rs
from rust_sources
in src/meson.build
fixes the issue: I can build and run the template correctly. I am not submitting a MR because I have no idea what side effects removing that file could have.
diff --git a/src/plugins/meson-templates/resources/src/meson-rs.build b/src/plugins/meson-templates/resources/src/meson-rs.build
index a29405ba4..e88bc685e 100644
--- a/src/plugins/meson-templates/resources/src/meson-rs.build
+++ b/src/plugins/meson-templates/resources/src/meson-rs.build
@@ -28,7 +28,6 @@ run_command(
)
rust_sources = files(
- 'config.rs',
'main.rs',
'window.rs',
)