runner

package
v0.0.0-...-8a43a77 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LocalAppleXcodeSDKRootResolver

func LocalAppleXcodeSDKRootResolver(ctx context.Context, developerDirectory, sdkName string) (string, error)

LocalAppleXcodeSDKRootResolver resolves the SDK root directory (SDKROOT) by calling into the xcrun utility on the current system.

func NewAppleXcodeResolvingRunner

func NewAppleXcodeResolvingRunner(base runner_pb.RunnerServer, developerDirectories map[string]string, sdkRootResolver AppleXcodeSDKRootResolver) runner_pb.RunnerServer

NewAppleXcodeResolvingRunner creates a decorator for RunnerServer that injects DEVELOPER_DIR and SDKROOT environment variables into actions, based on the presence of APPLE_SDK_PLATFORM, APPLE_SDK_VERSION_OVERRIDE, and XCODE_VERSION_OVERRIDE environment variables.

This decorator can be used on macOS workers to let build actions choose between one of the copies of Xcode that is installed on the worker, without requiring that the client hardcodes the absolute path at which Xcode is installed.

This decorator implements the convention that is used by Bazel. For local execution, Bazel implements similar logic as part of class com.google.devtools.build.lib.exec.local.XcodeLocalEnvProvider.

func NewCleanRunner

func NewCleanRunner(base runner_pb.RunnerServer, idleInvoker *cleaner.IdleInvoker) runner_pb.RunnerServer

NewCleanRunner is a decorator for Runner that calls into an IdleInvoker before and after running a build action.

This decorator can be used to run cleanup tasks that are needed to be performed to bring the execution environment in a consistent state (e.g., scrubbing the process table, removing stale temporary files).

func NewLocalRunner

func NewLocalRunner(buildDirectory filesystem.Directory, buildDirectoryPath *path.Builder, commandCreator CommandCreator, setTmpdirEnvironmentVariable bool) runner.RunnerServer

NewLocalRunner returns a Runner capable of running commands on the local system directly.

func NewPathExistenceCheckingRunner

func NewPathExistenceCheckingRunner(base runner_pb.RunnerServer, readinessCheckingPathnames []string) runner_pb.RunnerServer

NewPathExistenceCheckingRunner creates a decorator of RunnerServer that is only healthy when certain paths on disk exist.

func NewTemporaryDirectoryInstallingRunner

func NewTemporaryDirectoryInstallingRunner(base runner_pb.RunnerServer, tmpInstaller tmp_installer.TemporaryDirectoryInstallerClient) runner_pb.RunnerServer

NewTemporaryDirectoryInstallingRunner creates a Runner that calls into a separate gRPC service to announce the availability of a new temporary directory that may be used by build actions as a scratch space.

This gRPC may, for example, remove the /tmp directory on the system and replace it by a symbolic link that points to the directory created by the worker.

func NewTemporaryDirectorySymlinkingRunner

func NewTemporaryDirectorySymlinkingRunner(base runner_pb.RunnerServer, symlinkPath string, buildDirectoryPath *path.Builder) runner_pb.RunnerServer

NewTemporaryDirectorySymlinkingRunner creates a decorator for Runner that removes a local path on the system and replaces it with a symbolic link pointing to the temporary directory that was created by bb_worker as part of the action's build directory.

Types

type AppleXcodeSDKRootResolver

type AppleXcodeSDKRootResolver func(ctx context.Context, developerDirectory, sdkName string) (string, error)

AppleXcodeSDKRootResolver is a callback function that is used to obtain the path of an Xcode SDK root directory (SDKROOT), given a developer directory (DEVELOPER_DIR) and an SDK name.

func NewCachingAppleXcodeSDKRootResolver

func NewCachingAppleXcodeSDKRootResolver(base AppleXcodeSDKRootResolver) AppleXcodeSDKRootResolver

NewCachingAppleXcodeSDKRootResolver creates a decorator for AppleXcodeSDKRootResolver that caches successful results of successive calls. As it is assumed that the number of SDKs installed on the current system is small, no bounds are placed on the maximum cache size.

type CommandCreator

type CommandCreator func(ctx context.Context, arguments []string, inputRootDirectory *path.Builder, workingDirectoryParser path.Parser, pathVariable string) (*exec.Cmd, error)

CommandCreator is a type alias for a function that creates the exec.Cmd in localRunner.Run(). It may use different strategies for resolving the paths of argv[0] and the working directory, depending on whether the action needs to be run in a chroot() or not.

func NewChrootedCommandCreator

func NewChrootedCommandCreator(sysProcAttr *syscall.SysProcAttr) (CommandCreator, error)

NewChrootedCommandCreator returns a CommandCreator for cases where we need to chroot into the input root directory.

func NewPlainCommandCreator

func NewPlainCommandCreator(sysProcAttr *syscall.SysProcAttr) CommandCreator

NewPlainCommandCreator returns a CommandCreator for cases where we don't need to chroot into the input root directory.

Jump to

Keyboard shortcuts

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