Building from source
Trying to build a package from source got some errors.
Rust 1.61
First when building a package
[ 909s] Compiling amberol v0.1.0 (/home/abuild/rpmbuild/BUILD/amberol-0.8.0)
[ 911s] error[E0308]: mismatched types
[ 911s] --> src/waveform_view.rs:401:32
[ 911s] |
[ 911s] 401 | click_gesture.set_name("waveform-click");
[ 911s] | ^^^^^^^^^^^^^^^^ expected enum `std::option::Option`, found `&str`
[ 911s] |
[ 911s] = note: expected enum `std::option::Option<&str>`
[ 911s] found reference `&'static str`
[ 911s] help: try wrapping the expression in `Some`
[ 911s] |
[ 911s] 401 | click_gesture.set_name(Some("waveform-click"));
[ 911s] | +++++ +
[ 911s]
[ 911s] error[E0308]: mismatched types
[ 911s] --> src/waveform_view.rs:424:33
[ 911s] |
[ 911s] 424 | motion_gesture.set_name("waveform-motion");
[ 911s] | ^^^^^^^^^^^^^^^^^ expected enum `std::option::Option`, found `&str`
[ 911s] |
[ 911s] = note: expected enum `std::option::Option<&str>`
[ 911s] found reference `&'static str`
[ 911s] help: try wrapping the expression in `Some`
[ 911s] |
[ 911s] 424 | motion_gesture.set_name(Some("waveform-motion"));
[ 911s] | +++++ +
[ 911s]
[ 912s] error[E0308]: mismatched types
[ 912s] --> src/waveform_view.rs:438:33
[ 912s] |
[ 912s] 438 | key_controller.set_name("waveform-key");
[ 912s] | ^^^^^^^^^^^^^^ expected enum `std::option::Option`, found `&str`
[ 912s] |
[ 912s] = note: expected enum `std::option::Option<&str>`
[ 912s] found reference `&'static str`
[ 912s] help: try wrapping the expression in `Some`
[ 912s] |
[ 912s] 438 | key_controller.set_name(Some("waveform-key"));
[ 912s] | +++++ +
[ 912s]
[ 912s] For more information about this error, try `rustc --explain E0308`.
ok i made a patch
diff --color -ru a/src/waveform_view.rs b/src/waveform_view.rs
--- a/src/waveform_view.rs 2022-06-23 10:47:07.962635000 +0600
+++ b/src/waveform_view.rs 2022-06-23 14:30:11.741484087 +0600
@@ -398,7 +398,7 @@
fn setup_gesture(&self) {
let click_gesture = gtk::GestureClick::new();
- click_gesture.set_name("waveform-click");
+ click_gesture.set_name(Some("waveform-click"));
click_gesture.set_button(0);
click_gesture.connect_pressed(
clone!(@strong self as this => move |gesture, n_press, x, _| {
@@ -421,7 +421,7 @@
self.add_controller(&click_gesture);
let motion_gesture = gtk::EventControllerMotion::new();
- motion_gesture.set_name("waveform-motion");
+ motion_gesture.set_name(Some("waveform-motion"));
motion_gesture.connect_motion(clone!(@strong self as this => move |_, x, _| {
let width = this.width() as f64;
let position = x as f64 / width;
@@ -435,7 +435,7 @@
self.add_controller(&motion_gesture);
let key_controller = gtk::EventControllerKey::new();
- key_controller.set_name("waveform-key");
+ key_controller.set_name(Some("waveform-key"));
key_controller.connect_key_released(
clone!(@strong self as this => move |_, keyval, _, _| {
let delta = match keyval {
Package build completed without errors Began to run
thread 'main' panicked at 'Template child with id `volume_high_image` has incompatible type. XML has GtkImage, struct has GtkScale', src/volume_control.rs:13:30
stack backtrace:
0: 0x5563ef2c253c - <unknown>
1: 0x5563ef2e143e - <unknown>
2: 0x5563ef2abd71 - <unknown>
3: 0x5563ef2aeb25 - <unknown>
4: 0x5563ef2ae7d9 - <unknown>
5: 0x5563ef2af16f - <unknown>
6: 0x5563ef2c2877 - <unknown>
7: 0x5563ef2c2654 - <unknown>
8: 0x5563ef2aec82 - <unknown>
9: 0x5563eef87733 - <unknown>
10: 0x5563ef0ba87e - <unknown>
11: 0x5563eef90d61 - <unknown>
12: 0x7f7a67f9bec0 - g_type_create_instance
13: 0x7f7a67f7fff8 - <unknown>
14: 0x7f7a67f81511 - g_object_new_with_properties
15: 0x7f7a67f81f81 - g_object_new
16: 0x7f7a675bf771 - <unknown>
17: 0x7f7a675c314b - <unknown>
18: 0x7f7a675b686f - <unknown>
19: 0x7f7a675c4433 - <unknown>
20: 0x7f7a675b88ce - gtk_builder_extend_with_template
21: 0x7f7a677d399c - gtk_widget_init_template
22: 0x5563eef9136d - <unknown>
23: 0x7f7a67f9bec0 - g_type_create_instance
24: 0x7f7a67f7fff8 - <unknown>
25: 0x7f7a67f81511 - g_object_new_with_properties
26: 0x7f7a67f81f81 - g_object_new
27: 0x7f7a675bf771 - <unknown>
28: 0x7f7a675c314b - <unknown>
29: 0x7f7a675b686f - <unknown>
30: 0x7f7a675c4433 - <unknown>
31: 0x7f7a675b88ce - gtk_builder_extend_with_template
32: 0x7f7a677d399c - gtk_widget_init_template
33: 0x5563eef90bef - <unknown>
34: 0x7f7a67f9bec0 - g_type_create_instance
35: 0x7f7a67f7fff8 - <unknown>
36: 0x7f7a67f8184f - g_object_newv
37: 0x5563ef2999e0 - <unknown>
38: 0x5563ef2994ab - <unknown>
39: 0x5563eef8ef1d - <unknown>
40: 0x5563ef07d6bd - <unknown>
41: 0x5563ef08f232 - <unknown>
42: 0x7f7a67f7a7d9 - <unknown>
43: 0x7f7a67f93888 - g_signal_emit_valist
44: 0x7f7a67f93ddf - g_signal_emit
45: 0x7f7a671db778 - <unknown>
46: 0x5563ef08f7a7 - <unknown>
47: 0x7f7a671db906 - g_application_run
48: 0x5563ef04ae5e - <unknown>
49: 0x5563ef0a0acb - <unknown>
50: 0x5563eefecae3 - <unknown>
51: 0x5563ef042da9 - <unknown>
52: 0x5563ef2a88f1 - <unknown>
53: 0x5563ef0a0c62 - <unknown>
54: 0x7f7a66c755b0 - __libc_start_call_main
55: 0x7f7a66c75679 - __libc_start_main_alias_1
56: 0x5563eef879d5 - <unknown>
57: 0x0 - <unknown>
Hope you can help me figure it out