cc

package
v0.0.0-...-a0b8de0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2021 License: BSD-3-Clause Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotCacheable = errors.New("not cacheable")

Functions

func LookPath

func LookPath(file string, path string) (string, error)

LookPath searches for an executable named file in the directories named by the PATH environment variable. If file contains a slash, it is tried directly and the PATH is not consulted. The result may be an absolute path or a path relative to the current directory.

func Run

func Run(args []string, info, shimPath, cachePath string) error

Types

type AnalyzedOperation

type AnalyzedOperation struct {
	Condition CCOption
	Command   string
	Known     map[string][]string
	ForPP     []string
	Common    []string
	Processed []string
	Inputs    []string
	Outputs   []string
	TooHard   []string
}

func Analyze

func Analyze(args []string) (*AnalyzedOperation, error)

func (*AnalyzedOperation) Cachable

func (a *AnalyzedOperation) Cachable() error

func (*AnalyzedOperation) Nonce

func (a *AnalyzedOperation) Nonce() []byte

Nonce hashes the common args to provide a salt to the hashed output from the complier's preprocessing run.

func (*AnalyzedOperation) Output

func (a *AnalyzedOperation) Output() string

func (*AnalyzedOperation) PreprocessArgs

func (a *AnalyzedOperation) PreprocessArgs() []string

type CCOption

type CCOption int
const (
	NoArgs CCOption = 1 << iota
	ForPP
	Prefix
	Separated
	CanBeSeparated
	TooHard
	Compile
	Output
	Language
)

type Cache

type Cache struct {
	// contains filtered or unexported fields
}

func NewCache

func NewCache(root, path string) (*Cache, error)

func (*Cache) CalculateCacheInfo

func (c *Cache) CalculateCacheInfo(ctx context.Context, L hclog.Logger, args []string) (string, string, error)

func (*Cache) Retrieve

func (c *Cache) Retrieve(info, output string) (bool, error)

func (*Cache) Store

func (c *Cache) Store(info, output string) ([]byte, error)

type CompOpt

type CompOpt struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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