Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 24 additions & 2 deletions .github/workflows/build-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# Platform Build Strategy:
# - Linux standard: Uses native Ubuntu 22.04 runners to keep glibc compatibility with Ubuntu 22.04 LTS
# - Linux Vulkan: Uses native Ubuntu 24.04 runners for newer Vulkan headers/tooling
# - Linux musl: Uses native Ubuntu 22.04 runners with reduced features for musl compatibility
# - macOS: Uses native macOS runners for each architecture
# - Windows: Uses Windows runner with native MSVC build
on:
Expand Down Expand Up @@ -42,6 +43,16 @@ jobs:
target-suffix: unknown-linux-gnu
build-on: ubuntu-22.04-arm
variant: standard
- platform: linux
architecture: x86_64
target-suffix: unknown-linux-musl
build-on: ubuntu-22.04
variant: musl
- platform: linux
architecture: aarch64
target-suffix: unknown-linux-musl
build-on: ubuntu-22.04-arm
variant: musl
- platform: linux
architecture: x86_64
target-suffix: unknown-linux-gnu
Expand Down Expand Up @@ -104,6 +115,10 @@ jobs:
glslc
fi

if [ "${{ matrix.variant }}" = "musl" ]; then
sudo apt-get install -y musl-tools
fi

- name: Cache Cargo artifacts (Linux/macOS)
if: matrix.platform != 'windows'
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
Expand Down Expand Up @@ -133,7 +148,14 @@ jobs:
if [ "${{ matrix.variant }}" = "vulkan" ]; then
FEATURE_ARGS=(--features vulkan)
fi
cargo build --release --target ${TARGET} -p goose-cli "${FEATURE_ARGS[@]}"

if [ "${{ matrix.variant }}" = "musl" ]; then
cargo build --release --target ${TARGET} -p goose-cli --bin goose \
--no-default-features \
--features rustls-tls,aws-providers,telemetry,otel
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would this be easier to maintain if defined in Cargo.toml as a default-musl feature that enables these?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that seems reasonable, especially as I'd like if we could eventually support more features on musl. I'll do it

else
cargo build --release --target ${TARGET} -p goose-cli "${FEATURE_ARGS[@]}"
fi

- name: Setup Rust (Windows)
if: matrix.platform == 'windows'
Expand Down Expand Up @@ -233,7 +255,7 @@ jobs:
- name: Upload CLI artifact
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: goose-${{ matrix.architecture }}-${{ matrix.target-suffix }}${{ matrix.variant != 'standard' && format('-{0}', matrix.variant) || '' }}
name: goose-${{ matrix.architecture }}-${{ matrix.target-suffix }}${{ matrix.variant != 'standard' && matrix.variant != 'musl' && format('-{0}', matrix.variant) || '' }}
path: |
${{ env.ARTIFACT_BZ2 }}
${{ env.ARTIFACT_GZ }}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/pr-comment-build-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ jobs:
Download CLI builds for different platforms:
- [📦 Linux (x86_64, Ubuntu 22.04-compatible)](https://nightly.link/${{ github.repository }}/actions/runs/${{ github.run_id }}/goose-x86_64-unknown-linux-gnu.zip)
- [📦 Linux (aarch64, Ubuntu 22.04-compatible)](https://nightly.link/${{ github.repository }}/actions/runs/${{ github.run_id }}/goose-aarch64-unknown-linux-gnu.zip)
- [📦 Linux musl (x86_64)](https://nightly.link/${{ github.repository }}/actions/runs/${{ github.run_id }}/goose-x86_64-unknown-linux-musl.zip)
- [📦 Linux musl (aarch64)](https://nightly.link/${{ github.repository }}/actions/runs/${{ github.run_id }}/goose-aarch64-unknown-linux-musl.zip)
- [📦 Linux Vulkan (x86_64, Ubuntu 24.04+)](https://nightly.link/${{ github.repository }}/actions/runs/${{ github.run_id }}/goose-x86_64-unknown-linux-gnu-vulkan.zip)
- [📦 Linux Vulkan (aarch64, Ubuntu 24.04+)](https://nightly.link/${{ github.repository }}/actions/runs/${{ github.run_id }}/goose-aarch64-unknown-linux-gnu-vulkan.zip)
- [📦 macOS (x86_64)](https://nightly.link/${{ github.repository }}/actions/runs/${{ github.run_id }}/goose-x86_64-apple-darwin.zip)
Expand Down
12 changes: 10 additions & 2 deletions crates/goose-cli/src/commands/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,22 @@ fn asset_name() -> &'static str {
{
"goose-x86_64-apple-darwin.tar.bz2"
}
#[cfg(all(target_os = "linux", target_arch = "x86_64"))]
#[cfg(all(target_os = "linux", target_arch = "x86_64", target_env = "gnu"))]
{
"goose-x86_64-unknown-linux-gnu.tar.bz2"
}
#[cfg(all(target_os = "linux", target_arch = "aarch64"))]
#[cfg(all(target_os = "linux", target_arch = "aarch64", target_env = "gnu"))]
{
"goose-aarch64-unknown-linux-gnu.tar.bz2"
}
#[cfg(all(target_os = "linux", target_arch = "x86_64", target_env = "musl"))]
{
"goose-x86_64-unknown-linux-musl.tar.bz2"
}
#[cfg(all(target_os = "linux", target_arch = "aarch64", target_env = "musl"))]
{
"goose-aarch64-unknown-linux-musl.tar.bz2"
}
#[cfg(all(target_os = "windows", target_arch = "x86_64", feature = "cuda"))]
{
"goose-x86_64-pc-windows-msvc-cuda.zip"
Expand Down
3 changes: 3 additions & 0 deletions crates/goose/src/providers/toolshim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
//!

use super::errors::ProviderError;
#[cfg(feature = "local-inference")]
use super::local_inference::LOCAL_LLM_MODEL_CONFIG_KEY;
use super::ollama::OLLAMA_DEFAULT_PORT;
use super::ollama::OLLAMA_HOST;
Expand All @@ -52,6 +53,8 @@ use uuid::Uuid;
pub const DEFAULT_INTERPRETER_MODEL_OLLAMA: &str = "mistral-nemo";
pub const TOOLSHIM_BACKEND_ENV_VAR: &str = "GOOSE_TOOLSHIM_BACKEND";
pub const TOOLSHIM_LOCAL_MODEL_ENV_VAR: &str = "GOOSE_TOOLSHIM_MODEL";
#[cfg(not(feature = "local-inference"))]
const LOCAL_LLM_MODEL_CONFIG_KEY: &str = "LOCAL_LLM_MODEL";

const TOOL_CALLS_SECTION_BEGIN: &str = "<|tool_calls_section_begin|>";
const TOOL_CALLS_SECTION_END: &str = "<|tool_calls_section_end|>";
Expand Down
32 changes: 28 additions & 4 deletions download_cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ set -eu
# GOOSE_VERSION - Optional: specific version to install (e.g., "v1.0.25"). Overrides CANARY. Can be in the format vX.Y.Z, vX.Y.Z-suffix, or X.Y.Z
# GOOSE_PROVIDER - Optional: provider for goose
# GOOSE_MODEL - Optional: model for goose
# GOOSE_LINUX_VARIANT - Optional: Linux package variant to install (`standard` or `vulkan`)
# GOOSE_LINUX_VARIANT - Optional: Linux package variant to install (`standard`, `vulkan`, or `musl`)
# GOOSE_WINDOWS_VARIANT - Optional: Windows package variant to install (`standard` or `cuda`)
# CANARY - Optional: if set to "true", downloads from canary release instead of stable
# CONFIGURE - Optional: if set to "false", disables running goose configure interactively
Expand Down Expand Up @@ -69,7 +69,7 @@ fi
GOOSE_BIN_DIR="${GOOSE_BIN_DIR:-$DEFAULT_BIN_DIR}"
RELEASE="${CANARY:-false}"
CONFIGURE="${CONFIGURE:-true}"
GOOSE_LINUX_VARIANT="${GOOSE_LINUX_VARIANT:-standard}"
GOOSE_LINUX_VARIANT="${GOOSE_LINUX_VARIANT:-}"
GOOSE_WINDOWS_VARIANT="${GOOSE_WINDOWS_VARIANT:-standard}"
if [ -n "${GOOSE_VERSION:-}" ]; then
# Validate the version format
Expand Down Expand Up @@ -141,6 +141,28 @@ case "$ARCH" in
;;
esac

detect_linux_musl() {
if [[ "$OSTYPE" == "linux-musl"* ]]; then
return 0
fi

if command -v ldd >/dev/null 2>&1 && ldd --version 2>&1 | grep -qi musl; then
return 0
fi

compgen -G "/lib/ld-musl-*.so.*" >/dev/null
Comment thread
jh-block marked this conversation as resolved.
Outdated
}

if [ "$OS" = "linux" ] && [ -z "$GOOSE_LINUX_VARIANT" ]; then
if detect_linux_musl; then
GOOSE_LINUX_VARIANT="musl"
else
GOOSE_LINUX_VARIANT="standard"
fi
elif [ -z "$GOOSE_LINUX_VARIANT" ]; then
GOOSE_LINUX_VARIANT="standard"
fi

# Debug output (safely handle undefined variables)
echo "WINDIR: ${WINDIR:-<not set>}"
echo "OSTYPE: $OSTYPE"
Expand Down Expand Up @@ -176,15 +198,17 @@ elif [ "$OS" = "windows" ]; then
OUT_FILE="goose.exe"
else
case "$GOOSE_LINUX_VARIANT" in
standard|vulkan) ;;
standard|vulkan|musl) ;;
*)
echo "Error: Unsupported GOOSE_LINUX_VARIANT '$GOOSE_LINUX_VARIANT'. Expected 'standard' or 'vulkan'."
echo "Error: Unsupported GOOSE_LINUX_VARIANT '$GOOSE_LINUX_VARIANT'. Expected 'standard', 'vulkan', or 'musl'."
exit 1
;;
esac
FILE="goose-$ARCH-unknown-linux-gnu.tar.bz2"
if [ "$GOOSE_LINUX_VARIANT" = "vulkan" ]; then
FILE="goose-$ARCH-unknown-linux-gnu-vulkan.tar.bz2"
elif [ "$GOOSE_LINUX_VARIANT" = "musl" ]; then
FILE="goose-$ARCH-unknown-linux-musl.tar.bz2"
fi
EXTRACT_CMD="tar"
fi
Expand Down
Loading