feat: Add comprehensive Linux build support (#3673)

This commit is contained in:
Alfonso de la Guarda Reyes
2025-08-02 17:40:42 -05:00
committed by GitHub
parent 43e85c4304
commit 84704d1e3a
4 changed files with 232 additions and 3 deletions
+170
View File
@@ -0,0 +1,170 @@
# Building Goose Desktop on Linux
This guide covers building the Goose Desktop application from source on various Linux distributions.
## Prerequisites
### System Dependencies
**Debian/Ubuntu:**
```bash
sudo apt update
sudo apt install -y dpkg fakeroot build-essential
```
**Arch/Manjaro:**
```bash
sudo pacman -S --needed dpkg fakeroot base-devel
```
**Fedora/RHEL/CentOS:**
```bash
sudo dnf install dpkg-dev fakeroot gcc gcc-c++ make
```
**openSUSE:**
```bash
sudo zypper install dpkg fakeroot gcc gcc-c++ make
```
### Development Tools
- **Rust**: Install via [rustup](https://rustup.rs/)
- **Node.js**: Version 22.9.0 or later (use [nvm](https://github.com/nvm-sh/nvm) for version management)
- **npm**: Comes with Node.js
## Build Process
### 1. Clone and Setup
```bash
git clone https://github.com/block/goose.git
cd goose
```
### 2. Build the Rust Backend
```bash
cargo build --release -p goose-server
```
### 3. Prepare the Desktop Application
```bash
cd ui/desktop
npm install
# Copy the server binary to the expected location
mkdir -p src/bin
cp ../../target/release/goosed src/bin/
```
### 4. Build the Application
#### Option A: ZIP Distribution (Recommended)
Works on all Linux distributions:
```bash
npm run make -- --targets=@electron-forge/maker-zip
```
Output: `out/make/zip/linux/x64/Goose-linux-x64-{version}.zip`
#### Option B: DEB Package
For Debian/Ubuntu systems:
```bash
npm run make -- --targets=@electron-forge/maker-deb
```
Output: `out/make/deb/x64/goose_{version}_amd64.deb`
#### Option C: Both Formats
```bash
npm run make
```
### 5. Run the Application
#### From Build Directory
```bash
./out/Goose-linux-x64/Goose
```
#### Install DEB Package (if built)
```bash
sudo dpkg -i out/make/deb/x64/goose_*.deb
```
## Troubleshooting
### Common Issues
#### Missing System Dependencies
If you see errors about missing `dpkg` or `fakeroot`:
```bash
# Install the missing packages for your distribution (see Prerequisites above)
```
#### GLib Warnings
You may see warnings like:
```
GLib-GObject: instance has no handler with id
```
These are harmless and don't affect functionality. To suppress them, create a launcher script:
```bash
#!/bin/bash
cd /path/to/goose/ui/desktop/out/Goose-linux-x64
./Goose 2>&1 | grep -v "GLib-GObject" | grep -v "browser_main_loop"
```
#### Server Binary Not Found
If you see "Could not find goosed binary", ensure you've:
1. Built the Rust backend: `cargo build --release -p goose-server`
2. Copied it to the right location: `cp ../../target/release/goosed src/bin/`
3. Rebuilt the application: `npm run make`
### Distribution-Specific Notes
#### Arch/Manjaro
- The RPM maker is disabled by default as it's not compatible with Arch-based systems
- Use the ZIP distribution method for maximum compatibility
#### Flatpak/Snap
Building as Flatpak or Snap packages is not currently supported but may be added in the future.
## Development Workflow
For active development:
1. **Backend changes**: Rebuild with `cargo build --release -p goose-server` and copy the binary
2. **Frontend changes**: Use `npm run start` for hot reload during development
3. **Full rebuild**: Run the complete build process above
## Creating System Integration
### Desktop Entry
Create `~/.local/share/applications/goose.desktop`:
```ini
[Desktop Entry]
Name=Goose AI Agent
Comment=Local AI agent for development tasks
Exec=/path/to/goose/ui/desktop/out/Goose-linux-x64/Goose
Icon=/path/to/goose/ui/desktop/out/Goose-linux-x64/resources/app.asar.unpacked/src/images/icon.png
Terminal=false
Type=Application
Categories=Development;Utility;
StartupNotify=true
```
### System-wide Installation
To install system-wide:
```bash
sudo cp -r out/Goose-linux-x64 /opt/goose
sudo ln -s /opt/goose/Goose /usr/local/bin/goose-gui
```
## Contributing
When contributing changes that affect the Linux build process, please:
1. Test on multiple distributions if possible
2. Update this documentation
3. Update `ui/desktop/README.md` if needed
4. Consider CI/CD implications for automated builds
Executable
+6
View File
@@ -0,0 +1,6 @@
#!/bin/bash
# Launcher script for Goose GUI
# Suppresses common GLib warnings that don't affect functionality
cd /home/alfonsodg/Devel-Local/oss/goose/ui/desktop/out/Goose-linux-x64
./Goose 2>&1 | grep -v "GLib-GObject" | grep -v "browser_main_loop"
+54 -1
View File
@@ -14,12 +14,33 @@ npm install
npm run start
```
## Platform-specific build requirements
### Linux
For building on Linux distributions, you'll need additional system dependencies:
**Debian/Ubuntu:**
```bash
sudo apt install dpkg fakeroot
```
**Arch/Manjaro:**
```bash
sudo pacman -S dpkg fakeroot
```
**Fedora/RHEL:**
```bash
sudo dnf install dpkg-dev fakeroot
```
# Building notes
This is an electron forge app, using vite and react.js. `goosed` runs as multi process binaries on each window/tab similar to chrome.
see `package.json`:
## Building for different platforms
### macOS
`npm run bundle:default` will give you a Goose.app/zip which is signed/notarized but only if you setup the env vars as per `forge.config.ts` (you can empty out the section on osxSign if you don't want to sign it) - this will have all defaults.
`npm run bundle:preconfigured` will make a Goose.app/zip signed and notarized, but use the following:
@@ -32,6 +53,38 @@ see `package.json`:
This allows you to set for example GOOSE_PROVIDER__TYPE to be "databricks" by default if you want (so when people start Goose.app - they will get that out of the box). There is no way to set an api key in that bundling as that would be a terrible idea, so only use providers that can do oauth (like databricks can), otherwise stick to default goose.
### Linux
For Linux builds, first ensure you have the required system dependencies installed (see above), then:
1. Build the Rust backend:
```bash
cd ../.. # Go to project root
cargo build --release -p goose-server
```
2. Copy the server binary to the expected location:
```bash
mkdir -p src/bin
cp ../../target/release/goosed src/bin/
```
3. Build the application:
```bash
# For ZIP distribution (works on all Linux distributions)
npm run make -- --targets=@electron-forge/maker-zip
# For DEB package (Debian/Ubuntu)
npm run make -- --targets=@electron-forge/maker-deb
```
The built application will be available in:
- ZIP: `out/make/zip/linux/x64/Goose-linux-x64-{version}.zip`
- DEB: `out/make/deb/x64/goose_{version}_amd64.deb`
- Executable: `out/Goose-linux-x64/Goose`
### Windows
Use the existing Windows build process as documented.
# Running with goosed server from source
+2 -2
View File
@@ -54,11 +54,11 @@ module.exports = {
makers: [
{
name: '@electron-forge/maker-zip',
platforms: ['darwin', 'win32'],
platforms: ['darwin', 'win32', 'linux'],
config: {
arch: process.env.ELECTRON_ARCH === 'x64' ? ['x64'] : ['arm64'],
options: {
icon: 'src/images/icon.ico',
icon: process.platform === 'linux' ? 'src/images/icon.png' : 'src/images/icon.ico',
},
},
},