Underscore in Project Name causes build failure in Template
Affected version
- Nightly flatpak: Can't test it because I can't get the template project to build at all. It fails with "project is not configured correctly" error
- Other: Builder 43.4 / Pop!_OS 22.04 LTS
Steps to reproduce
- Create a new project that has an underscore in its name (test_rust)
- Set the application ID to org.testorg.test_rust
- Try to build the application and see an error that the window is not defined.
Current behavior
The project fails to build due to an error about an undefined variable.
Expected behavior
The project builds in the same way as a project name without an underscore and displays the "Hello World" window.
Additional information
I am running Rust 1.66.1 and trying this with a Rust project.
Here's the error that occurs when I attempt to build:
Compiling test_rest v0.1.0 <snip>
error[E0412]: cannot find type `Test_restWindow` in this scope
--> src/window.rs:57:39
|
30 | pub struct TestRestWindow {
| ------------------------- similarly named struct `TestRestWindow` defined here
...
57 | impl AdwApplicationWindowImpl for Test_restWindow {}
| ^^^^^^^^^^^^^^^ help: a struct with a similar name exists: `TestRestWindow`
error[E0277]: the trait bound `window::imp::TestRestWindow: libadwaita::subclass::application_window::AdwApplicationWindowImpl` is not satisfied
--> src/window.rs:42:27
|
42 | type ParentType = adw::ApplicationWindow;
| ^^^^^^^^^^^^^^^^^^^^^^ the trait `libadwaita::subclass::application_window::AdwApplicationWindowImpl` is not implemented for `window::imp::TestRestWindow`
|
= help: the trait `IsSubclassable<T>` is implemented for `libadwaita::ApplicationWindow`
= note: required for `libadwaita::ApplicationWindow` to implement `IsSubclassable<window::imp::TestRestWindow>`
note: required by a bound in `gtk4::subclass::prelude::ObjectSubclass::ParentType`
--> /home/<snip>/.var/app/org.gnome.Builder/cache/gnome-builder/projects/test_rest/builds/org.recursivefault.test_rust.json-flatpak-org.gnome.Platform-43-x86_64-main/cargo-home/registry/src/github.com-1ecc6299db9ec823/glib-0.16.7/src/subclass/types.rs:552:22
|
552 | type ParentType: IsSubclassable<Self>
| ^^^^^^^^^^^^^^^^^^^^ required by this bound in `gtk4::subclass::prelude::ObjectSubclass::ParentType`
Some errors have detailed explanations: E0277, E0412.
For more information about an error, try `rustc --explain E0277`.
error: could not compile `test_rest` due to 2 previous errors
[3/4] Generating data/org.recursivefault.test_rust.desktop with a custom command
FAILED: src/test_rest
/usr/bin/env CARGO_HOME=/home/<snip>/.var/app/org.gnome.Builder/cache/gnome-builder/projects/test_rest/builds/org.recursivefault.test_rust.json-flatpak-org.gnome.Platform-43-x86_64-main/cargo-home /usr/lib/sdk/rust-stable/bin/cargo build --manifest-path /home/<snip>/Projects/test_rest/Cargo.toml --target-dir /home/<snip>/.var/app/org.gnome.Builder/cache/gnome-builder/projects/test_rest/builds/org.recursivefault.test_rust.json-flatpak-org.gnome.Platform-43-x86_64-main/src && cp src/debug/test_rest src/test_rest
Note: I have placed <snip>
where needed to redact some details.