Complete setup instructions for Windows, Linux, and macOS with C/Rust compilation support.
# Prerequisites: Install Rust
# https://rustup.rs/
# Install C compiler (choose one)
# Option 1: MinGW (recommended)
choco install mingw
# Option 2: MSVC (via Visual Studio)
# https://visualstudio.microsoft.com/
# Clone and build
git clone https://github.com/yourusername/rust-decompiler.git
cd rust-decompiler/rust_file_explorer
cargo build --release
# Run
.\target\release\rust_file_explorer.exe# Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
# Install C compiler
sudo apt update
sudo apt install build-essential gcc clang
# Clone and build
git clone https://github.com/yourusername/rust-decompiler.git
cd rust-decompiler/rust_file_explorer
cargo build --release
# Run
./target/release/rust_file_explorer# Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
# Install Xcode Command Line Tools
xcode-select --install
# Clone and build
git clone https://github.com/yourusername/rust-decompiler.git
cd rust-decompiler/rust_file_explorer
cargo build --release
# Run
./target/release/rust_file_explorer# Download and run rustup installer
# https://rustup.rs/
# Or use chocolatey:
choco install rustcurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/envcurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/envOption 1: MinGW (Recommended)
# Using Chocolatey
choco install mingw
# Verify installation
gcc --versionOption 2: MSVC (Microsoft Visual C++)
# Install Visual Studio Build Tools
# https://visualstudio.microsoft.com/downloads/
# Select "C++ build tools" during installation
# Verify installation
cl.exeOption 3: Clang
choco install llvm# GCC
sudo apt update
sudo apt install build-essential gcc
gcc --version
# Or Clang
sudo apt install clang
clang --version# GCC
sudo dnf install gcc make
# Or Clang
sudo dnf install clang# Xcode Command Line Tools (includes clang)
xcode-select --install
# Or via Homebrew
brew install gcc llvm
# Verify
clang --versiongit clone https://github.com/yourusername/rust-decompiler.git
cd rust-decompiler/rust_file_explorercargo buildcargo build --release
# Binary at: target/release/rust_file_explorer[.exe]cargo clean
cargo build --release# Run all tests
cargo test
# Run with output
cargo test -- --nocapture
# Run specific test
cargo test compilation_test
# Run tests in release mode
cargo test --release# Format code
cargo fmt
# Check formatting
cargo fmt -- --check
# Lint with clippy
cargo clippy -- -D warnings
# Generate documentation
cargo doc --openThe decompiler can compile generated C code:
use rust_file_explorer::cross_platform_compiler::{compile_c, detect_c_compilers};
// Detect available compilers
let compilers = detect_c_compilers();
// Compile C code
let result = compile_c(
Path::new("output.c"),
"O2" // Optimization level
);
if result.success {
println!("Compiled successfully: {:?}", result.executable_path);
} else {
eprintln!("Compilation failed: {}", result.errors);
}use rust_file_explorer::cross_platform_compiler::compile_rust;
let result = compile_rust(
Path::new("output.rs"),
"release" // Optimization level
);
if result.success {
println!("Compiled: {:?}", result.executable_path);
}Firewall Issues:
- Compilation may require firewall access for first-time build
- Allow
cargo.exeand compiler access if prompted
Path Issues:
- Use absolute paths or ensure proper escaping
- Environment variables should be set in PowerShell/CMD
Linker Errors:
- Ensure C compiler is in PATH
- Restart terminal after compiler installation
- Use
where gccto verify compiler is accessible
GCC Not Found:
# Check if gcc is in PATH
which gcc
# If not, add to PATH
export PATH=$PATH:/usr/binPermission Issues:
# Ensure binary is executable
chmod +x target/release/rust_file_explorer
# Run with appropriate permissions
./target/release/rust_file_explorerGTK Dependencies (if using GUI):
sudo apt install libgtk-3-devXcode Acceptance:
# Accept Xcode license
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -license acceptHomebrew Packages:
# If compilation fails, try Homebrew versions
brew install gcc
brew install llvmM1/ARM Macs:
# Ensure correct architecture
rustup target add aarch64-apple-darwin
# Build for ARM
cargo build --target aarch64-apple-darwinWindows:
# Reinstall MinGW
choco uninstall mingw
choco install mingwLinux:
sudo apt install g++ build-essential# Check Rust installation
rustc --version
cargo --version
# Update Rust
rustup update
# Add to PATH if needed
export PATH="$HOME/.cargo/bin:$PATH"-
Verify compiler installation:
gcc --version clang --version
-
Check PATH:
# Windows echo %PATH% # Linux/macOS echo $PATH
-
Reinstall compiler if needed
Reduce parallelism:
cargo build -j 2chmod +x target/release/rust_file_explorer
sudo ./target/release/rust_file_explorerVS Code:
- Install "Rust Analyzer" extension
- Install "CodeLLDB" for debugging
- Create
.vscode/launch.json:
{
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Debug",
"cargo": {
"args": ["build"],
"filter": {
"name": "rust_file_explorer",
"kind": "bin"
}
},
"args": [],
"cwd": "${workspaceFolder}"
}
]
}JetBrains IntelliJ IDEA:
- Install "Rust" plugin
- Install "TOML" plugin
- Open project in IDE
Vim/Neovim:
# Install rust-analyzer
rustup component add rust-analyzer
# Install completion plugin
# (see your specific plugin manager)Set up pre-commit hooks:
# Create .git/hooks/pre-commit
#!/bin/bash
set -e
echo "Running fmt..."
cargo fmt -- --check
echo "Running clippy..."
cargo clippy -- -D warnings
echo "Running tests..."
cargo test
echo "All checks passed!"Make it executable:
chmod +x .git/hooks/pre-commit# Faster incremental builds
cargo build -j 4
# Use sccache for caching
cargo install sccache
export RUSTC_WRAPPER=sccache
cargo build --releaseEdit Cargo.toml:
[profile.release]
opt-level = 3
lto = true
codegen-units = 1- Fork repository
- Clone your fork
- Create feature branch:
git checkout -b feature/name - Make changes
- Run:
cargo fmt && cargo clippy && cargo test - Push and create Pull Request
See CONTRIBUTING.md for detailed guidelines.
- Documentation: See docs/ directory
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Read README.md for features overview
- Check Quick Start
- Review Contributing Guidelines
- Start using or contributing!