Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
276 changes: 138 additions & 138 deletions Cargo.lock

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions crates/vx-providers/cmake/provider.star
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ fetch_versions = make_fetch_versions("Kitware", "CMake")
# ---------------------------------------------------------------------------

_CMAKE_PLATFORMS = {
"windows/x64": ("windows", "x86_64", "zip"),
"windows/arm64": ("windows", "arm64", "zip"),
"macos/x64": ("Darwin", "x86_64", "tar.gz"),
"macos/arm64": ("Darwin", "arm64", "tar.gz"),
"linux/x64": ("linux", "x86_64", "tar.gz"),
"windows/x64": ("windows", "x86_64", "zip"),
"windows/arm64": ("windows", "arm64", "zip"),
"macos/x64": ("macos", "universal", "tar.gz"),
"macos/arm64": ("macos", "universal", "tar.gz"),
"linux/x64": ("linux", "x86_64", "tar.gz"),
"linux/arm64": ("linux", "aarch64", "tar.gz"),
}

Expand Down
18 changes: 14 additions & 4 deletions crates/vx-providers/duckdb/provider.star
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@
# DuckDB is an in-process SQL OLAP database management system.
# The CLI tool is released as a compressed single binary.
#
# Asset naming: duckdb_cli-{os}-{arch}.{ext}
# Asset naming: duckdb_cli-{os}-{arch}.zip
# - Linux: duckdb_cli-linux-amd64.zip, duckdb_cli-linux-arm64.zip
# - macOS: duckdb_cli-osx-universal.gz (universal binary)
# - macOS: duckdb_cli-osx-amd64.zip, duckdb_cli-osx-arm64.zip
# (universal: duckdb_cli-osx-universal.zip — used as fallback)
# - Windows: duckdb_cli-windows-amd64.zip, duckdb_cli-windows-arm64.zip
#
# Note: .gz variants also exist but contain a raw binary (not an archive).
# Always use .zip — it contains the duckdb binary and is a proper archive.

load("@vx//stdlib:provider.star",
"runtime_def", "github_permissions", "path_fns")
Expand Down Expand Up @@ -51,9 +55,15 @@ fetch_versions = make_fetch_versions("duckdb", "duckdb")
# ---------------------------------------------------------------------------

def _duckdb_asset(ctx):
"""Return the asset filename for the DuckDB CLI on the current platform."""
"""Return the asset filename for the DuckDB CLI on the current platform.

All platforms use .zip archives (not .gz, which is a raw binary).
macOS uses arch-specific builds: osx-amd64 for x64, osx-arm64 for arm64.
"""
if ctx.platform.os == "macos":
return "duckdb_cli-osx-universal.gz"
arch_map = {"x64": "amd64", "arm64": "arm64"}
arch_str = arch_map.get(ctx.platform.arch, "amd64")
return "duckdb_cli-osx-{}.zip".format(arch_str)
elif ctx.platform.os == "linux":
arch_map = {"x64": "amd64", "arm64": "arm64"}
arch_str = arch_map.get(ctx.platform.arch, "amd64")
Expand Down
8 changes: 4 additions & 4 deletions crates/vx-providers/duckdb/tests/starlark_logic_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//!
//! DuckDB uses an unusual asset naming scheme:
//! - Linux: duckdb_cli-linux-{arch}.zip
//! - macOS: duckdb_cli-osx-universal.gz (universal binary)
//! - macOS: duckdb_cli-osx-{arch}.zip (arch-specific .zip, NOT .gz)
//! - Windows: duckdb_cli-windows-{arch}.zip

use starlark::assert::Assert;
Expand Down Expand Up @@ -82,16 +82,16 @@ url != None and "windows" in url and url.endswith(".zip")
}

#[test]
fn test_download_url_macos_is_gz() {
// macOS uses universal .gz format: duckdb_cli-osx-universal.gz
fn test_download_url_macos_is_zip() {
// macOS uses arch-specific .zip format: duckdb_cli-osx-arm64.zip
let mut a = Assert::new();
a.dialect(&Dialect::Standard);
a.is_true(&format!(
r#"
{}
ctx = struct(platform = struct(os = "macos", arch = "arm64", target = ""))
url = download_url(ctx, "1.2.0")
url != None and "osx" in url and url.endswith(".gz")
url != None and "osx" in url and "arm64" in url and url.endswith(".zip")
"#,
provider_star_prefix()
));
Expand Down
94 changes: 68 additions & 26 deletions crates/vx-providers/grpcurl/provider.star
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,19 @@
# grpcurl is a command-line tool that lets you interact with gRPC servers.
# It is basically curl for gRPC servers.
#
# Release assets (GitHub releases, goreleaser format):
# Release assets (GitHub releases, goreleaser with custom naming):
# grpcurl_{version}_{os}_{arch}.tar.gz (Linux/macOS)
# grpcurl_{version}_{os}_{arch}.zip (Windows)
#
# OS: linux, darwin, windows
# Arch: amd64, arm64
# OS: linux, osx, windows (NOTE: macOS uses "osx", not "darwin")
# Arch: x86_64, arm64 (NOTE: x64 uses "x86_64", not "amd64")
#
# Version source: fullstorydev/grpcurl releases on GitHub (tag prefix "v")

load("@vx//stdlib:provider.star",
"runtime_def", "github_permissions", "github_go_provider")
"runtime_def", "github_permissions", "path_fns")
load("@vx//stdlib:github.star", "make_fetch_versions")
load("@vx//stdlib:env.star", "env_prepend")

# ---------------------------------------------------------------------------
# Provider metadata
Expand Down Expand Up @@ -43,25 +45,65 @@ runtimes = [
permissions = github_permissions()

# ---------------------------------------------------------------------------
# Provider template - github_go_provider
#
# Asset: grpcurl_{version}_{os}_{arch}.{ext}
# Repo: fullstorydev/grpcurl
# Tag: v{version}
# ---------------------------------------------------------------------------

_p = github_go_provider(
"fullstorydev", "grpcurl",
asset = "grpcurl_{version}_{os}_{arch}.{ext}",
executable = "grpcurl",
store = "grpcurl",
)

fetch_versions = _p["fetch_versions"]
download_url = _p["download_url"]
install_layout = _p["install_layout"]
store_root = _p["store_root"]
get_execute_path = _p["get_execute_path"]
post_install = _p["post_install"]
environment = _p["environment"]
deps = _p["deps"]
# fetch_versions - from fullstorydev/grpcurl releases
# ---------------------------------------------------------------------------

fetch_versions = make_fetch_versions("fullstorydev", "grpcurl")

# ---------------------------------------------------------------------------
# Platform helpers
# grpcurl uses non-standard naming: "osx" (not "darwin"), "x86_64" (not "amd64")
# ---------------------------------------------------------------------------

_PLATFORMS = {
"windows/x64": ("windows", "x86_64"),
"macos/x64": ("osx", "x86_64"),
"macos/arm64": ("osx", "arm64"),
"linux/x64": ("linux", "x86_64"),
"linux/arm64": ("linux", "arm64"),
}

def _grpcurl_platform(ctx):
key = "{}/{}".format(ctx.platform.os, ctx.platform.arch)
return _PLATFORMS.get(key)

# ---------------------------------------------------------------------------
# download_url - GitHub releases
# ---------------------------------------------------------------------------

def download_url(ctx, version):
platform = _grpcurl_platform(ctx)
if not platform:
return None
os_str, arch_str = platform
ext = "zip" if ctx.platform.os == "windows" else "tar.gz"
return "https://github.com/fullstorydev/grpcurl/releases/download/v{}/grpcurl_{}_{}_{}.{}".format(
version, version, os_str, arch_str, ext)

# ---------------------------------------------------------------------------
# install_layout - archive containing grpcurl binary
# ---------------------------------------------------------------------------

def install_layout(ctx, _version):
exe = "grpcurl.exe" if ctx.platform.os == "windows" else "grpcurl"
return {
"__type": "archive",
"executable_paths": [exe],
}

# ---------------------------------------------------------------------------
# Path queries + environment
# ---------------------------------------------------------------------------

paths = path_fns("grpcurl")
store_root = paths["store_root"]
get_execute_path = paths["get_execute_path"]

def environment(ctx, _version):
return [env_prepend("PATH", ctx.install_dir)]

def post_install(_ctx, _version):
return None

def deps(_ctx, _version):
return []
6 changes: 3 additions & 3 deletions crates/vx-providers/grpcurl/tests/starlark_logic_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ fn test_download_url_linux_x64() {
{}
ctx = struct(platform = struct(os = "linux", arch = "x64", target = ""))
url = download_url(ctx, "1.9.3")
url != None and "linux" in url and "amd64" in url and url.endswith(".tar.gz")
url != None and "linux" in url and "x86_64" in url and url.endswith(".tar.gz")
"#,
provider_star_prefix()
));
Expand All @@ -68,7 +68,7 @@ fn test_download_url_windows_x64() {
{}
ctx = struct(platform = struct(os = "windows", arch = "x64", target = ""))
url = download_url(ctx, "1.9.3")
url != None and "windows" in url and "amd64" in url
url != None and "windows" in url and "x86_64" in url
"#,
provider_star_prefix()
));
Expand All @@ -83,7 +83,7 @@ fn test_download_url_macos_arm64() {
{}
ctx = struct(platform = struct(os = "macos", arch = "arm64", target = ""))
url = download_url(ctx, "1.9.3")
url != None and "darwin" in url and "arm64" in url
url != None and "osx" in url and "arm64" in url
"#,
provider_star_prefix()
));
Expand Down
2 changes: 1 addition & 1 deletion crates/vx-providers/jq/provider.star
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,4 @@ def get_execute_path(ctx, _version):
return ctx.install_dir + "/bin/" + exe

def environment(ctx, _version):
return [{"op": "prepend", "name": "PATH", "value": ctx.install_dir + "/bin"}]
return [{"op": "prepend", "key": "PATH", "value": ctx.install_dir + "/bin"}]
43 changes: 18 additions & 25 deletions crates/vx-providers/k3d/provider.star
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# distribution) in Docker.
#
# Release assets (GitHub releases):
# - Linux/macOS: k3d-{os}-{arch}.tar.gz (contains single binary)
# - Windows: k3d-windows-amd64.exe (direct executable)
# - Linux/macOS: k3d-{os}-{arch} (direct binary, no extension)
# - Windows: k3d-windows-amd64.exe (direct executable)
#
# OS: linux, darwin, windows
# Arch: amd64, arm64 (Linux/macOS), amd64 (Windows)
Expand All @@ -14,9 +14,9 @@

load("@vx//stdlib:provider.star",
"runtime_def", "github_permissions",
"path_fns",
"fetch_versions_with_tag_prefix")
load("@vx//stdlib:env.star", "env_prepend")
load("@vx//stdlib:layout.star", "binary_layout")

# ---------------------------------------------------------------------------
# Provider metadata
Expand Down Expand Up @@ -69,7 +69,8 @@ def _k3d_platform(ctx):

# ---------------------------------------------------------------------------
# download_url - GitHub releases
# Linux/macOS: https://github.com/k3d-io/k3d/releases/download/v{version}/k3d-{os}-{arch}.tar.gz
# All platforms: direct binary download (no archive)
# Linux/macOS: https://github.com/k3d-io/k3d/releases/download/v{version}/k3d-{os}-{arch}
# Windows: https://github.com/k3d-io/k3d/releases/download/v{version}/k3d-windows-amd64.exe
# ---------------------------------------------------------------------------

Expand All @@ -78,36 +79,28 @@ def download_url(ctx, version):
if not platform:
return None
os_str, arch_str = platform
if ctx.platform.os == "windows":
return "https://github.com/k3d-io/k3d/releases/download/v{}/k3d-{}-{}.exe".format(
version, os_str, arch_str)
return "https://github.com/k3d-io/k3d/releases/download/v{}/k3d-{}-{}.tar.gz".format(
version, os_str, arch_str)
exe = ".exe" if ctx.platform.os == "windows" else ""
return "https://github.com/k3d-io/k3d/releases/download/v{}/k3d-{}-{}{}".format(
version, os_str, arch_str, exe)

# ---------------------------------------------------------------------------
# install_layout
# Windows: direct .exe binary
# Linux/macOS: tar.gz containing 'k3d' binary at root
# install_layout - all platforms are direct binary downloads
# binary_layout places the binary at <install_dir>/bin/k3d[.exe]
# ---------------------------------------------------------------------------

def install_layout(ctx, _version):
if ctx.platform.os == "windows":
return {
"__type": "binary",
"executable_paths": ["k3d.exe"],
}
return {
"__type": "archive",
"executable_paths": ["k3d"],
}
install_layout = binary_layout("k3d")

# ---------------------------------------------------------------------------
# Path queries + environment
# ---------------------------------------------------------------------------

paths = path_fns("k3d")
store_root = paths["store_root"]
get_execute_path = paths["get_execute_path"]
def store_root(ctx):
return ctx.vx_home + "/store/k3d"


def get_execute_path(ctx, _version):
exe = "k3d.exe" if ctx.platform.os == "windows" else "k3d"
return ctx.install_dir + "/bin/" + exe


def environment(ctx, _version):
Expand Down
4 changes: 2 additions & 2 deletions crates/vx-providers/k3d/tests/starlark_logic_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ fn test_download_url_linux_x64() {
{}
ctx = struct(platform = struct(os = "linux", arch = "x64", target = ""))
url = download_url(ctx, "5.7.4")
url != None and "linux" in url and "amd64" in url and url.endswith(".tar.gz")
url != None and "linux" in url and "amd64" in url and not url.endswith(".tar.gz")
"#,
provider_star_prefix()
));
Expand Down Expand Up @@ -83,7 +83,7 @@ fn test_download_url_macos_arm64() {
{}
ctx = struct(platform = struct(os = "macos", arch = "arm64", target = ""))
url = download_url(ctx, "5.7.4")
url != None and "darwin" in url and "arm64" in url and url.endswith(".tar.gz")
url != None and "darwin" in url and "arm64" in url and not url.endswith(".tar.gz") and not url.endswith(".exe")
"#,
provider_star_prefix()
));
Expand Down
17 changes: 11 additions & 6 deletions crates/vx-providers/kind/provider.star
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

load("@vx//stdlib:provider.star",
"runtime_def", "github_permissions",
"path_fns",
"fetch_versions_with_tag_prefix")
load("@vx//stdlib:env.star", "env_prepend")
load("@vx//stdlib:layout.star", "binary_layout")
Expand Down Expand Up @@ -88,22 +87,28 @@ def download_url(ctx, version):
# Layout + path/env functions
# kind is a single binary (no archive compression on Linux/macOS,
# .exe directly on Windows)
# binary_layout places the binary at <install_dir>/bin/kind[.exe]
# ---------------------------------------------------------------------------

install_layout = binary_layout("kind")

paths = path_fns("kind")
store_root = paths["store_root"]
get_execute_path = paths["get_execute_path"]

def store_root(ctx):
return ctx.vx_home + "/store/kind"

def environment(ctx, _version):
return [env_prepend("PATH", ctx.install_dir + "/bin")]

def get_execute_path(ctx, _version):
exe = "kind.exe" if ctx.platform.os == "windows" else "kind"
return ctx.install_dir + "/bin/" + exe


def post_install(_ctx, _version):
return None


def environment(ctx, _version):
return [env_prepend("PATH", ctx.install_dir + "/bin")]


def deps(_ctx, _version):
return []
Loading
Loading