zig

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2026 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package zig provides a Zig builder that downloads toolchains from ziglang.org.

Import this package for its side effects to register the builder:

import _ "github.com/Highload-fun/builders/zig"

Index

Constants

View Source
const BuilderId = "zig"

BuilderId is the identifier used to register and look up this builder.

Variables

This section is empty.

Functions

This section is empty.

Types

type Branch

type Branch struct {
	sync.Mutex `json:"-"`
	Version    string    `json:"version"`
	Date       string    `json:"date"`
	AMD64      *Download `json:"x86_64-linux"`
}

Branch represents a Zig release branch from the ziglang.org JSON index.

type Download

type Download struct {
	Tarball string `json:"tarball"`
	SHASum  string `json:"shasum"`
	Size    string `json:"size"`
}

Download holds the tarball URL and metadata for a platform-specific Zig release.

type Zig

type Zig struct {
	sync.Mutex `json:"-"`
	// contains filtered or unexported fields
}

Zig implements builders.Builder for the Zig programming language.

func (*Zig) Build

func (zig *Zig) Build(ctx context.Context, sb *sandbox.Sandbox, version string, flags []string) error

Build compiles Zig source code inside the sandbox using "zig build-exe". If version is empty, "0.13.0" is used. The toolchain is downloaded on demand and cached in builders.CompilersHostDir.

func (*Zig) GetVersions

func (zig *Zig) GetVersions(ctx context.Context) (versions []builders.Version, err error)

GetVersions fetches available Zig versions from the ziglang.org JSON index. The "master" branch is excluded. Results are cached for 1 hour.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL