Help us shape the future of Go! Take the 2026 Go Developer Survey

bldr_dist

package
v0.57.21 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

README

Distribution resources

A native distribution directory contains the executable and assets.kvfile. Distribute and install the directory together. The executable resolves the volume beside its actual executable path, including when launched through a symlink or from another working directory. Application bundles should keep the volume beside their contained executable.

The volume holds the distribution's World and plugin manifests. It stays out of Go package archives, so editing assets does not make the Go compiler cache another copy of the payload. Small bootstrap configuration remains embedded. The existing block reader opens the volume lazily and checks that the expected root exists. A missing or mismatched volume fails startup.

Set embed_native_volume: "ENABLE" on the dist compiler config to embed the volume inside the native executable. The executable then runs without the sidecar file, which keeps self-contained distributions working when an installer or updater replaces only the executable. The default keeps the volume external so existing packaging is unaffected.

Web distributions continue to serve their volume separately through the browser range reader. Both packers include reachable blocks only; unrelated blocks left in a build store do not become distribution assets.

Set SOURCE_DATE_EPOCH to a fixed Unix timestamp for reproducible manifest construction and distribution copying. Without it, the builder uses the current time. Reproducibility also requires identical source manifests, configuration, and toolchain inputs. Existing installed binaries keep their original embedded resources; this layout applies to newly built native distributions.

Documentation

Index

Constants

View Source
const (
	// EntrypointRoleDesktop identifies the native desktop UI entrypoint.
	EntrypointRoleDesktop = "desktop"
	// EntrypointRoleBrowser identifies the browser/CDN entrypoint.
	EntrypointRoleBrowser = "browser"
	// EntrypointRoleCLI identifies the managed CLI entrypoint.
	EntrypointRoleCLI = "cli"
)
View Source
const DistWorldEngineID = "dist"

DistWorldEngineID is the world engine id on the bus for the dist bundle.

View Source
const StaticBlockStoreID = "entrypoint"

StaticBlockStoreID is the BlockStoreId for the StaticBlockStore.

Variables

This section is empty.

Functions

func GetDistBucketID

func GetDistBucketID(projectID string) string

GetDistBucketID returns the bucket id for a project id dist.

func NewDistBucketConfig

func NewDistBucketConfig(projectID string) (*bucket.Config, error)

NewDistBucketConfig returns the bucket config for a project id dist.

func ParsePluginHostObjectKey

func ParsePluginHostObjectKey(key string) (*hash.Hash, error)

ParsePluginHostObjectKey reads the distribution identity from a plugin cache key.

func PluginHostObjectKey

func PluginHostObjectKey(meta *DistMeta) (string, error)

PluginHostObjectKey scopes cached plugin selections to the distribution's embedded manifest World, platform and channel. Artifact revision counters are local to a producer and cannot establish compatibility across installations.

Types

type DistMeta

type DistMeta struct {

	// ProjectId is the project identifier.
	// Must be a valid-dns-label.
	// Used to construct the application storage and dist bundle filenames.
	ProjectId string `protobuf:"bytes,1,opt,name=project_id,json=projectId,proto3" json:"projectId,omitempty"`
	// PlatformId is the destination platform ID.
	PlatformId string `protobuf:"bytes,2,opt,name=platform_id,json=platformId,proto3" json:"platformId,omitempty"`
	// StartupPlugins is the list of plugins to run on startup.
	StartupPlugins []string `protobuf:"bytes,3,rep,name=startup_plugins,json=startupPlugins,proto3" json:"startupPlugins,omitempty"`
	// DistWorldRef is the root object ref to the static assets kvfile block-backed world.
	// Contains the transform configuration.
	DistWorldRef *bucket.ObjectRef `protobuf:"bytes,4,opt,name=dist_world_ref,json=distWorldRef,proto3" json:"distWorldRef,omitempty"`
	// DistObjectKey is the root object key to search for manifests in the dist world.
	DistObjectKey string `protobuf:"bytes,5,opt,name=dist_object_key,json=distObjectKey,proto3" json:"distObjectKey,omitempty"`
	// EntrypointRole is the release role for this entrypoint.
	// Expected values are "desktop", "browser", and "cli".
	EntrypointRole string `protobuf:"bytes,6,opt,name=entrypoint_role,json=entrypointRole,proto3" json:"entrypointRole,omitempty"`
	// ChannelKey is the release channel this entrypoint was built for.
	ChannelKey string `protobuf:"bytes,7,opt,name=channel_key,json=channelKey,proto3" json:"channelKey,omitempty"`
	// ManifestId is the Bldr Manifest id for this entrypoint binary.
	ManifestId string `protobuf:"bytes,8,opt,name=manifest_id,json=manifestId,proto3" json:"manifestId,omitempty"`
	// ManifestRev is the Bldr Manifest revision for this entrypoint binary.
	ManifestRev uint64 `protobuf:"varint,9,opt,name=manifest_rev,json=manifestRev,proto3" json:"manifestRev,omitempty"`
	// UpdateGuardPluginIds name plugins that quiesce owned work before replacement.
	UpdateGuardPluginIds []string `protobuf:"bytes,10,rep,name=update_guard_plugin_ids,json=updateGuardPluginIds,proto3" json:"updateGuardPluginIds,omitempty"`
	// contains filtered or unexported fields
}

DistMeta is metadata embedded in a distribution entrypoint.

func NewDistEntrypointMeta added in v0.52.0

func NewDistEntrypointMeta(
	projectID string,
	platformID string,
	startupPlugins []string,
	distWorldRef *bucket.ObjectRef,
	distObjKey string,
	entrypointRole string,
	channelKey string,
	manifestID string,
	manifestRev uint64,
) *DistMeta

NewDistEntrypointMeta constructs a new DistMeta with entrypoint identity.

func NewDistMeta

func NewDistMeta(projectID, platformID string, startupPlugins []string, distWorldRef *bucket.ObjectRef, distObjKey string) *DistMeta

NewDistMeta constructs a new DistMeta.

func UnmarshalDistMetaB58

func UnmarshalDistMetaB58(str string) (*DistMeta, error)

UnmarshalDistMetaB58 unmarshals a b58 dist meta. Note: we compress with s2 compression.

func (*DistMeta) CloneMessageVT

func (m *DistMeta) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*DistMeta) CloneVT

func (m *DistMeta) CloneVT() *DistMeta

func (*DistMeta) EqualMessageVT

func (this *DistMeta) EqualMessageVT(thatMsg any) bool

func (*DistMeta) EqualVT

func (this *DistMeta) EqualVT(that *DistMeta) bool

func (*DistMeta) GetChannelKey added in v0.52.0

func (x *DistMeta) GetChannelKey() string

func (*DistMeta) GetDistObjectKey

func (x *DistMeta) GetDistObjectKey() string

func (*DistMeta) GetDistWorldRef

func (x *DistMeta) GetDistWorldRef() *bucket.ObjectRef

func (*DistMeta) GetEntrypointRole added in v0.52.0

func (x *DistMeta) GetEntrypointRole() string

func (*DistMeta) GetManifestId added in v0.52.0

func (x *DistMeta) GetManifestId() string

func (*DistMeta) GetManifestRev added in v0.52.0

func (x *DistMeta) GetManifestRev() uint64

func (*DistMeta) GetPlatformId

func (x *DistMeta) GetPlatformId() string

func (*DistMeta) GetProjectId

func (x *DistMeta) GetProjectId() string

func (*DistMeta) GetStartupPlugins

func (x *DistMeta) GetStartupPlugins() []string

func (*DistMeta) GetUpdateGuardPluginIds

func (x *DistMeta) GetUpdateGuardPluginIds() []string

func (*DistMeta) MarshalB58

func (m *DistMeta) MarshalB58() string

MarshalB58 marshals the conf to a b58 string. note: we compress with s2 compression.

func (*DistMeta) MarshalJSON

func (x *DistMeta) MarshalJSON() ([]byte, error)

MarshalJSON marshals the DistMeta to JSON.

func (*DistMeta) MarshalProtoJSON

func (x *DistMeta) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the DistMeta message to JSON.

func (*DistMeta) MarshalProtoText

func (x *DistMeta) MarshalProtoText() string

func (*DistMeta) MarshalToSizedBufferVT

func (m *DistMeta) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*DistMeta) MarshalToVT

func (m *DistMeta) MarshalToVT(dAtA []byte) (int, error)

func (*DistMeta) MarshalVT

func (m *DistMeta) MarshalVT() (dAtA []byte, err error)

func (*DistMeta) ProtoMessage

func (*DistMeta) ProtoMessage()

func (*DistMeta) Reset

func (x *DistMeta) Reset()

func (*DistMeta) SizeVT

func (m *DistMeta) SizeVT() (n int)

func (*DistMeta) String

func (x *DistMeta) String() string

func (*DistMeta) UnmarshalJSON

func (x *DistMeta) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the DistMeta from JSON.

func (*DistMeta) UnmarshalProtoJSON

func (x *DistMeta) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the DistMeta message from JSON.

func (*DistMeta) UnmarshalVT

func (m *DistMeta) UnmarshalVT(dAtA []byte) error

func (*DistMeta) Validate

func (m *DistMeta) Validate() error

Validate checks the dist meta.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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