Documentation
¶
Overview ¶
Package builder compiles a module's RPG sources into ILE objects on an IBM i host, extracts the service program signature, and packages a SAVF.
It drives the host directly with CL (no Bob dependency): upload source over SFTP, CRTRPGMOD + CRTSRVPGM, read the signature via DSPSRVPGM, then SAVOBJ -> CPYTOSTMF -> download.
Package builder compiles module sources into ILE objects in dependency order, generates the *BNDDIR from the manifest, computes the *SRVPGM signature, and packages a SAVF. It wraps Bob (ibmi-bob) where that adds value.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CL ¶
CL runs a single CL command and returns an error on a transport failure or a non-zero CL exit. Shared with other packages that drive the host (e.g. deploy). On CL failure the error includes the IBM i diagnostics found in the output.
func DeterministicSignature ¶
DeterministicSignature derives a stable 16-byte signature (32 hex chars) from the module name and MAJOR version. It is stable across minor/patch releases (binary-compatible) and changes only on a major bump (breaking).
func FormatDiagnostics ¶
FormatDiagnostics builds a readable failure message from a command's output. It surfaces the IBM i message ids found; if none, it falls back to the raw trimmed output so nothing is hidden.
Types ¶
type Diagnostic ¶
Diagnostic is one IBM i message extracted from command output.
func ParseDiagnostics ¶
func ParseDiagnostics(output string) []Diagnostic
ParseDiagnostics extracts distinct IBM i messages from command output (stdout+stderr of a `system "..."` call), preserving order. The text is the trimmed line the id appeared on.
type Host ¶
type Host interface {
Run(cmd string) (transport.Result, error)
RunCL(cl string) (transport.Result, error)
Upload(localPath, remotePath string) error
Download(remotePath, localPath string) error
}
Host is the slice of the SSH transport the builder needs.
type Options ¶
type Options struct {
Manifest *manifest.Manifest
SourceDir string // local dir holding the module's source files
TargetLib string // IBM i library to build into (overrides manifest.Library)
OutputPath string // local path to write the resulting .savf
Keep bool // keep remote work objects/dir for debugging
Logf func(string, ...any)
}
Options configures a remote build.
type Result ¶
type Result struct {
Signature string // current *SRVPGM signature (hex, e.g. "0000...E3C5C5D9C7")
SavfPath string // local path of the packaged SAVF
TargetLib string // library the objects were built into
Srvpgm string // service program name
Modules []string // module names built
}
Result is the outcome of a build.