distccmac

package
v0.0.0-...-6ac6f58 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0, BSD-3-Clause, MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EngineName define the engine name
	EngineName = "distcc_mac"
)

Variables

This section is empty.

Functions

func GetReleaseCommand

func GetReleaseCommand() *respack.Command

GetReleaseCommand get release commands

func NewDistccMacEngine

func NewDistccMacEngine(conf EngineConfig, mgr direct.HandleWithUser) (engine.Engine, error)

NewDistccMacEngine get a new distcc_mac engine engine distcc_mac which use direct rm is different from engine distcc which use container rm. engine distcc_mac use the same tables with engine distcc. EngineConfig: describe the basic config of engine including mysql config HandleWithUser: registered from a direct resource manager, used to handle the resources and launch tasks.

Types

type CCacheStats

type CCacheStats struct {
	CacheDir                  string `json:"cache_dir"`
	PrimaryConfig             string `json:"primary_config"`
	SecondaryConfig           string `json:"secondary_config"`
	DirectHit                 int    `json:"cache_direct_hit"`
	PreprocessedHit           int    `json:"cache_preprocessed_hit"`
	CacheMiss                 int    `json:"cache_miss"`
	CalledForLink             int    `json:"called_for_link"`
	CalledForPreProcessing    int    `json:"called_for_processing"`
	UnsupportedSourceLanguage int    `json:"unsupported_source_language"`
	NoInputFile               int    `json:"no_input_file"`
	FilesInCache              int    `json:"files_in_cache"`
	CacheSize                 string `json:"cache_size"`
	MaxCacheSize              string `json:"max_cache_size"`
}

CCacheStats describe the ccache stats data from 'ccache -s'.

func (CCacheStats) Dump

func (cs CCacheStats) Dump() []byte

dump the struct data into byte

type CommandSetting

type CommandSetting struct {
	CommandType CommandType
	Command     string

	CompilerVersion string
	CPUNum          int
	CustomParam     string
	LeastJobServer  int

	CCacheEnable  bool
	BanDistCC     bool
	BanAllBooster bool

	Extra taskClientExtra
}

CommandSetting contains command settings

func (*CommandSetting) GetCommand

func (cs *CommandSetting) GetCommand() string

GetCommand get command or args by settings, this command will be executed directly in client side.

func (*CommandSetting) GetCompiler

func (cs *CommandSetting) GetCompiler() (string, string)

GetCompiler get the compiler param.

type CommandType

type CommandType string
const (
	CommandMake  CommandType = "make"
	CommandCmake CommandType = "cmake"
	CommandBazel CommandType = "bazel"
	CommandBlade CommandType = "blade"
	CommandNinja CommandType = "ninja"
)

type EngineConfig

type EngineConfig struct {
	engine.MySQLConf
	Rd rd.RegisterDiscover

	ClusterID           string
	LeastJobServer      int
	JobServerTimesToCPU float64
	Brokers             []config.EngineDistCCBrokerConfig
}

EngineConfig

type ExtraData

type ExtraData struct {
	User          string `json:"user"`
	GccVersion    string `json:"gcc_version"`
	RunDir        string `json:"run_dir"`
	Params        string `json:"params"` //自定义参数
	CCacheEnabled *bool  `json:"ccache_enabled"`

	// command define the target to be called, such as make, bazel, /data/custom/make etc.
	Command     string      `json:"command,omitempty"`
	CommandType CommandType `json:"command_type,omitempty"`

	// extra_vars includes the extra params need by client
	ExtraVars ExtraVars `json:"extra_vars,omitempty"`
}

ExtraData describe the data in task creation from client.

type ExtraVars

type ExtraVars struct {
	// bazelrc define the bazelrc file path
	BazelRC string `json:"bazelrc"`
	MaxJobs int    `json:"max_jobs,omitempty"`
}

ExtraVars describe the extra params in ExtraData

type Message

type Message struct {
	Type MessageType `json:"type"`

	MessageRecordStats  MessageRecordStats  `json:"record_stats"`
	MessageGetCMakeArgs MessageGetCMakeArgs `json:"get_cmake_args"`
}

Message describe the data format from SendMessage caller.

type MessageGetCMakeArgs

type MessageGetCMakeArgs struct {
	CCacheEnabled *bool `json:"ccache_enabled"`
}

MessageGetCMakeArgs describe the message data of type cmake args.

type MessageRecordStats

type MessageRecordStats struct {
	Message     string      `json:"message"`
	CCacheStats CCacheStats `json:"ccache_stats"`
}

MessageRecordStats describe the message data of type record stats.

type MessageResponse

type MessageResponse struct {
	CMakeArgs string `json:"cmake_args"`
}

MessageResponse describe the return data of SendMessage

func (*MessageResponse) Dump

func (mr *MessageResponse) Dump() []byte

Dump dump the struct dat into byte

type MessageType

type MessageType int
const (
	// MessageTypeRecordStats means this message is about record stats from client.
	MessageTypeRecordStats MessageType = iota

	// MessageTypeGetCMakeArgs means this message is about to get cmake args.
	MessageTypeGetCMakeArgs
)

Jump to

Keyboard shortcuts

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