bundle

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResolveDeps

func ResolveDeps(workspacePacks, allPacks []*pack.Pack) error

ResolveDeps populates the Deps field on each workspace pack by looking up dependencies in the combined allPacks slice (workspace + bundle packs).

func ValidatePlatforms

func ValidatePlatforms(platforms []string) error

ValidatePlatforms checks that each platform is one of linux64/osx64/win64.

Types

type CreateOptions

type CreateOptions struct {
	// BundlePath is the path to the base CodeQL bundle archive (.tar.gz).
	BundlePath string
	// WorkspaceDir is the CodeQL workspace containing the packs to add.
	WorkspaceDir string
	// Packs is the resolved set of workspace packs to include in the bundle.
	Packs []*pack.Pack
	// OutputPath is where the resulting bundle archive is written.
	// If Platforms is non-empty, this is treated as a directory; otherwise as a file path.
	OutputPath string
	// Platforms restricts output to specific platforms ("linux64", "osx64", "win64").
	// Empty means a single platform-agnostic bundle.
	Platforms []string
	// NoPrecompile skips pre-compilation when bundling packs.
	NoPrecompile bool
	// Minimal creates a minimal bundle with only the selected packs and no additional
	// dependencies. Currently a no-op; reserved for future use.
	Minimal bool
}

CreateOptions controls how the custom bundle is built.

func NewCreateOptions

func NewCreateOptions(base, bundlePath, output string, noPrecompile, minimal bool, platforms []string) (*CreateOptions, error)

type CustomBundle

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

func NewCustomBundle

func NewCustomBundle(opts *CreateOptions, tmpDir string) *CustomBundle

func (*CustomBundle) Create

func (ctx *CustomBundle) Create() error

Create builds a custom CodeQL bundle by extending the base bundle with the configured workspace packs. The flow is:

  1. Extract the base bundle into a temp directory.
  2. Clear the bundle's qlpacks/ directory (a clean slate; stdlib deps are restored in step 6).
  3. For each workspace pack, copy it under <tmp>/temp and run `codeql pack install --common-caches=<tmp>/common-caches` then `codeql pack create --output=<qlpacksDir> --common-caches=<tmp>/common-caches`.
  4. Copy <tmp>/common-caches/packages/* into <qlpacksDir> so the bundle contains every resolved dependency.
  5. Repack the modified bundle, either as a single archive or one per requested platform.

Customization packs are skipped with a warning (future work).

type PackProcessor

type PackProcessor interface {
	Process(p *pack.Pack) error
}

PackProcessor encapsulates the build-time handling of a single workspace pack while assembling a custom CodeQL bundle. Each pack kind has its own implementation, selected once at pack-discovery time so the orchestrator loop in CustomBundle.Create can call Process without further dispatch.

Jump to

Keyboard shortcuts

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