Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating the Rust versions #5128

Merged
merged 1 commit into from
Sep 13, 2022
Merged

Updating the Rust versions #5128

merged 1 commit into from
Sep 13, 2022

Conversation

bendk
Copy link
Contributor

@bendk bendk commented Sep 12, 2022

This updates it to the min version used by Desktop nightly. I'm not sure if we should track nightly or release in our rust version, but I'm making this PR because I'm hoping it the coverage CI failures. Those are failing with:

error[E0658]: trait bounds other than `Sized` on const fn parameters are unstable

I wanted to update the max version to 1.63, but that leads to clippy errors because mozilla/uniffi-rs#1331 has not been released yet.

Pull Request checklist

  • Quality: This PR builds and tests run cleanly
    • Note:
      • For changes that need extra cross-platform testing, consider adding [ci full] to the PR title.
      • If this pull request includes a breaking change, consider cutting a new release after merging.
  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Changelog: This PR includes a changelog entry in CHANGES_UNRELEASED.md or an explanation of why it does not need one
    • Any breaking changes to Swift or Kotlin binding APIs are noted explicitly
  • Dependencies: This PR follows our dependency management guidelines
    • Any new dependencies are accompanied by a summary of the due dilligence applied in selecting them.

Branch builds: add [ac: android-components-branch-name] and/or [fenix: fenix-branch-name] to the PR title.

@mhammond
Copy link
Member

See also #5114 :)

@bendk bendk force-pushed the rust-version branch 8 times, most recently from e9275ac to f27bac0 Compare September 13, 2022 16:02
@bendk
Copy link
Contributor Author

bendk commented Sep 13, 2022

@mhammond Thanks for pointing that out, I completely missed it.

I just released a new UniFFI version today so I think we can bump both the major and minor Rust versions. I also copied some code from Mark's branch.

I think this one might be ready to merge the main differences between this and update-rust are:

  • Updated UniFFI to 0.20.0
  • I kept the signature of the logins::import_multiple() function the same. I think Kotlin is still expecting a string return and didn't want to make a change there.
  • I chose to add more Eq derives rather than adding clippy allows. I don't have a strong feeling about this either way though.
  • I added an [allow(dead_code)] to components/support/nimbus-fml/src/intermediate_representation.rs rather than removing the module_id field. I'm not sure what's best here, I just didn't feel comfortable changing the nimbus code.

Copy link
Contributor

@tarikeshaq tarikeshaq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, but i'd leave it to @mhammond to verify this makes sense given his other PR!

pub(crate) struct ImportedModule<'a> {
#[allow(dead_code)]
pub(crate) id: ModuleId,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmmm @jhugman would it be okay to get rid of this?

let metrics = self.db.lock().import_multiple(logins, &encdec)?;
Ok(serde_json::to_string(&metrics)?)
self.db.lock().import_multiple(logins, &encdec)?;
Ok(serde_json::to_string(&())?)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we add a comment here, it looks a little unconventional

Copy link
Member

@mhammond mhammond left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • I kept the signature of the logins::import_multiple() function the same. I think Kotlin is still expecting a string return and didn't want to make a change there.

Yeah - I misread the kotlin code here - I'm sure that result is still being dropped on the floor though, so we should consider getting an issue on file to kill this - maybe a good-first.

  • I chose to add more Eq derives rather than adding clippy allows. I don't have a strong feeling about this either way though.

Yeah, I just got sick of it :)

  • I added an [allow(dead_code)] to components/support/nimbus-fml/src/intermediate_representation.rs rather than removing the module_id field. I'm not sure what's best here, I just didn't feel comfortable changing the nimbus code.

Like the Kotlin issue above, I was just trying to be aggressive because I think it's safe to assume that field was a mistake - if it was intentional I'd expect a comment. But yeah, totally fine with this and hopefully Nimbus treats that dead_code annotation as a smell.

Copy link
Contributor

@lougeniaC64 lougeniaC64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

This matches the nightly versions for FF desktop.
@rvandermeulen
Copy link
Contributor

@bendk Should this be added to the changelog?

@bendk
Copy link
Contributor Author

bendk commented Sep 19, 2022

Good catch, it probably should. #5149

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants