Documentation
¶
Overview ¶
Package spec provides 3pp spec definition and helper functions for merging Create field.
Index ¶
- Variables
- func ProtoMerge(dst, src proto.Message)
- type CipdSource
- func (*CipdSource) Descriptor() ([]byte, []int)deprecated
- func (x *CipdSource) GetDefaultVersion() string
- func (x *CipdSource) GetOriginalDownloadUrl() string
- func (x *CipdSource) GetPkg() string
- func (*CipdSource) ProtoMessage()
- func (x *CipdSource) ProtoReflect() protoreflect.Message
- func (x *CipdSource) Reset()
- func (x *CipdSource) String() string
- type GitSource
- func (*GitSource) Descriptor() ([]byte, []int)deprecated
- func (x *GitSource) GetFixedCommit() string
- func (x *GitSource) GetRepo() string
- func (x *GitSource) GetTagFilterRe() string
- func (x *GitSource) GetTagPattern() string
- func (x *GitSource) GetVersionJoin() string
- func (x *GitSource) GetVersionRestriction() []*SemverRestriction
- func (*GitSource) ProtoMessage()
- func (x *GitSource) ProtoReflect() protoreflect.Message
- func (x *GitSource) Reset()
- func (x *GitSource) String() string
- type Operator
- type ScriptSource
- func (*ScriptSource) Descriptor() ([]byte, []int)deprecated
- func (x *ScriptSource) GetName() []string
- func (x *ScriptSource) GetUseFetchCheckoutWorkflow() bool
- func (x *ScriptSource) GetVerificationTimeout() string
- func (*ScriptSource) ProtoMessage()
- func (x *ScriptSource) ProtoReflect() protoreflect.Message
- func (x *ScriptSource) Reset()
- func (x *ScriptSource) String() string
- type SemverRestriction
- func (*SemverRestriction) Descriptor() ([]byte, []int)deprecated
- func (x *SemverRestriction) GetOp() Operator
- func (x *SemverRestriction) GetVal() string
- func (*SemverRestriction) ProtoMessage()
- func (x *SemverRestriction) ProtoReflect() protoreflect.Message
- func (x *SemverRestriction) Reset()
- func (x *SemverRestriction) String() string
- type Spec
- type Spec_Create
- func (*Spec_Create) Descriptor() ([]byte, []int)deprecated
- func (x *Spec_Create) GetBuild() *Spec_Create_Build
- func (x *Spec_Create) GetExperimental() bool
- func (x *Spec_Create) GetPackage() *Spec_Create_Package
- func (x *Spec_Create) GetPlatformRe() string
- func (x *Spec_Create) GetSource() *Spec_Create_Source
- func (x *Spec_Create) GetUnsupported() bool
- func (x *Spec_Create) GetVerify() *Spec_Create_Verify
- func (*Spec_Create) ProtoMessage()
- func (x *Spec_Create) ProtoReflect() protoreflect.Message
- func (x *Spec_Create) Reset()
- func (x *Spec_Create) String() string
- type Spec_Create_Build
- func (*Spec_Create_Build) Descriptor() ([]byte, []int)deprecated
- func (x *Spec_Create_Build) GetDep() []string
- func (x *Spec_Create_Build) GetExternalDep() []string
- func (x *Spec_Create_Build) GetExternalTool() []string
- func (x *Spec_Create_Build) GetInstall() []string
- func (x *Spec_Create_Build) GetNoDockerEnv() booldeprecated
- func (x *Spec_Create_Build) GetNoToolchain() booldeprecated
- func (x *Spec_Create_Build) GetTool() []string
- func (*Spec_Create_Build) ProtoMessage()
- func (x *Spec_Create_Build) ProtoReflect() protoreflect.Message
- func (x *Spec_Create_Build) Reset()
- func (x *Spec_Create_Build) String() string
- type Spec_Create_Package
- func (*Spec_Create_Package) Descriptor() ([]byte, []int)deprecated
- func (x *Spec_Create_Package) GetAdditionalRef() []string
- func (x *Spec_Create_Package) GetAlterVersionRe() string
- func (x *Spec_Create_Package) GetAlterVersionReplace() string
- func (x *Spec_Create_Package) GetDisableLatestRef() bool
- func (x *Spec_Create_Package) GetInstallMode() Spec_Create_Package_InstallMode
- func (x *Spec_Create_Package) GetVersionFile() string
- func (*Spec_Create_Package) ProtoMessage()
- func (x *Spec_Create_Package) ProtoReflect() protoreflect.Message
- func (x *Spec_Create_Package) Reset()
- func (x *Spec_Create_Package) String() string
- type Spec_Create_Package_InstallMode
- func (Spec_Create_Package_InstallMode) Descriptor() protoreflect.EnumDescriptor
- func (x Spec_Create_Package_InstallMode) Enum() *Spec_Create_Package_InstallMode
- func (Spec_Create_Package_InstallMode) EnumDescriptor() ([]byte, []int)deprecated
- func (x Spec_Create_Package_InstallMode) Number() protoreflect.EnumNumber
- func (x Spec_Create_Package_InstallMode) String() string
- func (Spec_Create_Package_InstallMode) Type() protoreflect.EnumType
- type Spec_Create_Source
- func (*Spec_Create_Source) Descriptor() ([]byte, []int)deprecated
- func (x *Spec_Create_Source) GetCipd() *CipdSource
- func (x *Spec_Create_Source) GetCpeBaseAddress() string
- func (x *Spec_Create_Source) GetGit() *GitSource
- func (m *Spec_Create_Source) GetMethod() isSpec_Create_Source_Method
- func (x *Spec_Create_Source) GetNoArchivePrune() bool
- func (x *Spec_Create_Source) GetPatchDir() []string
- func (x *Spec_Create_Source) GetPatchVersion() string
- func (x *Spec_Create_Source) GetScript() *ScriptSource
- func (x *Spec_Create_Source) GetSubdir() stringdeprecated
- func (x *Spec_Create_Source) GetUnpackArchive() bool
- func (x *Spec_Create_Source) GetUrl() *UrlSource
- func (*Spec_Create_Source) ProtoMessage()
- func (x *Spec_Create_Source) ProtoReflect() protoreflect.Message
- func (x *Spec_Create_Source) Reset()
- func (x *Spec_Create_Source) String() string
- type Spec_Create_Source_Cipd
- type Spec_Create_Source_Git
- type Spec_Create_Source_Script
- type Spec_Create_Source_Url
- type Spec_Create_Verify
- func (*Spec_Create_Verify) Descriptor() ([]byte, []int)deprecated
- func (x *Spec_Create_Verify) GetTest() []string
- func (*Spec_Create_Verify) ProtoMessage()
- func (x *Spec_Create_Verify) ProtoReflect() protoreflect.Message
- func (x *Spec_Create_Verify) Reset()
- func (x *Spec_Create_Verify) String() string
- type Spec_Upload
- func (*Spec_Upload) Descriptor() ([]byte, []int)deprecated
- func (x *Spec_Upload) GetPkgNameOverride() string
- func (x *Spec_Upload) GetPkgPrefix() string
- func (x *Spec_Upload) GetUniversal() bool
- func (*Spec_Upload) ProtoMessage()
- func (x *Spec_Upload) ProtoReflect() protoreflect.Message
- func (x *Spec_Upload) Reset()
- func (x *Spec_Upload) String() string
- type UrlSource
- func (*UrlSource) Descriptor() ([]byte, []int)deprecated
- func (x *UrlSource) GetDownloadUrl() string
- func (x *UrlSource) GetExtension() string
- func (x *UrlSource) GetVersion() string
- func (*UrlSource) ProtoMessage()
- func (x *UrlSource) ProtoReflect() protoreflect.Message
- func (x *UrlSource) Reset()
- func (x *UrlSource) String() string
Constants ¶
This section is empty.
Variables ¶
var ( Operator_name = map[int32]string{ 0: "UNKNOWN", 1: "LT", 2: "LE", 3: "GT", 4: "GE", 5: "EQ", 6: "NE", } Operator_value = map[string]int32{ "UNKNOWN": 0, "LT": 1, "LE": 2, "GT": 3, "GE": 4, "EQ": 5, "NE": 6, } )
Enum value maps for Operator.
var ( Spec_Create_Package_InstallMode_name = map[int32]string{ 0: "copy", 1: "symlink", } Spec_Create_Package_InstallMode_value = map[string]int32{ "copy": 0, "symlink": 1, } )
Enum value maps for Spec_Create_Package_InstallMode.
var (
ErrPackageNotAvailable = errors.New("package not available on the target platform")
)
var File_recipe_modules_support_3pp_spec_proto protoreflect.FileDescriptor
Functions ¶
func ProtoMerge ¶
ProtoMerge merges src into dst, which must be a message with the same descriptor.
Populated scalar fields in src are copied to dst, while populated singular messages in src are merged into dst by recursively calling Merge. The elements of every list field in src is appended to the corresponded list fields in dst. The entries of every map field in src is copied into the corresponding map field in dst, possibly replacing existing entries. The unknown fields of src are appended to the unknown fields of dst.
Types ¶
type CipdSource ¶
type CipdSource struct { // (required) The full CIPD package name of the source. Pkg string `protobuf:"bytes,1,opt,name=pkg,proto3" json:"pkg,omitempty"` // (required) A symver to use when this package is built without specifying // a version (e.g. as a dep for some other package). This will translate // to the CIPD tag of `version:$default_version`. // // Note if the value is "latest", we will get value from the tag "version" // of the cipd package with the ref "latest". DefaultVersion string `protobuf:"bytes,2,opt,name=default_version,json=defaultVersion,proto3" json:"default_version,omitempty"` // (required) The URL to the download page where we obtained this source. This // is required, but is not used as part of the build, it's purely for // documentation. OriginalDownloadUrl string `protobuf:"bytes,3,opt,name=original_download_url,json=originalDownloadUrl,proto3" json:"original_download_url,omitempty"` // contains filtered or unexported fields }
TODO: Not implemented in pkgbuild. No actual usage and not sure how useful considering BCID requirements. Someone has to upload the source into CIPD in this case.
CipdSource Pulls sources from a CIPD package.
func (*CipdSource) Descriptor
deprecated
func (*CipdSource) Descriptor() ([]byte, []int)
Deprecated: Use CipdSource.ProtoReflect.Descriptor instead.
func (*CipdSource) GetDefaultVersion ¶
func (x *CipdSource) GetDefaultVersion() string
func (*CipdSource) GetOriginalDownloadUrl ¶
func (x *CipdSource) GetOriginalDownloadUrl() string
func (*CipdSource) GetPkg ¶
func (x *CipdSource) GetPkg() string
func (*CipdSource) ProtoMessage ¶
func (*CipdSource) ProtoMessage()
func (*CipdSource) ProtoReflect ¶
func (x *CipdSource) ProtoReflect() protoreflect.Message
func (*CipdSource) Reset ¶
func (x *CipdSource) Reset()
func (*CipdSource) String ¶
func (x *CipdSource) String() string
type GitSource ¶
type GitSource struct { // (required) The URL to the repo, e.g. // // https://some.host.example.com/path/to/repo.git Repo string `protobuf:"bytes,1,opt,name=repo,proto3" json:"repo,omitempty"` // (optional) A substitution pattern where "%s" represents the location of the // symver in a tag name. // // This is used for filter git repo tags for symantic version numbers. Some // repos e.g. prefix their versions with `v`, or use other formats (e.g. // "release/1.2.3"). // // If omitted, this defaults to `%s` which would work for repos whose tags // look like `refs/tags/1.2.3`. // // For example, if this was `v%s`, then this would look for the version 1.2.3 // as `refs/tags/v1.2.3` TagPattern string `protobuf:"bytes,2,opt,name=tag_pattern,json=tagPattern,proto3" json:"tag_pattern,omitempty"` // (optional) A list of SemverRestriction's to restrict the semvars from // matched tags. You can use this to restrict which tags to consider when // calculated the 'latest' version available. // // Note that if you over-constrain this, 3pp will simply see no available tags // at all. VersionRestriction []*SemverRestriction `protobuf:"bytes,4,rep,name=version_restriction,json=versionRestriction,proto3" json:"version_restriction,omitempty"` // (optional) version_join is a string used to join the portions of a version // number together for repos which don't use "." as the joiner. // // If omitted, this defaults to ".", which would work for repos whose tags // look like `refs/tags/1.2.3`. // // For example, if this is "-", then the recipe would transform the symantic // version `1.2.3` into `1-2-3` before expanding it into tag_pattern to find // the matching git tag. VersionJoin string `protobuf:"bytes,3,opt,name=version_join,json=versionJoin,proto3" json:"version_join,omitempty"` // (optional) only consider tags that fully match this regular expression. TagFilterRe string `protobuf:"bytes,5,opt,name=tag_filter_re,json=tagFilterRe,proto3" json:"tag_filter_re,omitempty"` // (optional) If specified, rather than fetching the latest tag, fetch this // specific commit. This option is mutually exclusive with tag_pattern, // version_restriction, version_join, and tag_filter_re. FixedCommit string `protobuf:"bytes,6,opt,name=fixed_commit,json=fixedCommit,proto3" json:"fixed_commit,omitempty"` // contains filtered or unexported fields }
Pulls package sources from a git repo.
func (*GitSource) Descriptor
deprecated
func (*GitSource) GetFixedCommit ¶
func (*GitSource) GetTagFilterRe ¶
func (*GitSource) GetTagPattern ¶
func (*GitSource) GetVersionJoin ¶
func (*GitSource) GetVersionRestriction ¶
func (x *GitSource) GetVersionRestriction() []*SemverRestriction
func (*GitSource) ProtoMessage ¶
func (*GitSource) ProtoMessage()
func (*GitSource) ProtoReflect ¶
func (x *GitSource) ProtoReflect() protoreflect.Message
type Operator ¶
type Operator int32
func (Operator) Descriptor ¶
func (Operator) Descriptor() protoreflect.EnumDescriptor
func (Operator) EnumDescriptor
deprecated
func (Operator) Number ¶
func (x Operator) Number() protoreflect.EnumNumber
func (Operator) Type ¶
func (Operator) Type() protoreflect.EnumType
type ScriptSource ¶
type ScriptSource struct { // (required) Name (and args) of a script adjacent to 3pp.pb. // // For example if this is `["fetch.py", "foo"]`, then the recipe will // do: // // $ cd /nowhere/in/particular // $ vpython3 /path/to/repo/subdir/package_name/fetch.py foo latest // 1.2.3 // $ _3PP_VERSION=1.2.3 vpython3 \ // /path/to/repo/subdir/package_name/fetch.py foo get_url \ // /path/to/checkout // {"url": ["https://some_url/foo_1.2.3.zip"], "ext": ".zip"}' Name []string `protobuf:"bytes,1,rep,name=name,proto3" json:"name,omitempty"` // TODO(crbug.com/1185395): Implement a permanent solution for this flow. // (optional) Boolean to use fetch scripts to download artifacts. // // If present, the recipe will use fetch scripts to download artifacts via // calling the "checkout" option. // // By reusing the same example above, the recipe will do: // // $ cd /nowhere/in/particular // $ vpython3 /path/to/repo/subdir/package_name/fetch.py foo latest // 1.2.3 // $ _3PP_VERSION=1.2.3 vpython3 \ // /path/to/repo/subdir/package_name/fetch.py foo checkout \ // /path/to/checkout UseFetchCheckoutWorkflow bool `` /* 141-byte string literal not displayed */ // TODO: Not implemented in pkgbuild. No package infra 3pp package requires // extending verification timeout. Will be implement in the future for // chromium 3pp. // // (optional) Duration string for setting a custom timeout for // the source package verification on the backend. // // This is intended for packages with particularly large sources. // // Allowed units are 's', 'm', and 'h'. Defaults to '5m' in CIPD client code. VerificationTimeout string `protobuf:"bytes,1003,opt,name=verification_timeout,json=verificationTimeout,proto3" json:"verification_timeout,omitempty"` // contains filtered or unexported fields }
This is a custom catch-all script to probe for the latest version and obtain the latest sources.
This will be invoked as `script latest` and is expected to print to stdout the latest symver available (e.g. `1.2.3`). The $_3PP_VERSION environment variable is not present.
If this version needs to be fetched, the script will be invoked as `script get_url` and is expected to print to stdout a json string of the download manifest. For example:
{ "url": ["https://some_url/foo_1.2.3.zip"], "ext": ".zip", # optional when the extension is ".tar.gz", # ignored when "name" is present "name": ["foo.zip"] }
func (*ScriptSource) Descriptor
deprecated
func (*ScriptSource) Descriptor() ([]byte, []int)
Deprecated: Use ScriptSource.ProtoReflect.Descriptor instead.
func (*ScriptSource) GetName ¶
func (x *ScriptSource) GetName() []string
func (*ScriptSource) GetUseFetchCheckoutWorkflow ¶
func (x *ScriptSource) GetUseFetchCheckoutWorkflow() bool
func (*ScriptSource) GetVerificationTimeout ¶
func (x *ScriptSource) GetVerificationTimeout() string
func (*ScriptSource) ProtoMessage ¶
func (*ScriptSource) ProtoMessage()
func (*ScriptSource) ProtoReflect ¶
func (x *ScriptSource) ProtoReflect() protoreflect.Message
func (*ScriptSource) Reset ¶
func (x *ScriptSource) Reset()
func (*ScriptSource) String ¶
func (x *ScriptSource) String() string
type SemverRestriction ¶
type SemverRestriction struct { // The comparison operator to use with this restriction. Op Operator `protobuf:"varint,1,opt,name=op,proto3,enum=recipe_modules.infra.support_3pp.Operator" json:"op,omitempty"` // The value to compare the version to. Val string `protobuf:"bytes,2,opt,name=val,proto3" json:"val,omitempty"` // contains filtered or unexported fields }
SemverRestriction expresses a restriction on a semver.
When SemverRestriction is used to restrict some `$version`, it works like `$version $op $val`. So, if this was `{op: LT val: "1.0"}`, then:
- 1.1 would be excluded
- 0.9 would be included
- 0.9.9 would be included
NOTE: Release candidates sort LOWER than their symver prefix. For example, "1.0rc1" < "1.0". This makes sense if you think about it a bit, but it implies that if you want to exclude "1.x", you need a rule `{op: LT val: "1.0rc0"}`.
func (*SemverRestriction) Descriptor
deprecated
func (*SemverRestriction) Descriptor() ([]byte, []int)
Deprecated: Use SemverRestriction.ProtoReflect.Descriptor instead.
func (*SemverRestriction) GetOp ¶
func (x *SemverRestriction) GetOp() Operator
func (*SemverRestriction) GetVal ¶
func (x *SemverRestriction) GetVal() string
func (*SemverRestriction) ProtoMessage ¶
func (*SemverRestriction) ProtoMessage()
func (*SemverRestriction) ProtoReflect ¶
func (x *SemverRestriction) ProtoReflect() protoreflect.Message
func (*SemverRestriction) Reset ¶
func (x *SemverRestriction) Reset()
func (*SemverRestriction) String ¶
func (x *SemverRestriction) String() string
type Spec ¶
type Spec struct { // (required) How the package should be created. // // Multiple create messages can be specified, and they'll be combined together // into a single Create message via the rules described in Create.platform_re. // Required fields are checked on this combined Create message, so you can // have multiple partial messages which combine into a complete message. Create []*Spec_Create `protobuf:"bytes,1,rep,name=create,proto3" json:"create,omitempty"` // (required) Upload describes how the built package should be uploaded to // CIPD. Upload *Spec_Upload `protobuf:"bytes,2,opt,name=upload,proto3" json:"upload,omitempty"` // contains filtered or unexported fields }
The Spec for a third-party package fully describes how to:
- Fetch the package sources
- Build the sources
- Package the built product
- Verify the packaged product
- Upload the packaged product to CIPD
func (*Spec) Descriptor
deprecated
func (*Spec) GetCreate ¶
func (x *Spec) GetCreate() []*Spec_Create
func (*Spec) GetUpload ¶
func (x *Spec) GetUpload() *Spec_Upload
func (*Spec) ProtoMessage ¶
func (*Spec) ProtoMessage()
func (*Spec) ProtoReflect ¶
func (x *Spec) ProtoReflect() protoreflect.Message
type Spec_Create ¶
type Spec_Create struct { // (optional) The platform_re field in each Create message is applied as // a regex to ${platform}. Each matching Create message is applied in order // using dict.update for each member message (i.e. ['source'].update, // ['build'].update, etc.) to build a singular Create message for the // current platform. PlatformRe string `protobuf:"bytes,1,opt,name=platform_re,json=platformRe,proto3" json:"platform_re,omitempty"` // TODO: Not implemented in pkgbuild. Although global experimental mode is // removed, we will add per-package level experimental mode later. // // (optional) If true, then the recipe will treat this package/platform as // experimental. That is, it will prepend 'experimental/' to it's CIPD // package name. This is the same effect as running the entire recipe in // experimental mode, except on a per-package basis. The two experimental // prefixes do not stack :). Experimental bool `protobuf:"varint,2,opt,name=experimental,proto3" json:"experimental,omitempty"` // (optional) If true, all other fields are ignored and the recipe will // return an error indicating that this package isn't configured for the // current ${platform}. Unsupported bool `protobuf:"varint,3,opt,name=unsupported,proto3" json:"unsupported,omitempty"` // (required) How to obtain the source for this pkg. Source *Spec_Create_Source `protobuf:"bytes,4,opt,name=source,proto3" json:"source,omitempty"` // (optional) How to transform the source into the output pkg. // // If this message is entirely omitted, then the output of the source stage // will be used as the built result (useful for source packages, or python // packages which don't need massaging). // // If this message is present, the package will be built according to the // Build message. Build *Spec_Create_Build `protobuf:"bytes,5,opt,name=build,proto3" json:"build,omitempty"` // (optional) Options for creating a CIPD package from the built source. Package *Spec_Create_Package `protobuf:"bytes,6,opt,name=package,proto3" json:"package,omitempty"` // (optional) How to verify that the output pkg is useful. Verify *Spec_Create_Verify `protobuf:"bytes,7,opt,name=verify,proto3" json:"verify,omitempty"` // contains filtered or unexported fields }
Describes how to fetch+build+test the pkg.
All scripts are invoked with the following environment variables (unless noted otherwise):
- $_3PP_CIPD_PACKAGE_NAME - DEPRECATED and not implemented in pkgbuild. the CIPD package name, excluding the package_prefix and platform suffix. (if any patch version was set).
- $_3PP_PATCH_VERSION - the `patch_version` set for this create block
- $_3PP_PLATFORM - the platform we're targeting
- $_3PP_TOOL_PLATFORM - the platform that we're building on (will be different than _3PP_PLATFORM if we're cross-compiling)
- $_3PP_VERSION - the version we're building, e.g. 1.2.3
- $GOOS - The golang OS name we're targeting
- $GOARCH - The golang architecture we're targeting
- $MACOSX_DEPLOYMENT_TARGET - On OS X, set to 10.10, for your semi-up-to-date OS X building needs. This needs to be consistently set for all packages or it will cause linker warnings/errors when linking in static libs that were targeting a newer version (e.g. if it was left unset). Binaries built with this set to 10.10 will not run on 10.9 or older systems.
Additionally, on cross-compile environments, the $CROSS_TRIPLE environment variable is set to a GCC cross compile target triplet of cpu-vendor-os.
func MergeCreates ¶
func MergeCreates(host string, creates []*Spec_Create) (*Spec_Create, error)
MergeCreates merges create field in 3pp spec based on the host platform. If the package isn't supported on the host, ErrPackageNotAvailable will be returned.
func (*Spec_Create) Descriptor
deprecated
func (*Spec_Create) Descriptor() ([]byte, []int)
Deprecated: Use Spec_Create.ProtoReflect.Descriptor instead.
func (*Spec_Create) GetBuild ¶
func (x *Spec_Create) GetBuild() *Spec_Create_Build
func (*Spec_Create) GetExperimental ¶
func (x *Spec_Create) GetExperimental() bool
func (*Spec_Create) GetPackage ¶
func (x *Spec_Create) GetPackage() *Spec_Create_Package
func (*Spec_Create) GetPlatformRe ¶
func (x *Spec_Create) GetPlatformRe() string
func (*Spec_Create) GetSource ¶
func (x *Spec_Create) GetSource() *Spec_Create_Source
func (*Spec_Create) GetUnsupported ¶
func (x *Spec_Create) GetUnsupported() bool
func (*Spec_Create) GetVerify ¶
func (x *Spec_Create) GetVerify() *Spec_Create_Verify
func (*Spec_Create) ProtoMessage ¶
func (*Spec_Create) ProtoMessage()
func (*Spec_Create) ProtoReflect ¶
func (x *Spec_Create) ProtoReflect() protoreflect.Message
func (*Spec_Create) Reset ¶
func (x *Spec_Create) Reset()
func (*Spec_Create) String ¶
func (x *Spec_Create) String() string
type Spec_Create_Build ¶
type Spec_Create_Build struct { // (optional) Name (and args) of a script adjacent to 3pp.pb which knows // how to transform the source into the built product. // // If omitted, this defaults to `["install.sh"]`. // // Subsequent install args are passed to the script verbatim, followed by // a target `prefix` path to install the compiled package to, followed by // a path to a prefix containing all deps. The current directory is set to // the base directory of the source checkout (excluding subdir). Any // specified tools will be in $PATH (both '$tools' and '$tools/bin' are // added to $PATH, because many packages are set up with their binaries at // the base of the package, and some are set up with them in a /bin // folder). // // Scripts ending with .py will be invoked with vpython3 (on all // platforms). // Scripts ending with .sh will be invoked with bash (on all platforms). // // For Windows this uses the git-for-windows copy of bash, which is // mingw bash (in case you run into path issues, but since everything is // relative paths it should be pretty transparent). // // Other script suffixes are currently not supported. // // For example, if this is `["do_build.sh", "quickly"]`, then the recipe // will do: // // $ cd /path/to/checkout // $ export PATH=/path/to/tools_prefix:/path/to/tools_prefix/bin:$PATH // $ /path/to/checkout/.3pp/package_name/do_build.sh quickly \ // /path/to/output_prefix // /path/to/deps_prefix Install []string `protobuf:"bytes,1,rep,name=install,proto3" json:"install,omitempty"` // (optional) List of other 3pp packages built for the host and put in // $PATH. // // You may specify specific versions with the notation (useful if the // current tool you're building is self-bootstrapping, like cmake): // // <pkg_prefix>/<package_name>@version // // e.g. `tools/ninja@1.8.2` // // Tools are always used with the host's ${platform} value (e.g. if cross // compiling on linux, the tools will likely be for linux-amd64, // regardless of whatever cross compile target you're aiming for). // // If no cipd_version is specified, the recipe will use the cipd version // "latest". // // If tools have a specified version other than "latest", they are // required to be already built and present in CIPD. If they're "latest" // or unspecified, they may be built if they're not already in CIPD. Tool []string `protobuf:"bytes,2,rep,name=tool,proto3" json:"tool,omitempty"` // (optional) List of non-3pp packages to be installed as tools. // // These may reference an arbitrary CIPD package, including a 3pp package // from a different repo. A version tag is required, using the following // format: // // cipd/pkg/path@version // // e.g. `infra/tools/foo@1.3.1` // // The package path may contain ${platform} which will be expanded for the // host platform. ExternalTool []string `protobuf:"bytes,6,rep,name=external_tool,json=externalTool,proto3" json:"external_tool,omitempty"` // (optional) List of other 3pp packages built for the target and passed // to the install command. // // Unlike `tools`, these may not specify versions. The reason for this is // that the dependency graph gets too complicated for this simple 3pp // recipe to resolve. Instead, the versions used will be the version of // the `source` of the indicated deps. If you want to update the deps, // update their source entry to pull a different version. Dep []string `protobuf:"bytes,3,rep,name=dep,proto3" json:"dep,omitempty"` // (optional) List of non-3pp packages to be installed as deps. // // These may reference an arbitrary CIPD package, including a 3pp package // from a different repo. A version tag is required, using the following // format: // // cipd/pkg/path@version // // e.g. `infra/tools/foo@1.3.1` // // The package path may contain ${platform} which will be expanded for the // target platform. ExternalDep []string `protobuf:"bytes,7,rep,name=external_dep,json=externalDep,proto3" json:"external_dep,omitempty"` // (DEPRECATED): Not implemented in pkgbuild. // TODO: Docker env should be an optional dependency, not part of the // 3pp implementation. This could be easily replaced by making docker env // an explicit build dependency. // // The docker environments for linux-amd64 is very old (in order to // conform to PEP 513). As such, sometimes it's a hindrance for building // universal packages (such as those using nodejs), as they're so old that // node cannot run on them (!!). // // This option should be used VERY sparingly. A better solution would be // to: // - Separate the docker image creation from the `dockerbuild` tool // (maybe as a 3pp package?) and allow an explicit dependency on // a dockcross-derived image here. // - OR, switch away from dockerbuild images and use dockcross directly, // using the normal linux-x64 by default, and optionally being able to // explicitly choose the manylinux-x64 for packages that need it. // // Deprecated: Marked as deprecated in recipe_modules/support_3pp/spec.proto. NoDockerEnv bool `protobuf:"varint,4,opt,name=no_docker_env,json=noDockerEnv,proto3" json:"no_docker_env,omitempty"` // (DEPRECATED): Not implemented in pkgbuild. We are not sure whether this // is useful. Compiler toolchain should be only setup once anyway. // // If set, 3pp will not try to set up a compiler toolchain for this // package. You can use this if your package is repackaging a prebuilt // upstream package. // // Deprecated: Marked as deprecated in recipe_modules/support_3pp/spec.proto. NoToolchain bool `protobuf:"varint,5,opt,name=no_toolchain,json=noToolchain,proto3" json:"no_toolchain,omitempty"` // contains filtered or unexported fields }
func (*Spec_Create_Build) Descriptor
deprecated
func (*Spec_Create_Build) Descriptor() ([]byte, []int)
Deprecated: Use Spec_Create_Build.ProtoReflect.Descriptor instead.
func (*Spec_Create_Build) GetDep ¶
func (x *Spec_Create_Build) GetDep() []string
func (*Spec_Create_Build) GetExternalDep ¶
func (x *Spec_Create_Build) GetExternalDep() []string
func (*Spec_Create_Build) GetExternalTool ¶
func (x *Spec_Create_Build) GetExternalTool() []string
func (*Spec_Create_Build) GetInstall ¶
func (x *Spec_Create_Build) GetInstall() []string
func (*Spec_Create_Build) GetNoDockerEnv
deprecated
func (x *Spec_Create_Build) GetNoDockerEnv() bool
Deprecated: Marked as deprecated in recipe_modules/support_3pp/spec.proto.
func (*Spec_Create_Build) GetNoToolchain
deprecated
func (x *Spec_Create_Build) GetNoToolchain() bool
Deprecated: Marked as deprecated in recipe_modules/support_3pp/spec.proto.
func (*Spec_Create_Build) GetTool ¶
func (x *Spec_Create_Build) GetTool() []string
func (*Spec_Create_Build) ProtoMessage ¶
func (*Spec_Create_Build) ProtoMessage()
func (*Spec_Create_Build) ProtoReflect ¶
func (x *Spec_Create_Build) ProtoReflect() protoreflect.Message
func (*Spec_Create_Build) Reset ¶
func (x *Spec_Create_Build) Reset()
func (*Spec_Create_Build) String ¶
func (x *Spec_Create_Build) String() string
type Spec_Create_Package ¶
type Spec_Create_Package struct { // (optional) How the CIPD package should be installed on client machines. // // If omitted, this defaults to `copy`. InstallMode Spec_Create_Package_InstallMode `` /* 165-byte string literal not displayed */ // (optional) The CIPD-installation-relative path to a version file. // // If omitted, no version file will be added to the package. VersionFile string `protobuf:"bytes,2,opt,name=version_file,json=versionFile,proto3" json:"version_file,omitempty"` // TODO(crbug.com/349198727): Migrating to golang's re format instead. // Python’s re uses “\” to refer to captured groups while golang uses “$". // // (optional) The alter_version fields are used to change the version // number we tag in CIPD as `version`. This is useful for when the // upstream source versions vary across platforms (for example). // // This is applied like: // // re.sub( // alter_version_re, // alter_version_replace, // full_symver_without_patch_version) // // If these are specified, the uploaded package will also be tagged with // an additional tag `real_version`. This will be the original value of // `version` before transformation. AlterVersionRe string `protobuf:"bytes,3,opt,name=alter_version_re,json=alterVersionRe,proto3" json:"alter_version_re,omitempty"` AlterVersionReplace string `protobuf:"bytes,4,opt,name=alter_version_replace,json=alterVersionReplace,proto3" json:"alter_version_replace,omitempty"` // If set, skip updating the 'latest' ref to point to newly-built // packages using this spec. This may be useful if a spec is maintained // to continue building an older release track for a package. DisableLatestRef bool `protobuf:"varint,5,opt,name=disable_latest_ref,json=disableLatestRef,proto3" json:"disable_latest_ref,omitempty"` // Update the supplied CIPD refs whenever a new version of the package // is built. Note that 'latest' is always implicitly updated, unless // 'disable_latest_ref' is set to false. AdditionalRef []string `protobuf:"bytes,6,rep,name=additional_ref,json=additionalRef,proto3" json:"additional_ref,omitempty"` // contains filtered or unexported fields }
See CIPD documentation for specifics about these options.
func (*Spec_Create_Package) Descriptor
deprecated
func (*Spec_Create_Package) Descriptor() ([]byte, []int)
Deprecated: Use Spec_Create_Package.ProtoReflect.Descriptor instead.
func (*Spec_Create_Package) GetAdditionalRef ¶
func (x *Spec_Create_Package) GetAdditionalRef() []string
func (*Spec_Create_Package) GetAlterVersionRe ¶
func (x *Spec_Create_Package) GetAlterVersionRe() string
func (*Spec_Create_Package) GetAlterVersionReplace ¶
func (x *Spec_Create_Package) GetAlterVersionReplace() string
func (*Spec_Create_Package) GetDisableLatestRef ¶
func (x *Spec_Create_Package) GetDisableLatestRef() bool
func (*Spec_Create_Package) GetInstallMode ¶
func (x *Spec_Create_Package) GetInstallMode() Spec_Create_Package_InstallMode
func (*Spec_Create_Package) GetVersionFile ¶
func (x *Spec_Create_Package) GetVersionFile() string
func (*Spec_Create_Package) ProtoMessage ¶
func (*Spec_Create_Package) ProtoMessage()
func (*Spec_Create_Package) ProtoReflect ¶
func (x *Spec_Create_Package) ProtoReflect() protoreflect.Message
func (*Spec_Create_Package) Reset ¶
func (x *Spec_Create_Package) Reset()
func (*Spec_Create_Package) String ¶
func (x *Spec_Create_Package) String() string
type Spec_Create_Package_InstallMode ¶
type Spec_Create_Package_InstallMode int32
const ( Spec_Create_Package_copy Spec_Create_Package_InstallMode = 0 Spec_Create_Package_symlink Spec_Create_Package_InstallMode = 1 )
func (Spec_Create_Package_InstallMode) Descriptor ¶
func (Spec_Create_Package_InstallMode) Descriptor() protoreflect.EnumDescriptor
func (Spec_Create_Package_InstallMode) Enum ¶
func (x Spec_Create_Package_InstallMode) Enum() *Spec_Create_Package_InstallMode
func (Spec_Create_Package_InstallMode) EnumDescriptor
deprecated
func (Spec_Create_Package_InstallMode) EnumDescriptor() ([]byte, []int)
Deprecated: Use Spec_Create_Package_InstallMode.Descriptor instead.
func (Spec_Create_Package_InstallMode) Number ¶
func (x Spec_Create_Package_InstallMode) Number() protoreflect.EnumNumber
func (Spec_Create_Package_InstallMode) String ¶
func (x Spec_Create_Package_InstallMode) String() string
func (Spec_Create_Package_InstallMode) Type ¶
func (Spec_Create_Package_InstallMode) Type() protoreflect.EnumType
type Spec_Create_Source ¶
type Spec_Create_Source struct { // (required) Source messages must have one of these methods. // In case multiple approaches are possible, prefer using one of the // approaches in the following order: git, url, script, cipd. // // Types that are assignable to Method: // // *Spec_Create_Source_Git // *Spec_Create_Source_Cipd // *Spec_Create_Source_Script // *Spec_Create_Source_Url Method isSpec_Create_Source_Method `protobuf_oneof:"method"` // (DEPRECATED): Not implemented in pkgbuild. Doesn’t seem to be useful // after everyone moved to go mod. // // (optional) Run checkout in this subdirectory of the install script's // $CWD. // // Useful for e.g. Go packages, where you want the install script to run // in a parent directory of the go checkout. // // For example if this is `go/src/repo.com`, and you're using a `git` // source method then the files in the git repo will be checked out to // `/path/to/checkout/go/src/repo.com`, but the install script will still // run in `/path/to/checkout`. // // Deprecated: Marked as deprecated in recipe_modules/support_3pp/spec.proto. Subdir string `protobuf:"bytes,5,opt,name=subdir,proto3" json:"subdir,omitempty"` // (optional) If set to true, the recipe will find and unpack it all // archives fetched. // - Archives must be .zip or a well-known tarball extension (supporting // either none, gzip, bzip2, lzma/xz, or zstandard compression). // - The recipe will delete any other files in this directory prior to // unpacking the archives. // - If there's only a single archive, the builder will also cd down // into singular directories until there are multiple files before // invoking the install script. (In previous versions of the 3pp // builder, the parent directories were actually removed ('pruned'). // If you run into a case where this behavior is undesired, set // `no_archive_prune` to true. If more than one archive is produced, // this setting has no effect. UnpackArchive bool `protobuf:"varint,6,opt,name=unpack_archive,json=unpackArchive,proto3" json:"unpack_archive,omitempty"` NoArchivePrune bool `protobuf:"varint,7,opt,name=no_archive_prune,json=noArchivePrune,proto3" json:"no_archive_prune,omitempty"` // (optional) Directories relative to the project folder holding patches // to apply with "git apply". // // All patches in the directories will be applied, in alphanumeric order, // after unpacking the archive (if any). // // This is provided as a list option so that different sets of patches can // be applied for different values of ${platform}, possibly with some // overlapping base patches. PatchDir []string `protobuf:"bytes,8,rep,name=patch_dir,json=patchDir,proto3" json:"patch_dir,omitempty"` // (optional) Used to differentiate from the stock symver during // compilation and in the generated CIPD package tags. // // For example, if this is `my_org1`, and we were building `1.2.3` of the // source, then this would upload with the CIPD tag of // `version:1.2.3.my_org1` PatchVersion string `protobuf:"bytes,9,opt,name=patch_version,json=patchVersion,proto3" json:"patch_version,omitempty"` // (required) Base address for constructing a Common Platform Enumeration // (https://csrc.nist.gov/projects/security-content-automation-protocol/specifications/cpe) // specification for this package. CpeBaseAddress string `protobuf:"bytes,10,opt,name=cpe_base_address,json=cpeBaseAddress,proto3" json:"cpe_base_address,omitempty"` // contains filtered or unexported fields }
func (*Spec_Create_Source) Descriptor
deprecated
func (*Spec_Create_Source) Descriptor() ([]byte, []int)
Deprecated: Use Spec_Create_Source.ProtoReflect.Descriptor instead.
func (*Spec_Create_Source) GetCipd ¶
func (x *Spec_Create_Source) GetCipd() *CipdSource
func (*Spec_Create_Source) GetCpeBaseAddress ¶
func (x *Spec_Create_Source) GetCpeBaseAddress() string
func (*Spec_Create_Source) GetGit ¶
func (x *Spec_Create_Source) GetGit() *GitSource
func (*Spec_Create_Source) GetMethod ¶
func (m *Spec_Create_Source) GetMethod() isSpec_Create_Source_Method
func (*Spec_Create_Source) GetNoArchivePrune ¶
func (x *Spec_Create_Source) GetNoArchivePrune() bool
func (*Spec_Create_Source) GetPatchDir ¶
func (x *Spec_Create_Source) GetPatchDir() []string
func (*Spec_Create_Source) GetPatchVersion ¶
func (x *Spec_Create_Source) GetPatchVersion() string
func (*Spec_Create_Source) GetScript ¶
func (x *Spec_Create_Source) GetScript() *ScriptSource
func (*Spec_Create_Source) GetSubdir
deprecated
func (x *Spec_Create_Source) GetSubdir() string
Deprecated: Marked as deprecated in recipe_modules/support_3pp/spec.proto.
func (*Spec_Create_Source) GetUnpackArchive ¶
func (x *Spec_Create_Source) GetUnpackArchive() bool
func (*Spec_Create_Source) GetUrl ¶
func (x *Spec_Create_Source) GetUrl() *UrlSource
func (*Spec_Create_Source) ProtoMessage ¶
func (*Spec_Create_Source) ProtoMessage()
func (*Spec_Create_Source) ProtoReflect ¶
func (x *Spec_Create_Source) ProtoReflect() protoreflect.Message
func (*Spec_Create_Source) Reset ¶
func (x *Spec_Create_Source) Reset()
func (*Spec_Create_Source) String ¶
func (x *Spec_Create_Source) String() string
type Spec_Create_Source_Cipd ¶
type Spec_Create_Source_Cipd struct {
Cipd *CipdSource `protobuf:"bytes,2,opt,name=cipd,proto3,oneof"`
}
type Spec_Create_Source_Git ¶
type Spec_Create_Source_Git struct {
Git *GitSource `protobuf:"bytes,1,opt,name=git,proto3,oneof"`
}
type Spec_Create_Source_Script ¶
type Spec_Create_Source_Script struct {
Script *ScriptSource `protobuf:"bytes,3,opt,name=script,proto3,oneof"`
}
type Spec_Create_Source_Url ¶
type Spec_Create_Source_Url struct {
Url *UrlSource `protobuf:"bytes,4,opt,name=url,proto3,oneof"`
}
type Spec_Create_Verify ¶
type Spec_Create_Verify struct { // (required) Name (and args) of a script adjacent to 3pp.pb. // // Invoked after package with the built cipd package file as the first // additional arg. $CWD is set to an empty folder that the test can use // for scratch space, if it likes. // // For example if this is `["test.py", "extra_arg"]`, then the recipe will // do: // // $ cd /path/to/verify // $ vpython3 /path/to/repo/subdir/package_name/test.py extra_arg \ // /path/to/built/cipd/package Test []string `protobuf:"bytes,1,rep,name=test,proto3" json:"test,omitempty"` // contains filtered or unexported fields }
func (*Spec_Create_Verify) Descriptor
deprecated
func (*Spec_Create_Verify) Descriptor() ([]byte, []int)
Deprecated: Use Spec_Create_Verify.ProtoReflect.Descriptor instead.
func (*Spec_Create_Verify) GetTest ¶
func (x *Spec_Create_Verify) GetTest() []string
func (*Spec_Create_Verify) ProtoMessage ¶
func (*Spec_Create_Verify) ProtoMessage()
func (*Spec_Create_Verify) ProtoReflect ¶
func (x *Spec_Create_Verify) ProtoReflect() protoreflect.Message
func (*Spec_Create_Verify) Reset ¶
func (x *Spec_Create_Verify) Reset()
func (*Spec_Create_Verify) String ¶
func (x *Spec_Create_Verify) String() string
type Spec_Upload ¶
type Spec_Upload struct { // (required) The CIPD package name prefix to use when uploading. // // This is used as: // // <pkg_prefix>/<pkg_name>/${platform} // // e.g. with the prefix `pkg/prefix` for the package `cool_thing`, you'd // get: // // pkg/prefix/cool_thing/${platform} PkgPrefix string `protobuf:"bytes,1,opt,name=pkg_prefix,json=pkgPrefix,proto3" json:"pkg_prefix,omitempty"` // (optional) If set, then the output of the build is intended to be used by // all platforms, and so the package we upload to will exclude the normal // `${platform}` suffix. This will also cause the build for this package to // ALWAYS run under the `linux-amd64` docker container (for consistency). Universal bool `protobuf:"varint,2,opt,name=universal,proto3" json:"universal,omitempty"` // Ordinarily the package name is automatically computed using the spec // file path. pkg_name_override can be set to force a specific package name // in CIPD. // // The override is used only at upload time, so when specifying // dependencies or the packages passed to ensure_upload(), use the standard // package name. PkgNameOverride string `protobuf:"bytes,3,opt,name=pkg_name_override,json=pkgNameOverride,proto3" json:"pkg_name_override,omitempty"` // contains filtered or unexported fields }
func (*Spec_Upload) Descriptor
deprecated
func (*Spec_Upload) Descriptor() ([]byte, []int)
Deprecated: Use Spec_Upload.ProtoReflect.Descriptor instead.
func (*Spec_Upload) GetPkgNameOverride ¶
func (x *Spec_Upload) GetPkgNameOverride() string
func (*Spec_Upload) GetPkgPrefix ¶
func (x *Spec_Upload) GetPkgPrefix() string
func (*Spec_Upload) GetUniversal ¶
func (x *Spec_Upload) GetUniversal() bool
func (*Spec_Upload) ProtoMessage ¶
func (*Spec_Upload) ProtoMessage()
func (*Spec_Upload) ProtoReflect ¶
func (x *Spec_Upload) ProtoReflect() protoreflect.Message
func (*Spec_Upload) Reset ¶
func (x *Spec_Upload) Reset()
func (*Spec_Upload) String ¶
func (x *Spec_Upload) String() string
type UrlSource ¶
type UrlSource struct { // (required) The URL to the download page where we obtained this source. This // is required and used to fetch source. DownloadUrl string `protobuf:"bytes,1,opt,name=download_url,json=downloadUrl,proto3" json:"download_url,omitempty"` // (required) The version of the package source fetched from `download_url`. // Please make sure those two are in sync. // TODO(akashmukherjee): Implement a presubmit check to make sure of the sync. // // For example: // // source { // url { // download_url: "https://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz" // version: "2.69" // } // } // // This version may also be used when this package is built without version // specified (e.g. as a dep of other packages). This matches the current // CIPDSource behavior. Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"` // Most of the side loaded sources use `.tar.gz` file extension, however // some source artifacts use other. In order to prevent alteration of the // source artifact when we cache sources, we need extension field passed // via the spec. // If not passed, 3pp will use default .tar.gz extension. Extension string `protobuf:"bytes,3,opt,name=extension,proto3" json:"extension,omitempty"` // contains filtered or unexported fields }
This will provide a original download url to fetch sources from third party.
This will be used for replacement of CipdSource where packages are manually uploaded to cipd.
func (*UrlSource) Descriptor
deprecated
func (*UrlSource) GetDownloadUrl ¶
func (*UrlSource) GetExtension ¶
func (*UrlSource) GetVersion ¶
func (*UrlSource) ProtoMessage ¶
func (*UrlSource) ProtoMessage()
func (*UrlSource) ProtoReflect ¶
func (x *UrlSource) ProtoReflect() protoreflect.Message
Directories
¶
Path | Synopsis |
---|---|
Package loader provides SpecLoader for loading 3pp specs and converting them into stdenv.Generator.
|
Package loader provides SpecLoader for loading 3pp specs and converting them into stdenv.Generator. |
Package source provides LoadSource reads, writes and updates source information.
|
Package source provides LoadSource reads, writes and updates source information. |