tuco

package module
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2026 License: 0BSD Imports: 14 Imported by: 0

README

tuco: Go port multiplexer

GitHub Downloads go.dev reference Test license Donate

la tuza

SUMMARY

tuco streamlines Go application porting.

EXAMPLE

% cd example

% tuco

% ls bin/hello-ports
hello-aix-ppc64.tgz
hello-darwin-amd64.tgz
hello-darwin-arm64.tgz
...

For more CLI option, run tuco -help.

For more ports, run go tool dist list.

DOWNLOAD

go install github.com/mcandre/tuco/cmd/tuco@latest

Prerequisites

For more platforms and installation methods, see our install guide.

ABOUT

tuco automates more low level steps involved in managing crosscompilation for Go projects. So that you can focus on developing your application.

FEATURES

  • Parallelism
  • IaC friendly
  • Easy port selection with YAML comment toggles
  • Automatically corrects chmod bits inside tarballs
  • Logical directory structure for straightforward binary based OS packaging

CONFIGURATION

For details on tuning tuco, see our configuration guide.

RESOURCES

Prior art, personal plugs, and tools for developing portable applications (including non-Go projects)!

🐹🍹

Documentation

Overview

Package tuco implements primitives for organizing Go crosscompilation.

Index

Constants

View Source
const ConfigurationFilename = "tuco.yaml"

ConfigurationFilename denotes the location of the tuco configuration file, relative to the current working directory.

View Source
const DefaultArtifacts = "bin"

DefaultArtifacts denotes the default location of the artifact directory tree.

View Source
const DefaultJobs uint = 4

DefaultJobs denotes the default number of goroutines.

View Source
const Version = "0.0.21"

Version is semver.

Variables

View Source
var DefaultExcludes = []string{
	".DS_Store",
	"Thumbs.db",
}

DefaultExcludes collects file path patterns to strip from archives.

Functions

This section is empty.

Types

type Port

type Port struct {
	// Os denotes a high-level environment.
	//
	// Example: "linux"
	Os string

	// Arch denotes a low-level environment.
	//
	// Example: "amd64"
	Arch string
}

Port models a basic targetable execution configuration.

func ParsePort

func ParsePort(s string) (*Port, error)

ParsePort constructs a port from a string. https://go.dev/wiki/PortingPolicy

func (Port) MarshalYAML

func (o Port) MarshalYAML() (interface{}, error)

MarshalYAML encodes YAML.

func (Port) String

func (o Port) String() string

String renders a port.

func (*Port) UnmarshalYAML

func (o *Port) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML decodes YAML.

type Tuco

type Tuco struct {
	// Debug enables additional logging.
	Debug bool `yaml:"debug,omitempty"`

	// Artifacts denotes the location of the toplevel artifacts directory (default: `DefaultArtifacts`).
	Artifacts string `yaml:"artifacts,omitempty"`

	// Banner denotes a software application identifier (required, nonblank).
	Banner string `yaml:"banner"`

	// Jobs limits the number of goroutines (default: `DefaultJobs`).
	Jobs uint `yaml:"jobs,omitempty"`

	// Excludes skips matching file paths from archival.
	//
	// Glob syntax
	// https://pkg.go.dev/path/filepath#Match
	Excludes []string `yaml:"excludes,omitempty"`

	// GoArgs collects additional `go build`... CLI flags
	GoArgs []string `yaml:"go_args,omitempty"`

	// Ports collects target ports.
	Ports []Port `yaml:"ports,omitempty"`
	// contains filtered or unexported fields
}

Tuco models a crossport build setup.

func Load

func Load() (*Tuco, error)

Load constructs a Tuco from `ConfigurationFilename`.

func NewTuco

func NewTuco() Tuco

NewTuco constructs a default Tuco.

func (Tuco) Archive

func (o Tuco) Archive(port Port, outputPth string) error

Archive compresses Go applications in conventional UNIX TGZ format.

func (Tuco) Build

func (o Tuco) Build(port Port) error

Build generates binaries for the given port.

func (Tuco) Clean

func (o Tuco) Clean() error

Clean removes artifacts.

func (Tuco) Run

func (o Tuco) Run() []error

Run crosscompiles and archives Go applications.

func (*Tuco) UpdateMaxPortLen

func (o *Tuco) UpdateMaxPortLen()

UpdateMaxPortLen calculates maxPortLen.

func (*Tuco) UpdateTarballRoot

func (o *Tuco) UpdateTarballRoot()

UpdateTarballRoot calculates binary archive root directories.

Directories

Path Synopsis
cmd
tuco command
Package main implements a tool for automating Go crosscompilation.
Package main implements a tool for automating Go crosscompilation.

Jump to

Keyboard shortcuts

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