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

[Final Submission]: enhancement of embedded Rust libraries (testing) #1918

Merged
merged 6 commits into from
May 6, 2022

Conversation

joloev
Copy link

@joloev joloev commented May 6, 2022

Assignment Proposal

Title

Contributing to Rust Embedded ecosystem to improve developers experience. Submission on proposal #1587.

Names and KTH ID

Deadline

Task 1

Category

Contribution to open-source

Description

As anyone would say, Rust is hot 😉. The Rust Embedded ecosystem is also blooming to provide support to embedded platforms. For example The Knurling project is an open source project to automate Rust Embedded development by providing Rust-native level of support.

In Knurling

  • probe-run is a custom runner to use Rust on embedded devices.
  • defmt provides an effective logger for testing
  • flip-link offers stack protection. When sensitive memory regions are reached, compilation fails instead of undefined behaviour.

flip-link needs some enhancements to improve developper experience:
rust-lld is a linker for GNU files. flip-link should accept the same files as rust-lld. Currently, some memory.x files (describing the memory) are not accepted by flip-link while being accepted by rust-lld. Meaning that developers must updates files by hand if they are incorrect.

This OSS contribution fits in CI/Testing as it automates necessary work that was precedently done manually (i.e. a human needed to check if files were formatted correctly to avoid failure), and support for testing programs.

  1. We added in total 7 tests to manage input that is currently accepted by rust lld, to make flip-link more resilient.
    Target PR

  2. Fixed a bug about arithmetic operations handled incorrectly:
    Issue #65 Easy bug

Self-assessment

Yes No
bug: The contribution fixes bugs Yes
documentation: The contribution improves documentation Yes*
feat: The contribution adds new features Yes
difficulty: The contribution is a difficult piece of engineering Yes**
conversation: There is an interesting engineering conversation with the maintainers Yes
merge: The contribution is merged in the main branch. Yes

* Added documentation on the components.

** It is quite a hefty code base that we needed to dive in.
The change we got merged was not a difficult piece of engineering, more code reformatting. But understand and rewrite a parser is more challenging.

@joloev
Copy link
Author

joloev commented May 6, 2022

Further to our discussion on PR 1673, we wish to change our submission to final submission.

The reason is that we reached our final goal (make a contribution, fixing a bug and writing tests).
But during the discussion with the Knurling team, it was identified that doing a recursive lexer and parser would be better for the project as a whole.

While the original goal is completed, this remains a work in progress to which we contribute, outside the scope of this course. For example, we finished writing the lexer, and are working on the parser.

Please note we finished this work within deadline of TASK 1, the only reason we resubmit it is because we miss a point for it and correct labels (final submission and contribution_to_open_source) on the original, already mergead PR # 1673.

@cesarsotovalero cesarsotovalero self-requested a review May 6, 2022 12:42
@cesarsotovalero cesarsotovalero self-assigned this May 6, 2022
@cesarsotovalero cesarsotovalero added final_submission The final submission of a task contribution_to_opensource One of the task categories listed in README.md labels May 6, 2022
@cesarsotovalero
Copy link

Hi @joloev, thanks for this excellent contribution to open-source 🎉

@cesarsotovalero cesarsotovalero merged commit 2d11db3 into KTH:2022 May 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution_to_opensource One of the task categories listed in README.md final_submission The final submission of a task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants