This builder launches a one-off build container using Dockerode.

Hierarchy

Constructors

  • Parameters

    • opts: Partial<{
          builder: string;
          caching: boolean;
          dockerImage: "ghcr.io/hackbg/fadroma:master";
          dockerSocket: "/var/run/docker.sock";
          dockerfile: string;
          noFetch: false;
          outputDir: string;
          outputGid: undefined | string;
          outputUid: undefined | string;
          podman: false;
          preferredRemote: undefined | string;
          quiet: false;
          raw: false;
          script: string;
          sshAuthSocket: undefined | string;
          toolchain: "";
          verbose: false;
          workspace: string;
      } & {
          docker?: Engine;
      }> = {}

    Returns BuildContainer

Properties

buildGid?: number = ...

Owner gid that is set on build artifacts.

buildUid?: number = ...

Owner uid that is set on build artifacts.

caching: boolean = true

Whether to enable build caching. When set to false, this builder will rebuild even when binary and checksum are both present in wasm/ directory

docker: Engine

Used to launch build container.

dockerfile: string

Path to the dockerfile to build the build container if missing.

id: "Container" = 'Container'

Unique identifier of this builder implementation.

image: Image

Tag of the docker image for the build container.

log: BuildConsole = ...

Logger

noFetch: boolean = false

Whether to skip any git fetch calls in the build script.

outputDir: OpaqueDirectory

Name of directory where build artifacts are collected.

preferredRemote: string = 'origin'

Used for historical builds.

quiet: boolean = false

Whether the build log should be printed only on error, or always

revision: string = HEAD

Default Git reference from which to build sources.

script?: string

The build script.

sshAuthSocket?: string

Used to authenticate Git in build container.

toolchain: null | string = null

Version of Rust toolchain to use.

verbose: boolean = false

Whether the build process should print more detail to the console.

workspace?: string

The project workspace.

variants: Record<string, BuilderClass<Builder>> = {}

Global registry of builder variants. Populated downstream.

Accessors

Methods

  • Parameters

    • inputs: Buildable[]
    • path: string
    • rev: string = HEAD

    Returns Promise<void>

  • Parameters

    • crates: string[]
    • code: string | number
    • logs: string

    Returns void

  • This implementation groups the passed source by workspace and ref, in order to launch one build container per workspace/ref combination and have it build all the crates from that combination in sequence, reusing the container's internal intermediate build cache.

    Parameters

    Returns Promise<Built[]>

  • Go over the list of inputs, filtering out the ones that are already built, and collecting the source repositories and revisions. This will allow for multiple crates from the same source checkout to be passed to a single build command.

    Parameters

    Returns Set<string>[]

  • Parameters

    • outputDir: string
    • revision: string
    • crates: [number, string][]

    Returns (Record<string, number> | (null | Built)[])[]

  • Parameters

    • gitDir: Path
    • remote: string

    Returns Promise<void>

  • Parameters

    • subdir: string
    • gitSubdir: string

    Returns Record<string, string>

  • Parameters

    • revision: string
    • cb: ((data) => void)
        • (data): void
        • Parameters

          • data: string

          Returns void

    Returns LineTransformStream

  • Parameters

    • buildScript: string
    • root: string
    • outputDir: string
    • safeRef: string

    Returns {
        readonly: Record<string, string>;
        writable: Record<string, string>;
    }

    • readonly: Record<string, string>
    • writable: Record<string, string>
  • Parameters

    • subdir: string
    • gitSubdir: string
    • ro: Record<string, string>
    • rw: Record<string, string>

    Returns {
        cwd: string;
        env: Record<string, string>;
        extra: {
            AttachStdin: boolean;
            Tty: boolean;
        };
        readonly: Record<string, string>;
        remove: boolean;
        writable: Record<string, string>;
    }

    • cwd: string
    • env: Record<string, string>
    • extra: {
          AttachStdin: boolean;
          Tty: boolean;
      }
      • AttachStdin: boolean
      • Tty: boolean
    • readonly: Record<string, string>
    • remove: boolean
    • writable: Record<string, string>
  • Parameters

    • paths: Set<string>
    • root: Path

    Returns [Path, string]

  • Parameters

    • location: string | Path

    Returns string

    the SHA256 hash of the file at the specified location

  • Parameters

    • buildContainer: Container

    Returns Promise<void>

  • Match each crate from the current repo/ref pair with its index in the originally passed list of inputs.

    Parameters

    • inputs: Buildable[]
    • path: string
    • rev: string

    Returns [number, string][]

  • Check if artifact exists in local artifacts cache directory. If it does, don't rebuild it but return it from there.

    Parameters

    • outputDir: string
    • Optional crate: string
    • revision: string = HEAD

    Returns null | Built

  • Build the crates from each same workspace/revision pair and collect the results.

    Parameters

    • root: string
    • subdir: string
    • rev: string
    • crates: [number, string][]
    • gitSubDir: string = ''
    • outputDir: string = ...

    Returns Promise<(null | Built)[]>

Generated using TypeDoc