Attention is currently required from: Peter Marheine, Richard Hughes, Sergii Dmytruk.
Anastasia Klimchuk has posted comments on this change by Anastasia Klimchuk. ( https://review.coreboot.org/c/flashrom/+/86031?usp=email )
Change subject: libflashrom: Update the API for progress callback ......................................................................
Patch Set 5:
(2 comments)
File include/libflashrom.h:
https://review.coreboot.org/c/flashrom/+/86031/comment/53344892_d198fc7e?usp... : PS2, Line 90: * @deprecated Use flashrom_set_progress_callback_v1 instead I wrote all the code to handle two callbacks, with v2 callback having priority (still have the code locally). But then I realised there is one line which is not backwards compatible and I don't want to change it back :\
Apart from v2 API being easier to use, there is one more point: in old API client needed to own progress state and allocate memory for it, which doesn't seem right. user_data is fine, but entire progress state should not be owned by the client.
So I changed progress_state in flash context not to be a pointer anymore... which breaks the clever way of using old API by keeping the pointer in global state.
line 70 in base version of libflashrom.c is not possible to do anymore.
It depends on how stable the API is supposed to be.
I was trying to recall conversations about this, because I don't know whether there were any official promises. I don't see promises in libflashrom.h, checked old website, nothing specific.
I found prior art: https://ticket.coreboot.org/issues/381 , so the versioning question was raised almost 3yr ago, and still open
So I can't find any promises about API being stable, but also don't want to return progress_state to a pointer owned by the client. I was fine to keep the old code and keep two callbacks , but now this situation with progress state seems too much.
I can also make a post on the mailing list (before or after this patch) to ask if there are users of old callback, and are they fine to rebuild with v2 ?
File libflashrom.c:
https://review.coreboot.org/c/flashrom/+/86031/comment/403329f0_7a32a590?usp... : PS5, Line 70: flashctx->progress_state = progress_state; This line is no longer possible , with the change in line 625 in include/flash.h