Overview
Building Timo from source gives you access to the latest development version and allows you to customize the application for your needs. This guide covers everything from prerequisites to troubleshooting.Prerequisites
Before building Timo, ensure you have the required tools installed.Rust Toolchain
Timo requires Rust 2021 edition or later.Install Rust
Install Rust using rustup (recommended method):Follow the on-screen instructions to complete the installation.
Verify Installation
Confirm Rust and Cargo are installed:You should see version numbers for both commands.
System Requirements
Operating System
- Linux (any distribution)
- macOS 10.13 or later
- Windows 10 or later
Development Tools
- Git for cloning the repository
- C compiler (for SQLite bundled build)
- Internet connection for dependencies
Building Timo
Clone the Repository
Clone the Timo repository from GitHub:This downloads the complete source code including all dependencies defined in
Cargo.toml.Build the Project
Build Timo in release mode for optimal performance:This will:
- Download and compile all dependencies (clap, rusqlite, refinery, colored, dirs, dotenv)
- Build a bundled SQLite library
- Compile Timo with optimizations
- Create the binary in
target/release/timo
The first build will take longer as it downloads and compiles dependencies. Subsequent builds will be faster.
Installing Timo
After building, install Timo globally to use it from anywhere.- Cargo Install
- Manual Install
Install directly using Cargo (recommended):This installs the binary to
~/.cargo/bin/timo, which should be in your PATH.Verify the installation:Development Build
For development and testing, you can build without optimizations:Running Tests
Manual Testing
Test all commands to ensure functionality:Database Testing
The SQLite database is stored in your local data directory. To test with a clean database:- Linux
- macOS
- Windows
Project Structure
Understanding the source structure helps when modifying or debugging:Troubleshooting
Compilation Errors
Compilation Errors
Problem: Cargo fails to compile dependenciesSolutions:
- Update Rust:
rustup update - Clear the build cache:
cargo clean - Delete
Cargo.lockand rebuild:rm Cargo.lock && cargo build --release - Ensure you have a C compiler installed for SQLite bundled build
- Linux:
sudo apt-get install build-essential - macOS:
xcode-select --install - Windows: Install Visual Studio Build Tools
- Linux:
SQLite Bundled Build Fails
SQLite Bundled Build Fails
Problem: Error building rusqlite with bundled featureSolutions:
- Install C compiler and development tools (see above)
- On Linux, install additional dependencies:
- Check that you have sufficient disk space
Binary Not Found After Install
Binary Not Found After Install
Problem:
timo: command not found after installationSolutions:- Ensure
~/.cargo/binis in your PATH: - Add to PATH if missing (add to
~/.bashrcor~/.zshrc): - Restart your terminal or run:
Permission Denied on Linux/macOS
Permission Denied on Linux/macOS
Problem: Permission denied when running the binarySolutions:
- Make the binary executable:
- If using manual install, use
sudofor system directories
Database Permission Issues
Database Permission Issues
Problem: Cannot create or access database fileSolutions:
- Check permissions on the local data directory:
- Linux:
~/.local/share/ - macOS:
~/Library/Application Support/
- Linux:
- Ensure the directory exists and is writable:
Migration Errors
Migration Errors
Problem: Database migration fails on startupSolutions:
- Delete the database and let Timo recreate it:
- Check that
src/sql_migrations/directory exists with migration files - Ensure migrations are embedded at compile time
Customizing the Build
Custom Database Location
Set theDB_NAME environment variable before running:
Build Profiles
Customize build settings inCargo.toml:
Cross-Compilation
Build for different platforms:Development Workflow
Quick Iteration
For rapid development:Debugging
Run with debug output:Next Steps
Architecture
Learn about the codebase structure and design patterns
Contributing
Contribute improvements and new features
Commands
Explore all available commands
Labels
Learn how to organize thoughts with labels
Additional Resources
Rust Book
Learn Rust programming language
Cargo Documentation
Master Rust’s package manager
Clap Documentation
Understand the CLI framework
Rusqlite Documentation
Work with SQLite in Rust