crusts 0.0.1

CRustS - From Unsafe C to safer Rust
crusts-0.0.1 is not a library.

CRustS - Transpiling Unsafe C code to Safe Rust

Installation

# install c2rust
if [ $(uname -s) == "Darwin" ]; then
   git clone https://github.com/immunant/c2rust 
   cd c2rust
   scripts/provision_mac.sh
   cargo build --release
   cp target/release/c2rust $HOME/.cargo/bin
   cp target/release/c2rust-transpile $HOME/.cargo/bin
   cp target/release/c2rust-analyze $HOME/.cargo/bin
   cp target/release/c2rust-instrument $HOME/.cargo/bin
   brew install bear
   export PATH=$HOME/.local/bin:$HOME/.cargo/bin:$PATH
   cargo install crusts
elif [ $(uname -s) == "Linux" ]; then
   cargo install c2rust
   apt-get install bear
   export PATH=$HOME/.local/bin:$HOME/.cargo/bin:$PATH
   cargo install crusts
else
   docker pull yijun/crusts
fi

Usage:

Run crusts in the folder where there is a Makefile.

crusts

or

docker run -v $(pwd):/mnt -t yijun/crusts

As a result, Rust code will be generated from the C code:

src/*.rs -- contains the refactored Rust code from the C code;
build.rs lib.rs -- contains the builder Rust code;

Update

  • integrate with TXL
  • integrate with docker