Skip to content

Remove dependency on memoffset for target_os = "windows" - #361

Merged
jschanck merged 1 commit into
mozilla:ctap2-2021from
syberant:ctap2-2021
Aug 17, 2026
Merged

Remove dependency on memoffset for target_os = "windows"#361
jschanck merged 1 commit into
mozilla:ctap2-2021from
syberant:ctap2-2021

Conversation

@syberant

@syberant syberant commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Hi, thanks for firefox!
I'm going down the list of reverse dependencies on memoffset.

This PR aims to remove the memoffset crate from your dependencies.
core::mem::offset_of was stabilised in rustc 1.77.

The memoffset crate 0.9.1 says that

If you're using a rustc version greater or equal to 1.77,
this crate's offset_of!() macro simply forwards to core::mem::offset_of!().

I consider it very unlikely (see here) for any usage of the offset_of! macro to break but please check anyway.
I hope we can all enjoy the benefits of one less dependency :)


Your MSRV is unclear to me but this implies it's currently 1.90, maybe set it in Cargo.toml?
If that is correct this comment can also be followed up on.

`memoffset::offset_of!` was stabilised as `core::mem::offset_of!` in
rust 1.77

@jschanck jschanck left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks!

@jschanck
jschanck merged commit 1e9ffaf into mozilla:ctap2-2021 Aug 17, 2026
9 checks passed
@micolous

micolous commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

There are a couple of places in firefox-main where memoffset is used that probably aren't published on crates.io, so I opened a bug for removing those: https://bugzilla.mozilla.org/show_bug.cgi?id=2064304

With this dependency on memoffset 0.8 gone, we can also remove build/rust/memoffset, but we can handle that next time we sync this library across.

Thanks for flagging this!

micolous added a commit to micolous/firefox that referenced this pull request Aug 18, 2026
This also removes `memoffset v0.8.999`, as this was removed in
mozilla/authenticator-rs#361

Differential Revision: https://phabricator.services.mozilla.com/D318670
micolous added a commit to micolous/firefox that referenced this pull request Aug 18, 2026
* Implement `CtapVersionSupport` trait for `TestToken`:
  mozilla/authenticator-rs#370

* Remove local version of `memoffset v0.8.999`, dependency removed in
  mozilla/authenticator-rs#361

Differential Revision: https://phabricator.services.mozilla.com/D318670
micolous added a commit to micolous/firefox that referenced this pull request Aug 19, 2026
* Implement `CtapVersionSupport` trait for `TestToken`:
  mozilla/authenticator-rs#370

* Make `TestToken` explicitly treat a version parameter as "this version and
  lower".

* Remove local version of `memoffset v0.8.999`, dependency removed in
  mozilla/authenticator-rs#361

Differential Revision: https://phabricator.services.mozilla.com/D318670
micolous added a commit to micolous/firefox that referenced this pull request Aug 20, 2026
* Implement `CtapVersionSupport` trait for `TestToken`:
  mozilla/authenticator-rs#370

* `TestToken` now treats a version parameter as "this version and lower".

* Remove local version of `memoffset v0.8.999`, dependency removed in
  mozilla/authenticator-rs#361

Differential Revision: https://phabricator.services.mozilla.com/D318670
micolous added a commit to micolous/firefox that referenced this pull request Sep 4, 2026
* Implement `CtapVersionSupport` trait for `TestToken`:
  mozilla/authenticator-rs#370

* `TestToken` now treats a version parameter as "this version and lower".

* Remove local version of `memoffset v0.8.999`, dependency removed in
  mozilla/authenticator-rs#361

Differential Revision: https://phabricator.services.mozilla.com/D318670
micolous added a commit to micolous/firefox that referenced this pull request Sep 4, 2026
* Implement `CtapVersionSupport` trait for `TestToken`:
  mozilla/authenticator-rs#370

* `TestToken` now treats a version parameter as "this version and lower".

* For CTAP 2.1 virtual authenticators, implement `makeCredUvNotRqd`.

* Handle the presence or absence of `makeCredUvNotRqd` in `MakeCredential`.

* For CTAP >= 2.0 virtual authenticators, treat user verification as "not
  supported" when resident key support is not available.

* Remove local version of `memoffset v0.8.999`, dependency removed in
  mozilla/authenticator-rs#361

Differential Revision: https://phabricator.services.mozilla.com/D318670
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.

3 participants