uefi-rs icon indicating copy to clipboard operation
uefi-rs copied to clipboard

Feature Request: Regular Expression Protocol

Open d-sonuga opened this issue 3 years ago • 10 comments

I would like to add support for the regular expression protocol, but I would like to know if I should be concerned with issue #554 and wait for its resolution before continuing.

d-sonuga avatar Nov 14 '22 11:11 d-sonuga

Additionally, just as a hint, I'd like to inform you that you might want to wait until #566 and #561 are solved/merged. Otherwise, you will run into merge conflicts.

I expect/hope that we merge those changes in the next couple of days.

phip1611 avatar Nov 14 '22 11:11 phip1611

Alright. Thanks

d-sonuga avatar Nov 14 '22 12:11 d-sonuga

It was not my intention that you close the issue. You can keep it open and we'd love to see a contribution soon :) @d-sonuga

phip1611 avatar Nov 14 '22 14:11 phip1611

Re #554, you should feel free to go ahead and implement the protocol. I don't intend for that issue to block anyone, since we'll need to audit all the existing uses anyway.

nicholasbishop avatar Nov 15 '22 22:11 nicholasbishop

Thanks @nicholasbishop . I'll go ahead then.

d-sonuga avatar Nov 16 '22 09:11 d-sonuga

Hey, I implemented the protocol, but it seems like the protocol isn't supported at all.

I attempted to start testing like this:

`

info!("Running regex protocol test");
let handle = bt.find_handles::<Regex>().expect("No Regular Expression handles");
info!("Handles!: {:?}", handle);

`

When I run this, it panics with a "No Regular Expression handles". Is there another way of testing this?

d-sonuga avatar Apr 30 '23 09:04 d-sonuga

Confirmed, seems like although there's some code for the regular expressions in EDK2, it's not exposed in OVMF currently.

You could check on real hardware to see if anything you have supports it, but as far as CI goes we won't be able to test it.

That said, we can still add the protocol to uefi-rs even if we don't have a way to test it automatically yet.

nicholasbishop avatar Apr 30 '23 20:04 nicholasbishop

Unrelated question: Why would one want to use the regular expression protocol in a Rust application when there are no_std regex crates? The implementation of those is probably much more nature.

phip1611 avatar May 02 '23 20:05 phip1611

I imagine most Rust regex crates are UTF-8, whereas this protocol uses CHAR16* strings. So using the protocol, if it were available, would potentially avoid having to convert between encodings.

nicholasbishop avatar May 02 '23 20:05 nicholasbishop

Ah yes, right.

phip1611 avatar May 03 '23 05:05 phip1611