From 4094ac88e768a2cc91eb46bc546f418bab3be113 Mon Sep 17 00:00:00 2001 From: Radu Marias Date: Wed, 18 Dec 2024 17:15:11 +0200 Subject: [PATCH] Update Build_from_Source.md Signed-off-by: Radu Marias --- docs/readme/Build_from_Source.md | 35 +++++++++++++++++--------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/docs/readme/Build_from_Source.md b/docs/readme/Build_from_Source.md index 4b6189c..ab28a2a 100644 --- a/docs/readme/Build_from_Source.md +++ b/docs/readme/Build_from_Source.md @@ -1,35 +1,39 @@ # Build from source -## Browser +## In the browser If you want to give it a quick try and not setup anything locally, you can [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/radumarias/rencfs) [![Open Rustlings On Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new/?repo=radumarias%2Frencfs&ref=main) -You can compile it, run it, and give it a quick try in the browser. After you start it from above +You can compile, run, and try it quickly in the browser. After you start it from above ```bash apt-get update && apt-get install fuse3 curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -mkdir mnt && mkdir data -cargo run --release -- mount -m mnt -d data +mkdir final && mkdir data +cargo run --release -- mount -m final -d data ``` Open another terminal ```bash -cd mnt +cd final mkdir a && cd a echo "test" > test.txt cat test.txt ``` +You can also: +- Copy files and folders from your local machine to `tmp` folder in VSCode in the browser. So that we eliminate network errors when testing +- Then copy files and folders from `tmp` to `final` and then do your operations in the `final` folder +- Ensure files were copied successfully by right-clicking a file and then `Download...` and saving it to the local machine to ensure it opens correctly. For popular formats like image text, you can preview them in the browser editor + ## Locally -For now, the `FUSE` (`fuse3` crate) only works on `Linux`, so to start the project, you will need to be on Linux. -Instead, you can [Develop inside a Container](#developing-inside-a-container), which will start a local Linux container, the IDE will connect to it, -and you can build and start the app there and also use the terminal to test it. +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](#developing-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](https://harsimranmaan.medium.com/install-and-setup-rust-development-environment-on-wsl2-dccb4bf63700). ### Getting the sources @@ -42,25 +46,24 @@ git clone git@github.com:radumarias/rencfs.git && cd rencfs #### Rust -To build from source, you need to have Rust installed, you can see more details on how to install -it [here](https://www.rust-lang.org/tools/install). +To build from the source, you need to have Rust installed. You can see more details on installing it [here](https://www.rust-lang.org/tools/install). ```bash 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 +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 +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 add it to the `PATH` manually. +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 +Make sure to add this to your `$PATH` too. ```bash export PATH="$PATH::$HOME/.cargo/bin" @@ -119,7 +122,7 @@ If you don't want to be prompted for a password, you can set this env var and ru 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: +For dev mode, it is recommended to run with `DEBUG` log level: ```bash cargo run --release -- --log-level DEBUG mount --mount-point MOUNT_POINT --data-dir DATA_DIR @@ -149,4 +152,4 @@ sudo dnf localinstall rencfs-xxx.x86_64.rpm See here how to configure for [RustRover](https://www.jetbrains.com/help/rust/connect-to-devcontainer.html) and for [VsCode](https://code.visualstudio.com/docs/devcontainers/containers). You can use the `.devcontainer` directory from the project to start a container with all the necessary tools to build -and run the app. \ No newline at end of file +and run the app.