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

[FEAT] Port all the common_* files, teletext and networking portions of libccx to rust #1495

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

elbertronnie
Copy link
Contributor

@elbertronnie elbertronnie commented Mar 12, 2023

In raising this pull request, I confirm the following (please check boxes):

  • I have read and understood the contributors guide.
  • I have checked that another pull request for this purpose does not exist.
  • I have considered, and confirmed that this submission will be valuable to others.
  • I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
  • I give this submission freely, and claim no ownership to its content.
  • I have mentioned this change in the changelog.

My familiarity with the project is as follows (check one):

  • I have never used CCExtractor.
  • I have used CCExtractor just a couple of times.
  • I absolutely love CCExtractor, but have not contributed previously.
  • I am an active contributor to CCExtractor.

This PR aims to port most of the functions in files common_* , teletext.h, telxcc.c, networking.c and certain parts of utility.c (such as logging) to rust. Certain parts of the codebase is left blank if they are dependant on some code which this PR has not aimed to convert. Such parts will have to be revisited once their dependencies are also converted to rust.

I have placed the new rust code inside a new crate named as lib_ccxr, which is a normal rust library crate. This was because a static library crate does not allow doctests. This would also help in seperating ffi code to idiomatic Rust code. Since the Rust approach and C approach to solve a problem are very different, there are 3 layers of indirection I have used for porting:

1. The C-FFI layer

This layers will have function names same as defined in C but with the prefix of ccxr_. These functions will handle the conversion between C-native types and Rust-native types and then pass it on to the C-like Rust layer. These are the functions defined in the ccx_rust crate under libccxr_exports module.

2. The C-like Rust layer

This layer will have function names same as defined in C but work with Rust-native types. The code written using these functions would still be procedural but in Rust, hence the name C-like Rust. The entire task of these functions will be to translate the procedural code to idiomatic Rust code. These are the functions defined in the c_functions.rs file in appropriate modules inside the lib_ccxr crate.

3. The Idiomatic Rust layer

This layer will be the code written as one is supposed to write in idiomatic Rust. It will have complete documentation and tests. This code will will be situated in the lib_ccxr crate.

@elbertronnie elbertronnie force-pushed the port-utility-to-rust branch 3 times, most recently from 3ddd353 to 9db7b1c Compare March 12, 2023 10:56
@elbertronnie elbertronnie changed the title [WIP] Port utility.c to rust [WIP] Port all the common_* files and teletext portions of libccx to rust Aug 25, 2023
@elbertronnie elbertronnie changed the title [WIP] Port all the common_* files and teletext portions of libccx to rust [WIP] Port all the common_* files, teletext and networking portions of libccx to rust Aug 25, 2023
@elbertronnie elbertronnie changed the title [WIP] Port all the common_* files, teletext and networking portions of libccx to rust [FEAT] Port all the common_* files, teletext and networking portions of libccx to rust Aug 25, 2023
@elbertronnie elbertronnie marked this pull request as ready for review August 25, 2023 12:51
@elbertronnie elbertronnie force-pushed the port-utility-to-rust branch 5 times, most recently from 16bd519 to 3c1d56b Compare August 25, 2023 19:27
@elbertronnie
Copy link
Contributor Author

@PunitLodha Can you review this PR?
I have split the PR into multiple meaningful commits, so that atleast each individual commit is easy to review.

@cfsmp3
Copy link
Contributor

cfsmp3 commented Aug 26, 2023

@PunitLodha Can you review this PR? I have split the PR into multiple meaningful commits, so that atleast each individual commit is easy to review.

Could you make each commit a separate PR? If you can't, that means each change is not correctly isolated from the rest.

We need each commit to be self-contained (at least don't break anything) and be reversible by itself - we don't want to merge a huge PR with lots of commits that must exist together.

(we're still paying for playing fast-and-loose in the past)

@ccextractor-bot
Copy link
Collaborator

CCExtractor CI platform finished running the test files on windows. Below is a summary of the test results:

Report Name Tests Passed
Broken 13/13
CEA-708 2/14
DVB 2/7
DVD 3/3
DVR-MS 2/2
General 22/27
Hauppage 3/3
MP4 3/3
NoCC 10/10
Options 81/87
Teletext 7/21
WTV 13/13
XDS 31/34

It seems that not all tests were passed completely. This is an indication that the output of some files is not as expected (but might be according to you).

Your PR breaks these cases:


Check the result page for more info.

@ccextractor-bot
Copy link
Collaborator

CCExtractor CI platform finished running the test files on linux. Below is a summary of the test results:

Report Name Tests Passed
Broken 13/13
CEA-708 2/14
DVB 4/7
DVD 3/3
DVR-MS 2/2
General 24/27
Hauppage 3/3
MP4 2/3
NoCC 10/10
Options 79/87
Teletext 21/21
WTV 1/13
XDS 26/34

It seems that not all tests were passed completely. This is an indication that the output of some files is not as expected (but might be according to you).

Your PR breaks these cases:


Check the result page for more info.

@elbertronnie
Copy link
Contributor Author

elbertronnie commented Aug 27, 2023

@PunitLodha @cfsmp3 I have tried to split this into multiple PRs: #1551, #1552, #1553, #1554, #1555, #1556, #1557, #1558, #1559, #1560.

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.

None yet

3 participants