NAME

Alien::Xrepo::MB - A Module::Build subclass that runs the xrepo build pipeline

SYNOPSIS

# Build.PL
use v5.40;
use Alien::Xrepo::MB;

Alien::Xrepo::MB->new(
    module_name   => 'Exotic::Zstandard',
    dist_abstract => 'Build & install zstd via xrepo',
    requires => {
        'perl'                  => 'v5.40.0',
        'Alien::Xrepo::Runtime' => 0,
        'File::ShareDir'        => '1.00'
    },
    configure_requires => {
        'Alien::Xrepo::MB' => 0,
        'Module::Build'    => 0
    },
    test_requires => { 'Test2::V0' => 0 }
)->create_build_script;

DESCRIPTION

Alien::Xrepo::MB is a Module::Build subclass for the Alien::Xrepo build engine. Running ./Build (which is what ./Build test invokes) first runs the xrepo pipeline through Alien::Xrepo::Build. It writes the hermetic run-time snapshot into the distribution's share directory inside blib before the normal code action runs.

The dist contains no xrepo.json. The Alien class (module_name) is loaded from lib/, and its recipe() method acts as the single declaration for both the build engine and the run-time layer (see Alien::Xrepo::Runtime). Packages are shallow-installed into the dist's share directory, and the snapshot records share-relative paths. As a result, consumers resolve from the dist's share directory (never the xmake cache) and the same snapshot remains valid after ./Build install relocates the directory.

Staleness

The pipeline only (re)runs when the snapshot is missing or older than any of:

  • Build.PL

  • lib/<class.pm>

  • The engine modules themselves (Alien::Xrepo::MB, Alien::Xrepo::Build, Alien::Xrepo::Runtime, Alien::Xrepo::Build::Recipe)

  • Any files under the dist's local recipes/ tree

This mirrors Module::Build's copy_if_modified semantics, ensuring ./Build test does not rewrite an up-to-date snapshot.

PROPERTIES

In addition to the standard Module::Build properties, you can configure:

  • xrepo_snapshot: Where to write the snapshot. Defaults to the conventional blib/lib/auto/share/dist/<Dist>/xrepo-snapshot.json, which is derived from the module name by translating :: to - (e.g., Alien::Zstandard becomes Alien-Zstandard; Exotic::Zlib becomes Exotic-Zlib). Set this explicitly if the dist name does not match that derivation.

  • xrepo_share_dir: Where packages are shallow-installed. Defaults to the snapshot's parent directory (the dist's share directory).

  • xrepo_cache: Pass 0 (the default) to bypass Alien::Xrepo's on-disk resolution cache so no cache file lands inside the share directory. Set to 1 to keep the cache.

  • xrepo_update_repo: Pass 1 to refresh xrepo's repository index (xrepo update-repo) once and retry an install that fails. Useful when a stale registry reports a precompiled artifact with a checksum that no longer matches the mirror.

SEE ALSO

Alien::Xrepo::Build, Alien::Xrepo::Runtime, Alien::Xrepo, Alien::Xrepo::MM

LICENSE

Copyright (C) Sanko Robinson.

This library is free software; you can redistribute it and/or modify it under the terms found in the Artistic License 2. Other copyrights, terms, and conditions may apply to data transmitted through this module.

AUTHOR

Sanko Robinson https://github.com/sanko