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

Improvement: Integrate rust Miri into S-CORE Bazel Build System #134

Open
4 tasks
nradakovic opened this issue Dec 19, 2024 · 0 comments
Open
4 tasks

Improvement: Integrate rust Miri into S-CORE Bazel Build System #134

nradakovic opened this issue Dec 19, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request infrastructure General Score infrastructure topics

Comments

@nradakovic
Copy link
Contributor

nradakovic commented Dec 19, 2024

Background

Miri is a powerful tool for detecting undefined behavior in Rust code by executing it in an interpreter with additional checks. Integrating Miri into our workflow would significantly improve code quality and safety by catching subtle bugs that might otherwise go unnoticed. However, since we use Bazel for our build system, integrating Miri might require changes to rules_rust to support Miri properly.

Objectives

  • Integrate the Miri undefined behavior detection tool into our Bazel build system.
  • Ensure seamless execution of Miri checks within our existing Bazel workflow.
  • Upstream necessary changes to rules_rust to facilitate broader community use and maintenance.
  • Document the integration process and usage instructions for developers.

Acceptance Criteria

  • Miri can be invoked within the Bazel build system to run undefined behavior checks on Rust targets.
  • Necessary changes to rules_rust are upstreamed and accepted by the maintainers.
  • CI pipeline includes Miri checks for relevant Rust code as part of quality assurance.
  • Documentation provides clear instructions for developers to use Miri locally and interpret its output.

Proposed Steps

  1. Research and Feasibility Study:
    • Understand Miri's requirements and behavior when integrated with Bazel.
    • Evaluate the current state of rules_rust and identify gaps in supporting Miri.
  2. Prototype Integration:
    • Develop a prototype to integrate Miri into Bazel for local usage.
    • Test the integration with a subset of Rust targets to ensure compatibility.
  3. Upstream Changes:
    • Prepare and submit patches or pull requests to rules_rust to add Miri support.
    • Collaborate with the rules_rust maintainers to review and merge changes.
  4. CI Integration:
    • Add Miri checks to the CI pipeline for relevant Rust codebases.
    • Ensure the CI environment is configured to run Miri efficiently.
  5. Documentation:
    • Write detailed developer-facing instructions for using Miri locally.
    • Include troubleshooting steps and guidelines for interpreting Miri output.
  6. Validation and Rollout:
    • Validate the integration with all Rust targets in the project.
    • Announce the availability of Miri within the team and encourage adoption.

Resources

Miri Documentation
rules_rust GitHub Repository
Bazel Documentation
Rust Language Reference

Impact

Integrating Miri into the Bazel build system will provide early detection of undefined behavior in Rust code, reducing the risk of subtle bugs in production. Upstreaming support to rules_rust will benefit the broader Rust and Bazel communities, ensuring long-term maintainability and fostering collaboration. This initiative will enhance overall code safety, robustness, and developer confidence.

NOTE: This ticket is part (subtask) of #36

@ltekieli ltekieli added the infrastructure General Score infrastructure topics label Jan 8, 2025
@nradakovic nradakovic added the enhancement New feature or request label Jan 16, 2025
@nradakovic nradakovic self-assigned this Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request infrastructure General Score infrastructure topics
Projects
None yet
Development

No branches or pull requests

2 participants