factorio

package module
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2024 License: BSD-2-Clause-Views Imports: 9 Imported by: 1

README

factorio: Go cross-compiler

EXAMPLE

$ cd example

$ factorio

$ tree bin/artifact-dev
bin/artifact-dev
├── darwin
│   ├── amd64
│   │   └── factorio
│   └── arm64
│       └── factorio
...

ABOUT

factorio accelerates Go application development, by automating the process of generating binaries for a multitude of platforms. Your time is valuable. Spend it developing software, not tinkering with toolchains.

factorio is fast. It has no intrinsic dependency on any containers or virtual machines. Factorio plugs directly into the standard go command line system.

LICENSE

BSD-2-Clause

DOCUMENTATION

https://godoc.org/github.com/mcandre/factorio

DOWNLOAD

https://github.com/mcandre/factorio/releases

INSTALL FROM SOURCE

$ go install github.com/mcandre/factorio/cmd/factorio@latest

RUNTIME REQUIREMENTS

  • Go 1.21.5+
  • POSIX compatible tar
  • tree
  • a UNIX environment, such as macOS, Linux, BSD, WSL, etc.

tar is a portable archiver suitable for creating *.tgz tarball archives. Users can then download the tarball and extract the executable relevant to their platform. Tarballs are especially well suited for use in Docker containers, as the tar command is more likely to be installed than unzip.

Note that non-UNIX file systems may not preserve crucial chmod acl bits during port generation. This can corrupt downstream artifacts, such as compressed archives and installation procedures.

CONTRIBUTING

For more information on developing factorio itself, see DEVELOPMENT.md.

CONFIGURATION

The default subdirectory can be customized with a FACTORIO_BANNER environment variable, e.g. FACTORIO_BANNER=hello-0.0.1. Then artifacts will appear in bin/hello-0.0.1/. This is helpful when structuring file paths in prepraration for compressed archives, for example.

factorio primarily assists conventional PC (desktop/laptop/workstation/server) applications. factorio enables the standard platforms expected to work out of the box for go build, particularly any pure Go project.

factorio will exclude mobile platforms by default. You can customize the platform blocklist by supplying a Go Regexp to a FACTORIO_PLATFORM_BLOCKLIST environment variable, e.g. FACTORIO_PLATFORM_BLOCKLIST=//.

factorio is essentially compatible with go build flags and environment variables. Any Extra environment variables or flags you pass to factorio will propagate to go build.

SEE ALSO

  • crit generates Rust ports
  • LLVM bitcode offers an abstract assembler format for C/C++ code.
  • tug automates multi-platform Docker image builds.
  • WASM provides a portable interface for C/C++ code.
  • xgo supports Go projects with native cgo dependencies.

Documentation

Index

Constants

View Source
const ArtifactToplevelDir = "bin"

ArtifactToplevelDir names the output location for binaries.

View Source

Banner names the default output subdirectory.

View Source
const BannerParameter = "FACTORIO_BANNER"

BannerParameter controls the environment variable for overriding the default Banner subdirectory.

Example configuration: FACTORIO_BANNER=hello-0.0.1

View Source
const PlatformBlocklistParameter = "FACTORIO_PLATFORM_BLOCKLIST"

PlatformBlocklistParameter controls the environment variable for overriding the default PlatformBlocklist.

Example configuration: FACTORIO_PLATFORM_BLOCKLIST=//

View Source
const Version = "0.0.6"

Version is semver.

Variables

View Source
var PlatformBlocklist = regexp.MustCompile(`(android\/.*)|(ios\/.*)`)

PlatformBlocklist excludes some fragile targets.

Functions

func Build

func Build(platform Platform, artifactToplevelDir string, args []string) error

Build generates binaries for the given platform.

func Port

func Port(args []string) error

Port generates a multitude of binaries.

Types

type Platform

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

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

Platform models a basic targetable execution configuration.

func Platforms

func Platforms() ([]Platform, error)

Platforms enumerates the available platform combinations.

func (Platform) String

func (o Platform) String() string

String renders a platform.

Directories

Path Synopsis
cmd
example module

Jump to

Keyboard shortcuts

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