Bug 1869835 causes a 30 rust failures in profiler, such as error[E0308]: mismatched types --> tools/profiler/rust-api/src/gecko_bindings/glue.rs:48:13 | 45 | bindings::gecko_profiler_marker_schema_stream( | --------------------------------------------- arguments to this function are incorrect ... 48 | marker_name.len(), | ^^^^^^^^^^^^^^^^^ expected `u64`, found `usize` | note: function defined here --> /export/home/gweiss/git/oi-userland/components/web/firefox-nightly/build/amd64/x86_64-unknown-illumos/release/build/gecko-profiler-ece8308022eff4f3/out/gecko/bindings.rs:2160:16 | 2160 | pub fn gecko_profiler_marker_schema_stream( | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can convert a `usize` to a `u64` and panic if the converted value doesn't fit | 48 | marker_name.len().try_into().unwrap(), | ++++++++++++++++++++ Ugly hack: change the usage of *.len() and *.size() to a value of 0 so the into() typecast is not used. Is there a better approach? These changes add no new regressions since the profiler is not functional on solaris/illumos. --- gecko-dev-a46c21ec5559b6d1ac96fcb95bff6885a10bbf99/tools/profiler/rust-api/src/marker/mod.rs.old 2023-12-30 22:31:20.883339696 -0500 +++ gecko-dev-a46c21ec5559b6d1ac96fcb95bff6885a10bbf99/tools/profiler/rust-api/src/marker/mod.rs 2023-12-30 22:38:02.985498740 -0500 @@ -141,7 +141,7 @@ unsafe { bindings::gecko_profiler_add_marker_untyped( name.as_ptr() as *const c_char, - name.len(), + 0, category.to_cpp_enum_value(), options.timing.0.as_mut_ptr(), options.stack, @@ -165,12 +165,12 @@ unsafe { bindings::gecko_profiler_add_marker_text( name.as_ptr() as *const c_char, - name.len(), + 0, category.to_cpp_enum_value(), options.timing.0.as_mut_ptr(), options.stack, text.as_ptr() as *const c_char, - text.len(), + 0, ) } } @@ -238,13 +238,13 @@ unsafe { bindings::gecko_profiler_add_marker( name.as_ptr() as *const c_char, - name.len(), + 0, category.to_cpp_enum_value(), options.timing.0.as_mut_ptr(), options.stack, maker_tag, encoded_payload.as_ptr(), - payload_size, + 0, ) } } --- gecko-dev-a46c21ec5559b6d1ac96fcb95bff6885a10bbf99/tools/profiler/rust-api/src/gecko_bindings/glue.rs.old 2023-12-30 23:21:15.908237461 -0500 +++ gecko-dev-a46c21ec5559b6d1ac96fcb95bff6885a10bbf99/tools/profiler/rust-api/src/gecko_bindings/glue.rs 2023-12-30 23:22:12.089536055 -0500 @@ -45,7 +45,7 @@ bindings::gecko_profiler_marker_schema_stream( json_writer, marker_name.as_ptr() as *const c_char, - marker_name.len(), + 0, marker_schema.pin.deref_mut().as_mut_ptr(), streamed_names_set, ) --- gecko-dev-a46c21ec5559b6d1ac96fcb95bff6885a10bbf99/tools/profiler/rust-api/src/json_writer.rs.old 2023-12-30 23:21:24.859312575 -0500 +++ gecko-dev-a46c21ec5559b6d1ac96fcb95bff6885a10bbf99/tools/profiler/rust-api/src/json_writer.rs 2023-12-30 23:24:29.966038626 -0500 @@ -26,7 +26,7 @@ bindings::gecko_profiler_json_writer_int_property( self.0, name.as_ptr() as *const c_char, - name.len(), + 0, value, ); } @@ -39,7 +39,7 @@ bindings::gecko_profiler_json_writer_float_property( self.0, name.as_ptr() as *const c_char, - name.len(), + 0, value, ); } @@ -52,7 +52,7 @@ bindings::gecko_profiler_json_writer_bool_property( self.0, name.as_ptr() as *const c_char, - name.len(), + 0, value, ); } @@ -65,9 +65,9 @@ bindings::gecko_profiler_json_writer_string_property( self.0, name.as_ptr() as *const c_char, - name.len(), + 0, value.as_ptr() as *const c_char, - value.len(), + 0, ); } } @@ -79,9 +79,9 @@ bindings::gecko_profiler_json_writer_unique_string_property( self.0, name.as_ptr() as *const c_char, - name.len(), + 0, value.as_ptr() as *const c_char, - value.len(), + 0, ); } } @@ -93,7 +93,7 @@ bindings::gecko_profiler_json_writer_null_property( self.0, name.as_ptr() as *const c_char, - name.len(), + 0, ); } } --- gecko-dev-a46c21ec5559b6d1ac96fcb95bff6885a10bbf99/tools/profiler/rust-api/src/marker/schema.rs.~1~ 2023-12-28 08:30:04.000000000 -0500 +++ gecko-dev-a46c21ec5559b6d1ac96fcb95bff6885a10bbf99/tools/profiler/rust-api/src/marker/schema.rs 2023-12-30 23:26:17.780323568 -0500 @@ -39,7 +39,7 @@ bindings::gecko_profiler_construct_marker_schema( marker_schema.deref_mut().as_mut_ptr(), locations.as_ptr(), - locations.len(), + 0, ); } MarkerSchema { pin: marker_schema } @@ -66,7 +66,7 @@ bindings::gecko_profiler_marker_schema_set_chart_label( self.pin.deref_mut().as_mut_ptr(), label.as_ptr() as *const c_char, - label.len(), + 0, ); } self @@ -81,7 +81,7 @@ bindings::gecko_profiler_marker_schema_set_tooltip_label( self.pin.deref_mut().as_mut_ptr(), label.as_ptr() as *const c_char, - label.len(), + 0, ); } self @@ -96,7 +96,7 @@ bindings::gecko_profiler_marker_schema_set_table_label( self.pin.deref_mut().as_mut_ptr(), label.as_ptr() as *const c_char, - label.len(), + 0, ); } self @@ -111,7 +111,7 @@ bindings::gecko_profiler_marker_schema_set_all_labels( self.pin.deref_mut().as_mut_ptr(), label.as_ptr() as *const c_char, - label.len(), + 0, ); } self @@ -134,7 +134,7 @@ bindings::gecko_profiler_marker_schema_add_key_format( self.pin.deref_mut().as_mut_ptr(), key.as_ptr() as *const c_char, - key.len(), + 0, format, ); } @@ -150,9 +150,9 @@ bindings::gecko_profiler_marker_schema_add_key_label_format( self.pin.deref_mut().as_mut_ptr(), key.as_ptr() as *const c_char, - key.len(), + 0, label.as_ptr() as *const c_char, - label.len(), + 0, format, ); } @@ -172,7 +172,7 @@ bindings::gecko_profiler_marker_schema_add_key_format_searchable( self.pin.deref_mut().as_mut_ptr(), key.as_ptr() as *const c_char, - key.len(), + 0, format, searchable, ); @@ -197,9 +197,9 @@ bindings::gecko_profiler_marker_schema_add_key_label_format_searchable( self.pin.deref_mut().as_mut_ptr(), key.as_ptr() as *const c_char, - key.len(), + 0, label.as_ptr() as *const c_char, - label.len(), + 0, format, searchable, ); @@ -215,9 +215,9 @@ bindings::gecko_profiler_marker_schema_add_static_label_value( self.pin.deref_mut().as_mut_ptr(), label.as_ptr() as *const c_char, - label.len(), + 0, value.as_ptr() as *const c_char, - value.len(), + 0, ); } self