Current idea is, or at least I do it like this, that I have one general rye installed that I can invoke at any time and at any location.
But if I tackle a concrete and specific project, I build a project-specific binary and keep it local to the project.
This approach lets you:
The l.rye script (local Rye) manages building project-specific binaries. You need:
RYE_HOME environment variable set# Define RYE_HOME environment variable pointing to Rye source
export RYE_HOME=/home/user/rye
# Get help and setup instructions
$RYE_HOME/bin/l.rye help
$RYE_HOME/bin/l.rye setup
Add RYE_HOME to your shell configuration file (~/.bashrc or ~/.zshrc) for persistence.
Create a lrye.mod file in your project directory to define which modules to include in your build.
List the module names - each will be prefixed with b_ automatically to form build tags.
Common modules include:
http - HTTP client and server functionalitysqlite - SQLite database supportbleve - Full-text search enginecontrib - Community contributed builtinsmpv - MPV media player integrationtiny - Minimal build with reduced featuresContrib modules (require contrib flag):
contrib/ folderFor a project using contrib and mpv:
mpv
contrib
For a web application:
http
sqlite
bleve
An empty lrye.mod file is also valid if you just need the base modules.
# Build with modules from lrye.mod
$RYE_HOME/bin/l.rye build
# The resulting binary is called 'lrye'
# Run local rye binary with local main.rye
./lrye .
# Or run any script
./lrye myscript.rye
# 1. Set up a new project
mkdir myproject && cd myproject
# 2. Create lrye.mod with desired modules
cat > lrye.mod << EOF
http
sqlite
EOF
# 3. Build the local binary
$RYE_HOME/bin/l.rye build
# 4. Create your main script
echo 'print "Hello from local Rye!"' > main.rye
# 5. Run with local binary
./lrye .