Build from source

In the browser

If you want to give it a quick try and not setup anything locally, you can
Open in Gitpod

Open Rustlings On Codespaces

You can compile, run, and try it quickly in the browser. After you start it from above

apt-get update && apt-get install fuse3
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
mkdir final && mkdir data
cargo run --release -- mount -m final -d data

Open another terminal

cd final
mkdir a && cd a
echo "test" > test.txt
cat test.txt

You can also:

Locally

For now, the FUSE (fuse3 crate) only works on Linux, so you must be on Linux to start the project. Instead, you can Develop inside a Container by starting a local Linux container to which the IDE will connect. You can build, run, and debug the app there and use the terminal to test it.
On Windows, you can start it in WSL.

Getting the sources

git clone git@github.com:radumarias/rencfs.git && cd rencfs

Dependencies

Rust

To build from the source, you need to have Rust installed. You can see more details on installing it here.

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Accordingly, it is customary for Rust developers to include this directory in their PATH environment variable. During installation, rustup will attempt to configure the PATH. Because of differences between platforms, command shells, and bugs in rustup, the modifications to PATH may not take effect until the console is restarted or the user is logged out, or it may not succeed at all.

If, after installation, running rustc --version in the console fails, this is the most likely reason. In that case, please manually add it to the PATH.

The project is set up to use the nightly toolchain in rust-toolchain. tool; on the first build, you will see it fetch the nightly.

Make sure to add this to your $PATH too.

export PATH="$PATH::$HOME/.cargo/bin"
cargo install cargo-aur
cargo install cargo-generate-rpm

Other dependencies

Also, these dependencies are required (or based on your distribution):

Arch

sudo pacman -Syu && sudo pacman -S fuse3 base-devel act

Ubuntu

sudo apt-get update && sudo apt-get install fuse3 build-essential act

Fedora

sudo dnf update && sudo dnf install fuse3 && dnf install @development-tools act

Build for debug

cargo build

Build release

cargo build --release

Run

cargo run --release -- mount --mount-point MOUNT_POINT --data-dir DATA_DIR

Dev settings

If you don’t want to be prompted for a password, you can set this env var and run it like this:

RENCFS_PASSWORD=PASS cargo run --release -- mount --mount-point MOUNT_POINT --data-dir DATA_DIR

For dev mode, it is recommended to run with DEBUG log level:

cargo run --release -- --log-level DEBUG mount --mount-point MOUNT_POINT --data-dir DATA_DIR

Build local RPM for Fedora

This is using cargo-generate-rpm

cargo install cargo-generate-rpm
cargo build --release
cargo generate-rpm

The generated RPM will be located here: target/generate-rpm.

Install and run local RPM

cd target/generate-rpm/
sudo dnf localinstall rencfs-xxx.x86_64.rpm

Developing inside a Container

See here how to configure for RustRover and for VsCode.

You can use the .devcontainer directory from the project to start a container with all the necessary tools to build and run the app.