Alien::Build(3)
π Alien::Build(3) π
User Contributed Perl Documentation β the manual page, but make it a vibe β¨
β¨ NAME β¨
Alien::Build β Build external dependencies for use in CPAN π
β VERSION β
version 2.88 β iconic, no cap
π SYNOPSIS π
okay so bestie, here's the whole flow:
my $build = Alien::Build->load('./alienfile');
$build->load_requires('configure');
$build->set_prefix('/usr/local');
$build->set_stage('/foo/mystage'); # needs to be absolute
$build->load_requires($build->install_type);
$build->download;
$build->build;
# files are now in /foo/mystage, it is your job (or
# ExtUtils::MakeMaker, Module::Build, etc) to copy
# those files into /usr/local
π DESCRIPTION π
This module gives you the tools to build external (non-CPAN) dependencies for CPAN. Main character energy: it's mainly meant to be used at install time by a CPAN client, and it works super closely with Alien::Base, which is the runtime bestie.
This is the detailed documentation for the Alien::Build class. If you're just starting out, you probably want to begin with one of these docs:
Alien::Build::Manual::Alienβ a broad overview ofAlien-Buildand its whole ecosystem.Alien::Build::Manual::AlienUserβ for users of anAlien::libfoothat is implemented usingAlien::Base. (The developer ofAlien::libfooshould provide the docs you need, but if they don't, this is the place to start.)Alien::Build::Manual::AlienAuthorβ if you're writing your own Alien based onAlien::BuildandAlien::Base.Alien::Build::Manual::FAQβ if you have a common question that's already been answered, like "How do I use alienfile with some build system".Alien::Build::Manual::PluginAuthorβ for the brave souls who want to write plugins that work withAlien::Build+ alienfile.Alien::Build::Manual::Securityβ if you're concerned that Aliens might be downloading tarballs off the internet. This discusses some of the risks of downloading (really any) software off the internet and gives you some tools to remediate those risks.
Note that you will not usually create an Alien::Build instance directly. Instead you'll be using a thin installer layer, like Alien::Build::MM (for use with ExtUtils::MakeMaker) or Alien::Build::MB (for use with Module::Build). One of the goals of this project is to stay installer agnostic. periodt.
π CONSTRUCTORS π
β¨ new
my $build = Alien::Build->new;
This creates a new empty instance of Alien::Build. Normally you'll want to use load below to create an instance of Alien::Build from an alienfile recipe.
β¨ load
my $build = Alien::Build->load($alienfile);
This creates an Alien::Build instance with the given alienfile recipe.
β¨ resume
my $build = Alien::Build->resume($alienfile, $root);
Load a checkpointed Alien::Build instance. You'll need the original alienfile and the build root (usually _alien), plus a build that had been properly checkpointed using the checkpoint method below.
π¦ PROPERTIES π¦
There are three main properties for Alien::Build. There are a number of properties documented here with a specific usage. Heads up: these properties may need to be serialized into something primitive like JSON that does not support: regular expressions, code references of blessed objects.
If you're writing a plugin (Alien::Build::Plugin) you should use a prefix like plugin_name (where name is the name of your plugin) so that it doesn't interfere with other plugin or future versions of Alien::Build. For example, if you were writing Alien::Build::Plugin::Fetch::NewProtocol, please use the prefix plugin_fetch_newprotocol:
sub init
{
my($self, $meta) = @_;
$meta->prop( plugin_fetch_newprotocol_foo => 'some value' );
$meta->register_hook(
some_hook => sub {
my($build) = @_;
$build->install_prop->{plugin_fetch_newprotocol_bar} = 'some other value';
$build->runtime_prop->{plugin_fetch_newprotocol_baz} = 'and another value';
}
);
}
If you're writing an alienfile recipe please use the prefix my_:
use alienfile;
meta_prop->{my_foo} = 'some value';
probe sub {
my($build) = @_;
$build->install_prop->{my_bar} = 'some other value';
$build->install_prop->{my_baz} = 'and another value';
};
Any property may be used from a command:
probe [ 'some command %{.meta.plugin_fetch_newprotocol_foo}' ];
probe [ 'some command %{.install.plugin_fetch_newprotocol_bar}' ];
probe [ 'some command %{.runtime.plugin_fetch_newprotocol_baz}' ];
probe [ 'some command %{.meta.my_foo}' ];
probe [ 'some command %{.install.my_bar}' ];
probe [ 'some command %{.runtime.my_baz}' ];
π meta_prop π
my $href = $build->meta_prop;
my $href = Alien::Build->meta_prop;
Meta properties have to do with the recipe itself, and not any particular instance that probes or builds that recipe. Meta properties can be changed from within an alienfile using the meta_prop directive, or from a plugin from its init method (though should NOT be modified from any hooks registered within that init method). This is not strictly enforced, but if you do not follow this rule your recipe will likely be broken.
π arch
This is a hint to an installer like Alien::Build::MM or Alien::Build::MB, that the library or tool contains architecture dependent files and so should be stored in an architecture dependent location. If not specified by your alienfile then it will be set to true.
π check_digest
True if cryptographic digest should be checked when files are fetched or downloaded. This is set by Digest negotiator plugin.
π¦ destdir
Some plugins (Alien::Build::Plugin::Build::Autoconf for example) support installing via DESTDIR. They will set this property to true if they plan on doing such an install. This helps Alien::Build find the staged install files and how to locate them.
If available, DESTDIR is used to stage install files in a sub directory before copying the files into blib. This is generally preferred method if available.
π§Ή destdir_filter
Regular expression for the files that should be copied from the DESTDIR into the stage directory. If not defined, then all files will be copied.
π§Ή destdir_ffi_filter
Same as destdir_filter except applies to build_ffi instead of build.
π digest
This properties contains the cryptographic digests (if any) that should be used when verifying any fetched and downloaded files. It is a hash reference where the key is the filename and the value is an array reference containing a pair of values, the first being the algorithm ('SHA256' is recommended) and the second is the actual digest. The special filename * may be specified to indicate that any downloaded file should match that digest. If there are both real filenames and the * placeholder, the real filenames will be used for filenames that match and any other files will use the placeholder. Example:
$build->meta_prop->{digest} = {
'foo-1.00.tar.gz' => [ SHA256 => '9feac593aa49a44eb837de52513a57736457f1ea70078346c60f0bfc5f24f2c1' ],
'foo-1.01.tar.gz' => [ SHA256 => '6bbde6a7f10ae5924cf74afc26ff5b7bc4b4f9dfd85c6b534c51bd254697b9e7' ],
'*' => [ SHA256 => '33a20aae3df6ecfbe812b48082926d55391be4a57d858d35753ab1334b9fddb3' ],
};
Cryptographic signatures will only be checked if the check_digest meta property is set and if the Digest negotiator plugin is loaded. (The Digest negotiator can be used directly, but is also loaded automatically if the digest directive is used by the alienfile.)
πΏ env
Environment variables to override during the build stage.
πΏ env_interpolate
Environment variable values will be interpolated with helpers. Example:
meta->prop->{env_interpolate} = 1;
meta->prop->{env}->{PERL} = '%{perl}';
π local_source
Set to true if source code package is available locally. (that is not fetched over the internet). This is computed by default based on the start_url property. Can be set by an alienfile or plugin.
π₯οΈ platform
Hash reference. Contains information about the platform beyond just $^O.
platform.compiler_typeβ Refers to the type of flags that the compiler accepts. May be expanded in the future, but for now, will be one of:microsoftβ On Windows when using Microsoft Visual C++unixβ Virtually everything else, including gcc on windows.
The main difference is that with Visual C++ -LIBPATH should be used instead of -L, and static libraries should have the .LIB suffix instead of .a.
platform.system_typeβ$^Ois frequently good enough to make platform specific logic in your alienfile, this handles the case when$^Ocan cover platforms that provide multiple environments that Perl might run under. The main example is windows, but others may be added in the future.unixvmswindows-activestatewindows-microsoftwindows-mingwwindows-strawberrywindows-unknown
Note that cygwin and msys are considered unix even though they run on windows!
platform.cpu.countβ Contains a non-negative integer of available (possibly virtual) CPUs on the system. This can be used by build plugins to build in parallel. The environment variableALIEN_CPU_COUNTcan be set to override the CPU count.platform.cpu.arch.nameβ Contains a normalized name for the architecture of the current Perl. This can be used by fetch plugins to determine which binary packages to download. The value may be one of the following, but this list will be expanded as needed."armel"β 32-bit ARM soft-float"armhf"β 32-bit ARM hard-float"aarch64"β 64-bit ARM"ppc"β 32-bit PowerPC (big-endian)"ppc64"β 64-bit PowerPC (big-endian)"x86"β 32-bit Intel (i386, i486, i686)"x86_64"β 64-bit Intel (AMD64)"unknown"β Unable to detect architecture. Please report this if needed.
out_of_sourceβ build in a different directory from where the source code is stored. Autoconf girlies call this a "VPATH" build, everyone else says "out-of-source", and honestly both are valid. When this property is true, instead of extracting into the source build root, the downloaded source gets extracted into a source extraction directory and the source build root is just... empty. Wanna know where it actually landed? Use theextractinstall property. πnetworkβ true when a network fetch is available. Bestie, do NOT set this in an alienfile or a plugin, that is simply not your job. It's computed for you based on theALIEN_INSTALL_NETWORKenvironment variables. π«Άstart_urlβ the default or start URL that fetch plugins vibe with. π
install_prop
my $href = $build->install_prop;
Install properties are the install-phase girlies (whether you're running a "share" or a "system" install). They get remembered for the entire install phase and then do not stick around during the runtime phase β which means your Alien::Base based module literally cannot access them. So don't build a whole personality around them. π
autoconf_prefixβ the prefix, but the way autoconf understands it. This is only different on Windows where MSYS is used and paths likeC:/fooget represented as/C/fooβ MSYS tools get that, Perl does not, and that's the whole tea. Only use this if you've got Alien::Build::Plugin::Build::Autoconf in your alienfile. It gets set before the build hook is run. β¨downloadβ the location of the downloaded archive (tar.gz, or whatever) or directory. Heads up: this staysundefuntil the archive is actually downloaded. Don't come for it early. πdownload_detailβ optional details about a downloaded file. This one is populated by Alien::Build core itself. It's a hash reference: the key is the path to the file that got downloaded, and the value is a hash reference with additional detail. All fields are optional.
download_detail.digest
If it's available, this is the cryptographic signature that was successfully matched against the downloaded file. It's an array reference with a pair of values: the algorithm (typically something like SHA256) and the digest. π
download_detail.protocol
If it's available, this is the URL protocol used to fetch the downloaded file. π
envβ environment variables to override during the build stage. Plugins are free to set additional overrides using this hash. π οΈextractβ the location of the last source extraction. For an "out-of-source" build (peep theout_of_sourcemeta property above π), this only gets set once. For other types of builds, the source code may be extracted multiple times, so this property may change on you. Not its fault, it's just living its truth.old[deprecated]
A hash with info on a previously installed Alien of the same name, if one's available. Lowkey useful when you wanna reuse the previous install if it's still sufficient. β»οΈ
old.prefix
[deprecated]
The prefix for the previous install. Versions prior to 1.42 unfortunately shipped this with a typo β preifx. Not a vibe, but we respect the lore. π
old.runtime
[deprecated]
The runtime properties from the previous install.
patchβ directory with patches, if any are available. This will beundefif there are no patches. When you're initially installing an alien this is usually a sibling of thealienfile, a directory calledpatch. Once installed, it'll be in the share directory called_alien/patch. The former is useful for rebuilding an alienized package using af. π©Ήprefixβ the install time prefix. Under adestdirinstall this is the same as the runtime or final install location. Under a non-destdirinstall this is the "stage" directory (usually the appropriate share directory underblib). πrootβ the build root directory. This is an absolute path. By default it's the absolute form of./_alien. πstageβ the stage directory where files will be copied. Usually the root of the blib share directory.system_probe_classβ after the probe step, this may contain the plugin class that performed the system probe. It shouldn't be filled in directly by the plugin (instead it should use the hook propertyprobe_class, see below π). This is optional β not all probe plugins will provide this info. π΅οΈsystem_probe_instance_idβ after the probe step, this may contain the plugin instance id that performed the system probe. Same deal: it shouldn't be filled in directly by the plugin (instead it should use the hook propertyprobe_instance_id, see below π). Optional, and again, not all probe plugins will provide this. π΅οΈ
plugin_instance_prop
my $href = $build->plugin_instance_prop($plugin);
This returns the private plugin instance properties for a given plugin. Bestie, this method should usually only ever be called internally by plugins themselves, to keep track of their own internal state. Why? Because the content can be used arbitrarily by the owning plugin since it's private to that plugin β which means it is not part of the Alien::Build spec. It's their diary, don't read it. π
runtime_prop
my $href = $build->runtime_prop;
Runtime properties are used during the install and runtime phases (either under a "share" or a "system" install). These should include anything you'll need to know to actually use the library or tool at runtime β and should not include anything that stops being relevant once the install process is done. Marie Kondo that hash. β¨
alien_build_versionβ the version of Alien::Build that was used to install the library or tool.altβ alternate configurations. If the alienized package has multiple libraries, this can store the different compiler or linker flags for each one. Typically set by a plugin in the gather stage (for either share or system installs). ποΈcflagsβ the compiler flags. Typically set by a plugin in the gather stage (for either share or system installs). π§cflags_staticβ the static compiler flags. Typically set by a plugin in the gather stage (for either share or system installs).commandβ the command name for tools where the name may differ from platform to platform. For example, the GNU version of make is usuallymakeon Linux andgmakeon FreeBSD. Typically set by a plugin in the gather stage (for either share or system installs). π§ffi_nameβ the name DLL or shared objectnameto use when searching for dynamic libraries at runtime. This gets passed into FFI::CheckLib, so if your library is something likelibarchive.soorarchive.dll, you'd set this toarchive. It may be a string or an array of strings. Typically set by a plugin in the gather stage (for either share or system installs). πffi_checklibβ this property contains two sub properties:
ffi_checklib.share
$build->runtime_prop->{ffi_checklib}->{share} = [ ... ];
An array of additional FFI::CheckLib flags to pass in to find_lib for a share install.
ffi_checklib.system
An array of additional FFI::CheckLib flags to pass in to find_lib for a system install.
Among other things, this is useful for specifying the try_linker_script flag:
$build->runtime_prop->{ffi_checklib}->{system} = [ try_linker_script => 1 ];
This is typically set by a plugin in the gather stage (for either share or system installs).
inline_auto_include[version 2.53]
This property is an array reference of C code that gets passed into Inline::C to make sure the appropriate headers are automatically included. See "auto_include" in Inline::C for details. πΈ
install_typeβ the install type. This is set by AB core after the probe hook is executed. It's one of:
system
For when the library or tool is provided by the operating system, can be detected by Alien::Build, and is considered satisfactory by the alienfile recipe. π
share
For when a system install is not possible, so the library source gets downloaded from the internet (or retrieved in another appropriate fashion) and built. ποΈ
libsβ the library flags. Typically set by a plugin in the gather stage (for either share or system installs). π¦libs_staticβ the static library flags. Typically set by a plugin in the gather stage (for either share or system installs).perl_module_versionβ the version of the Perl module used to install the alien (if it's available). For example, if Alien::curl is installinglibcurl, this would be the version of Alien::curl used during the install step. πͺprefixβ the final install root. This is usually the share directory. π‘versionβ the version of the library or tool. Typically set by a plugin in the gather stage (for either share or system installs). π·οΈ
hook_prop
my $href = $build->hook_prop;
Hook properties are for the currently running hook (if there is one). They're used only during the execution of each hook and get discarded right after β like a group chat that self-destructs. If no hook is currently running, then hook_prop returns undef. π
nameβ the name of the currently running hook. π·οΈversion(probe) β Probe and PkgConfig plugins may set this property to indicate the version of the alienized package. Not all plugins and configurations are able to provide this, and that's okay. πprobe_class(probe) β Probe and PkgConfig plugins may set this property to indicate the plugin class that made the probe. If the probe results in a system install, this gets propagated tosystem_probe_classfor later use. π€probe_instance_id(probe) β Probe and PkgConfig plugins may set this property to indicate the plugin instance id that made the probe. If the probe results in a system install, this gets propagated tosystem_probe_instance_idfor later use. π€
π METHODS π
checkpoint
$build->checkpoint;
bestie this one saves all your install + runtime properties so they can get reloaded later on, in a whole separate process. super useful when your build has to happen in multiple stages from a Makefile (yes, like with ExtUtils::MakeMaker). once you've checkpointed, you hit up the resume constructor (documented up above, go look) to pick the probe/build/install process back up where it left off. β¨
root
my $dir = $build->root;
this is literally just a shortcut for:
my $root = $build->install_prop->{root};
except it'll create the thing if it doesn't already exist. so convenient of it π«Ά
install_type
my $type = $build->install_type;
returns the install type. (check the same-named install property above for the deets.) and heads up: this method will call probe if nobody's called it yet. it does the work for you, iconic behavior π
is_system_install
my $boolean = $build->is_system_install;
true if the alien is a system install type. slay.
is_share_install
my $boolean = $build->is_share_install;
true if the alien is a share install type. also slay.
download_rule
my $rule = $build->download_rule;
this hands you the install rule as a string. it's decided by the environment, and it should be one of these:
warnβ only warn if you're fetching from a non-secure source (secure sources includehttpsand bundled files, and may include other encrypted protocols in the future).digestβ require that any downloaded source package has a cryptographic signature in the alienfile, and that the signature matches what got downloaded.encryptβ require that any downloaded source package is fetched via a secure source.digest_or_encryptβ require that any downloaded source package is either fetched via a secure source or has a cryptographic signature in the alienfile that matches what got downloaded.digest_and_encryptβ require that any downloaded source package is both fetched via a secure source and has a cryptographic signature in the alienfile that matches what got downloaded.
the current default iswarn, but in the near future it's getting upgraded todigest_or_encrypt. stay ready π
set_prefix
$build->set_prefix($prefix);
sets the final (unstaged) prefix. normally only Alien::Build::MM and friends call this. it is not intended for use from plugins or from an alienfile, so don't be out here doing that π
set_stage
$build->set_stage($dir);
sets the stage directory. again, normally only Alien::Build::MM and similar modules call this, and it is not meant to be used from plugins or from an alienfile. same energy, same warning π
requires
my $hash = $build->requires($phase);
returns a hash ref of the modules required for the given phase. the phases are:
configureβ these modules must already be available when the alienfile is read.anyβ these modules are used during either asystemorshareinstall.shareβ these modules are used during the build phase of ashareinstall.systemβ these modules are used during the build phase of asysteminstall.
load_requires
$build->load_requires($phase);
this loads up the right modules for the given phase (see requires just above for what the phases actually are). β¨
probe
my $install_type = $build->probe;
tries to figure out if the operating system already has the library or tool installed. if it does, you get the string system back and a system install happens. if not, then share gets installed and the tool or library gets downloaded and built from source. detective work fr fr π
if the environment variable ALIEN_INSTALL_TYPE is set, that forces a specific type of install. and if the detection logic can't accommodate the install type you asked for? it fails with an exception. no cap.
download
$build->download;
downloads the source, usually as a tarball, usually from the internet π
under a system install this does absolutely nothing. it's giving "showed up to work with no tasks" π
fetch
my $res = $build->fetch;
my $res = $build->fetch($url, %options);
fetches a resource using the fetch hook. returns the same hash structure that's described below in the fetch hook documentation.
[version 2.39]
as of Alien::Build 2.39, these options are supported:
http_headers
my $res = $build->fetch($url, http_headers => [ $key1 => $value1, $key2 => $value 2, ... ]);
sets the HTTP request headers on all outgoing HTTP requests. heads up though: not every protocol or fetch plugin supports setting request headers, but the ones that don't should issue a warning if you try to set them anyway. so if you see a warning, that's why bestie π
check_digest
[experimental]
my $bool = $build->check_digest($path);
checks any cryptographic signatures for the given file. the file is specified by $path, which can be one of:
- string β containing the path to the file to be checked.
- Path::Tiny β containing the path to the file to be checked.
HASHβ a hash reference containing information about a file. see the fetch hook for details on the format.
returns true if the cryptographic signature matches, and false if cryptographic signatures are disabled. it will throw an exception if the signature doesn't match, or if no plugin provides the correct algorithm for checking the signature. so like, be ready for that π³
decode
my $decoded_res = $build->decode($res);
decodes the HTML or file listing that fetch gave you. returns the same hash structure described below in the decode hook documentation. π¦
prefer
my $sorted_res = $build->prefer($res);
filters and sorts the candidates. the preferred candidate comes back first in the list, and the worst candidate comes back last. returns the same hash structure described below in the prefer hook documentation. main character goes first, periodt π
extract
my $dir = $build->extract;
my $dir = $build->extract($archive);
extracts the given archive into a fresh directory. this is normally called internally by Alien::Build, and for normal usage you don't need it from a plugin or an alienfile. leave it to the professionals π
build
$build->build;
runs the build step. it's expected that probe and download have already been done. what it actually does depends on the type of install:
shareβ the source is extracted, and built as determined by the alienfile recipe. if there's agather_share, that gets executed last.systemβ thegather_systemhook gets executed.
test
$build->test;
runs the test phase. good luck bestie, you got this π
clean_install
$build->clean_install
cleans files out of the final install location. the default implementation removes all files recursively except for the _alien directory. this is a lifesaver when you've got an old install with files that might break the new build. spring cleaning energy π§Ήβ¨
system
$build->system($command);
$build->system($command, @args);
interpolates the command and its arguments, then runs the results using the Perl system command. π₯
log
$build->log($message);
sends a message to the log. by default this prints to STDOUT. say it with your chest π’
meta
my $meta = Alien::Build->meta;
my $meta = $build->meta;
returns the meta object for your Alien::Build class or instance. the meta object is how you manipulate the recipe, which means any changes to it should be made before the probe, download or build steps. timing is everything π
β¨ META METHODS β¨
prop
my $href = $build->meta->prop;
meta properties. this is the same as calling meta_prop on the class or the Alien::Build instance. π«
add_requires
Alien::Build->meta->add_requires($phase, $module => $version, ...);
adds the requirement to the given phase. phase should be one of:
configureanysharesystem
has_requires
if (Alien::Build->meta->has_requires($phase, $module_pat, ...)) {...}
tests whether the given phase has any of the given substrings as a requirement. phase works like it does in add_requires. π΅οΈ
interpolator
my $interpolator = $build->meta->interpolator;
my $interpolator = Alien::Build->interpolator;
returns the Alien::Build::Interpolate instance for the Alien::Build class. πΈ
has_hook
my $bool = $build->meta->has_hook($name);
my $bool = Alien::Build->has_hook($name);
returns whether there's a usable hook registered with the given name. π
register_hook
$build->meta->register_hook($name, $instructions);
Alien::Build->meta->register_hook($name, $instructions);
registers a hook with the given name. $instructions should be either a code reference or a command sequence, which is an array reference. π§
default_hook
$build->meta->default_hook($name, $instructions);
Alien::Build->meta->default_hook($name, $instructions);
registers a default hook, which gets used if the alienfile doesn't register its own hook with that name. it's the backup bestie π«Ά
around_hook
$build->meta->around_hook($hook_name, $code);
Alien::Build->meta->around_hook($hook_name, $code);
wraps the given hook with a code reference. this is similar to a Moose method modifier, except it wraps around the given hook instead of a method. for example, this will add a probe system requirement:
$build->meta->around_hook(
probe => sub {
my $orig = shift;
my $build = shift;
my $type = $orig->($build, @_);
return $type unless $type eq 'system';
# also require a configuration file
if(-f '/etc/foo.conf')
{
return 'system';
}
else
{
return 'share';
}
},
);
after_hook
$build->meta->after_hook($hook_name, sub {
my(@args) = @_;
...
});
executes the given code reference after the hook. the original arguments get passed into the code reference. π
before_hook
$build->meta->before_hook($hook_name, sub {
my(@args) = @_;
...
});
executes the given code reference before the hook. the original arguments get passed into the code reference. same deal, opposite timing π
apply_plugin
Alien::Build->meta->apply_plugin($name);
Alien::Build->meta->apply_plugin($name, @args);
applies the given plugin with the given arguments. go off, plugin π β¨
π ENVIRONMENT π
okay bestie so Alien::Build is very online and it listens to these env vars, like it's literally reading your vibes from the shell π
ALIEN_BUILD_LOGβ the default log class it's gonna use. go peek atAlien::Build::LogandAlien::Build::Log::Defaultif you wanna know more π«ΆALIEN_BUILD_PKG_CONFIGβ this one overrides the logic insideAlien::Build::Plugin::PkgConfig::Negotiate, the part that picks the bestpkg-configplugin. so you can just choose for it, main character energy πALIEN_BUILD_POSTLOADβ a semicolon separated list of plugins that get loaded after youralienfilegets parsed. post-parse glow-up β¨ALIEN_BUILD_PRELOADβ same deal but a semicolon separated list of plugins loaded before youralienfileis parsed. pre-game ritual πALIEN_BUILD_RCβ a Perl source file that can override some global defaults forAlien::Build, like, for example, setting preload and postload plugins. your lil config bestie πALIEN_DOWNLOAD_RULEβ this value decides the rules for which types of downloads are allowed. the legal values are the ones listed underdownload_rule, plus"default", which means "whatever the default is for the current version ofAlien::Build". for this version that default is"warn". noted, no cap β οΈALIEN_INSTALL_NETWORKβ if you set it to true (which is the default btw), network fetch is allowed. if you set it to false, network fetch is not allowed, periodt π«
what counts as a local vs. network fetch is figured out from the "start_url" and "local_source" meta properties. an alienfile or a plugin could override that detection (possibly inappropriately, like, rude), so this variable is not a substitute for properly auditing Perl modules for environments that require that. do the actual work, bestie π«‘
ALIEN_INSTALL_TYPEβ if you set it to"share"or"system", it overrides the system detection logic. if you set it to"default", it uses the default setting for the alienfile. the behavior of other values is undefined, so like, don't π
so here's the tea: the recommended way for a consumer to use an Alien::Base based Alien is to declare it as a static configure and build-time dependency. but some consumers may prefer to fallback on using an Alien only when the consumer itself cannot detect the necessary package. and in some cases the consumer may want the user to opt-in to using an Alien before requiring it.
to keep the interface consistent among Aliens, the consumer of the fallback opt-in Alien may fallback on the Alien if the environment variable "ALIEN_INSTALL_TYPE" is set to any value. the rationale is that by setting this environment variable, the user is aware that Alien modules may be installed and has indicated consent. the actual implementation of this, by its nature, would have to live in the consuming CPAN module. iykyk π
DESTDIRβ this environment variable gets manipulated during a destdir install. hands off unless you know π οΈPKG_CONFIGβ you can use this to override the program name for"pkg-config"when you're using the command line plugin:Alien::Build::Plugin::PkgConfig::CommandLineπ―ftp_proxy,all_proxyβ if these are set, they may influence the Download negotiation pluginAlien::Build::Plugin::Download::Negotiate. other proxy variables may be used by some Fetch plugins, if they support it. it's giving "depends on the plugin" energy π
π SUPPORT π
the intent of the "Alien-Build" team is to support the same versions of Perl that are supported by the Perl toolchain. as of this writing that means 5.16 and better β
please feel so encouraged to report issues that you encounter to the project GitHub Issue tracker:
https://github.com/PerlAlien/Alien-Build/issues
and even better β if you can fix the issue yourself, please feel encouraged to open a pull-request on the project GitHub:
https://github.com/PerlAlien/Alien-Build/pulls
if you are confounded and have questions, come join us on the "#native" channel on irc.perl.org π¦ the "Alien-Build" developers frequent this channel and can probably help point you in the right direction. and if you don't have an IRC client handy, you can use this web interface:
https://chat.mibbit.com/?channel=%23native&server=irc.perl.org
we don't bite, bestie, come say hi π
π SEE ALSO π
Alien::Build::Manual::AlienAuthorAlien::Build::Manual::AlienUserAlien::Build::Manual::ContributingAlien::Build::Manual::FAQAlien::Build::Manual::PluginAuthoralienfileAlien::Build::MMAlien::Build::PluginAlien::BaseAlien
go read them, they're all bangers πβ¨
πΈ THANKS πΈ
Alien::Base was originally written by Joel Berger, and the rest of this project would not have been possible without him getting the project started. thanks to his support, "I" have been able to augment the original Alien::Base system with a reliable set of tools (Alien::Build, alienfile, Test::Alien), which make up this toolset π«Ά
the original Alien::Base is still copyright (c) 2012-2020 Joel Berger. it has the same license as the rest of the Alien::Build and related tools distributed as "Alien-Build". Joel Berger thanked a number of people who helped in the development of Alien::Base, in the documentation for that module. iconic behavior π
I would also like to acknowledge the other members of the PerlAlien github organization, Zakariyya Mughal (sivoais, ZMUGHAL) and mohawk (ETJ). also important in the early development of Alien::Build were the early adopters Chase Whitener (genio, CAPOEIRAB, author of Alien::libuv), William N. Braswell, Jr (willthechill, WBRASWELL, author of Alien::JPCRE2 and Alien::PCRE2) and Ahmad Fatoum (a3f, ATHREEF, author of Alien::libudev and Alien::LibUSB) π
the Alien ecosystem owes a debt to Dan Book, who goes by Grinnz on IRC, for answering question about how to use Alien::Build and friends. the realest π
β¨ AUTHOR β¨
Author: Graham Ollis <plicease@cpan.org>
Contributors:
- Diab Jerius (DJERIUS)
- Roy Storey (KIWIROY)
- Ilya Pavlov
- David Mertens (run4flat)
- Mark Nunberg (mordy, mnunberg)
- Christian Walde (Mithaldu)
- Brian Wightman (MidLifeXis)
- Zaki Mughal (zmughal)
- mohawk (mohawk2, ETJ)
- Vikas N Kumar (vikasnkumar)
- Flavio Poletti (polettix)
- Salvador FandiΓ±o (salva)
- Gianni Ceccarelli (dakkar)
- Pavel Shaydo (zwon, trinitum)
- Kang-min Liu (εεΊ·ζ°, gugod)
- Nicholas Shipp (nshp)
- Juan JuliΓ‘n Merelo GuervΓ³s (JJ)
- Joel Berger (JBERGER)
- Petr PΓsaΕ (ppisar)
- Lance Wicks (LANCEW)
- Ahmad Fatoum (a3f, ATHREEF)
- JosΓ© JoaquΓn Atria (JJATRIA)
- Duke Leto (LETO)
- Shoichi Kaji (SKAJI)
- Shawn Laffan (SLAFFAN)
- Paul Evans (leonerd, PEVANS)
- HΓ₯kon HΓ¦gland (hakonhagland, HAKONH)
- nick nauwelaerts (INPHOBIA)
- Florian Weimer
- Marcel Telka (mtelka)
look at that roster, it's giving legendary ππ
π COPYRIGHT AND LICENSE π
this software is copyright (c) 2011-2022 by Graham Ollis.
this is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. slay, legally speaking π
aaaand that's the whole page, bestie!! π this was perl v5.42.3, dated 2026-09-21, and you just read the one and only Alien::Build(3) π go build something iconic, mwah π
π¦ where this page comes from
- fedora 43: perl-Alien-Build 2.88-1.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- fedora 44: perl-Alien-Build 2.88-1.fc44 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms