<spanclass="line"><spanstyle="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> ...</span></span></code></pre></div><h2id="artifact-definition"tabindex="-1">Artifact Definition <aclass="header-anchor"href="#artifact-definition"aria-label="Permalink to “Artifact Definition”"></a></h2><p>An Artifact is a definition independent of Packages. It contains the source archive file or pre-built binary for building packages. Each Artifact defines download URLs, extraction methods, and build artifact file paths. A Package can reference one Artifact via the <code>artifact</code> field to obtain the source or binary needed for building.</p><p>In simple terms, by default one Package corresponds to one Artifact; if multiple Packages share the same source, you can define a single Artifact for multiple Packages to reference. Artifact definitions are located in the <code>config/artifact/</code> directory, and the corresponding custom download/extract logic classes are in the <code>src/Package/Artifact/</code> directory. For special package types like virtual targets and PHP built-in extensions, a Package may also omit the Artifact field entirely.</p><p>Assuming <code>example-library-package</code> is a dependency library whose source archive is hosted at <code>https://example.com/example-library.tar.gz</code>, its Package and Artifact definitions would look like this:</p><divclass="language-yaml"><buttontitle="Copy Code"class="copy"></button><spanclass="lang">yaml</span><preclass="shiki shiki-themes github-light github-dark"style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;"tabindex="0"dir="ltr"><code><spanclass="line"><spanstyle="--shiki-light:#11782a;--shiki-dark:#85E89D;">example-library-package</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<spanclass="line"><spanstyle="--shiki-light:#11782a;--shiki-dark:#85E89D;"> url</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><spanstyle="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'https://example.com/example-library.tar.gz'</span></span></code></pre></div><p>For more on Artifact definitions, see the <ahref="./artifact-model.html">Artifact Model</a> chapter.</p><h2id="php-extension-package-type"tabindex="-1">php-extension Package Type <aclass="header-anchor"href="#php-extension-package-type"aria-label="Permalink to “php-extension Package Type”"></a></h2><p>A php-extension package represents a PHP extension. Its configuration file is located in the <code>config/pkg/ext/</code> directory. Optional recipe classes are normally placed in <code>src/Package/Extension/</code>, registered with <code>#[Extension]</code>, and receive the corresponding <code>PhpExtensionPackage</code> through callback context. Inheriting from <code>PhpExtensionPackage</code> is supported but is not required by the current core recipes.</p><divclass="language-yaml"><buttontitle="Copy Code"class="copy"></button><spanclass="lang">yaml</span><preclass="shiki shiki-themes github-light github-dark"style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;"tabindex="0"dir="ltr"><code><spanclass="line"><spanstyle="--shiki-light:#11782a;--shiki-dark:#85E89D;">ext-lz4</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<spanclass="line"><spanstyle="--shiki-light:#11782a;--shiki-dark:#85E89D;"> arg-type@windows</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><spanstyle="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'--enable-lz4'</span></span></code></pre></div><p>Allowed fields for <code>php-extension</code>:</p><divclass="language-yaml"><buttontitle="Copy Code"class="copy"></button><spanclass="lang">yaml</span><preclass="shiki shiki-themes github-light github-dark"style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;"tabindex="0"dir="ltr"><code><spanclass="line"><spanstyle="--shiki-light:#11782a;--shiki-dark:#85E89D;">ext-{ext-name}</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><spanstyle="--shiki-light:#62687b;--shiki-dark:#818e99;"># Package name must start with ext- prefix</span></span>
<spanclass="line"><spanstyle="--shiki-light:#11782a;--shiki-dark:#85E89D;"> lang</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><spanstyle="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">c</span><spanstyle="--shiki-light:#62687b;--shiki-dark:#818e99;"> # Optional, implementation language of the extension (c / c++ etc.)</span></span>
<spanclass="line"><spanstyle="--shiki-light:#11782a;--shiki-dark:#85E89D;"> frameworks</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: [] </span><spanstyle="--shiki-light:#62687b;--shiki-dark:#818e99;"># Optional, list of related macOS framework dependencies</span></span>
<spanclass="line"><spanstyle="--shiki-light:#11782a;--shiki-dark:#85E89D;"> artifact</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><spanstyle="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'{artifact-name}'</span><spanstyle="--shiki-light:#62687b;--shiki-dark:#818e99;"> # Optional; when a string, references the named Artifact definition;</span></span>
<spanclass="line"><spanstyle="--shiki-light:#62687b;--shiki-dark:#818e99;"> # when an object, it is an inline Artifact</span></span>
<spanclass="line"><spanstyle="--shiki-light:#62687b;--shiki-dark:#818e99;"> # (built-in extensions don't need this field)</span></span>
<spanclass="line"><spanstyle="--shiki-light:#11782a;--shiki-dark:#85E89D;"> depends</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: [] </span><spanstyle="--shiki-light:#62687b;--shiki-dark:#818e99;"># Optional, hard dependency list (library names as-is, PHP extensions need ext- prefix)</span></span>
<spanclass="line"><spanstyle="--shiki-light:#11782a;--shiki-dark:#85E89D;"> depends@unix</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: [] </span><spanstyle="--shiki-light:#62687b;--shiki-dark:#818e99;"># Optional, hard dependencies only effective on Unix platforms</span></span>
<spanclass="line"><spanstyle="--shiki-light:#11782a;--shiki-dark:#85E89D;"> depends@windows</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: [] </span><spanstyle="--shiki-light:#62687b;--shiki-dark:#818e99;"># Optional, hard dependencies only effective on Windows platforms</span></span>
<spanclass="line"><spanstyle="--shiki-light:#11782a;--shiki-dark:#85E89D;"> suggests</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: [] </span><spanstyle="--shiki-light:#62687b;--shiki-dark:#818e99;"># Optional, optional dependency list (same format as depends)</span></span>
<spanclass="line"><spanstyle="--shiki-light:#62687b;--shiki-dark:#818e99;"> # arg-type determines the form of arguments passed to ./configure, supports platform suffixes</span></span>
<spanclass="line"><spanstyle="--shiki-light:#62687b;--shiki-dark:#818e99;"> # Priority (using Linux as example): arg-type@linux > arg-type@unix > arg-type (no suffix)</span></span>
<spanclass="line"><spanstyle="--shiki-light:#62687b;--shiki-dark:#818e99;"> # enable → --enable-{extname} (default value, used when not configured)</span></span>
<spanclass="line"><spanstyle="--shiki-light:#62687b;--shiki-dark:#818e99;"> # custom/none → Pass no arguments (handled by the #[CustomPhpConfigureArg] method in the PHP class)</span></span>
<spanclass="line"><spanstyle="--shiki-light:#62687b;--shiki-dark:#818e99;"> # You can also write the full argument string directly, supporting the following placeholders:</span></span>
<spanclass="line"><spanstyle="--shiki-light:#62687b;--shiki-dark:#818e99;"> # @build_root_path@ → BUILD_ROOT_PATH (absolute path of buildroot)</span></span>
<spanclass="line"><spanstyle="--shiki-light:#62687b;--shiki-dark:#818e99;"> # @shared_suffix@ → Expands to =shared in shared builds, empty in static builds</span></span>
<spanclass="line"><spanstyle="--shiki-light:#62687b;--shiki-dark:#818e99;"> # @shared_path_suffix@ → Expands to =shared,{buildroot} in shared builds,</span></span>
<spanclass="line"><spanstyle="--shiki-light:#62687b;--shiki-dark:#818e99;"> # expands to ={buildroot} in static builds</span></span>
<spanclass="line"><spanstyle="--shiki-light:#11782a;--shiki-dark:#85E89D;"> zend-extension</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><spanstyle="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">false</span><spanstyle="--shiki-light:#62687b;--shiki-dark:#818e99;"> # Optional, true indicates this is a Zend extension (e.g., opcache, xdebug)</span></span>
<spanclass="line"><spanstyle="--shiki-light:#11782a;--shiki-dark:#85E89D;"> build-shared</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><spanstyle="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><spanstyle="--shiki-light:#62687b;--shiki-dark:#818e99;"> # Optional, whether building as a shared extension (.so) is allowed, default true</span></span>
<spanclass="line"><spanstyle="--shiki-light:#11782a;--shiki-dark:#85E89D;"> build-static</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><spanstyle="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><spanstyle="--shiki-light:#62687b;--shiki-dark:#818e99;"> # Optional, whether inline static building (compiled into PHP) is allowed, default true</span></span>
<spanclass="line"><spanstyle="--shiki-light:#11782a;--shiki-dark:#85E89D;"> build-with-php</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><spanstyle="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><spanstyle="--shiki-light:#62687b;--shiki-dark:#818e99;"> # Optional, true means the extension is built together via the PHP source tree</span></span>
<spanclass="line"><spanstyle="--shiki-light:#62687b;--shiki-dark:#818e99;"> # (used for built-in extensions)</span></span>
<spanclass="line"><spanstyle="--shiki-light:#62687b;--shiki-dark:#818e99;"> # display-name affects the php --ri argument in smoke tests and the license export display name</span></span>
<spanclass="line"><spanstyle="--shiki-light:#62687b;--shiki-dark:#818e99;"> # If not set, defaults to the extension name (the part after ext-); if set to empty string, skips --ri check</span></span>
<spanclass="line"><spanstyle="--shiki-light:#62687b;--shiki-dark:#818e99;"> # os restricts the extension to be available only on specified platforms;</span></span>
<spanclass="line"><spanstyle="--shiki-light:#62687b;--shiki-dark:#818e99;"> # platforms not in the list will be rejected for building</span></span>
<spanclass="line"><spanstyle="--shiki-light:#11782a;--shiki-dark:#85E89D;"> os</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: [</span><spanstyle="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">Linux</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><spanstyle="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">Darwin</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]</span></span></code></pre></div><h2id="library-package-type"tabindex="-1">library Package Type <aclass="header-anchor"href="#library-package-type"aria-label="Permalink to “library Package Type”"></a></h2><p>A library package represents a dependency library, such as openssl or zlib, installed from source or a pre-built binary. Its configuration file is located in the <code>config/pkg/lib/</code> directory. Optional recipe classes are normally placed in <code>src/Package/Library/</code>, registered with <code>#[Library]</code>, and receive a <code>LibraryPackage</code> through callback context; they do not need to inherit from it.</p><p>Taking openssl as an example:</p><divclass="language-yaml"><buttontitle="Copy Code"class="copy"></button><spanclass="lang">yaml</span><preclass="shiki shiki-themes github-light github-dark"style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;"tabindex="0"dir="ltr"><code><spanclass="line"><spanstyle="--shiki-light:#11782a;--shiki-dark:#85E89D;">openssl</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<spanclass="line"><spanstyle="--shiki-light:#11782a;--shiki-dark:#85E89D;"> type</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><spanstyle="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">library</span><spanstyle="--shiki-light:#62687b;--shiki-dark:#818e99;"> # library or target (target inherits all fields from library)</span></span>
<spanclass="line"><spanstyle="--shiki-light:#11782a;--shiki-dark:#85E89D;"> license</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><spanstyle="--shiki-light:#62687b;--shiki-dark:#818e99;"># Optional, license material copied after a source build</span></span>
<spanclass="line"><spanstyle="--shiki-light:#11782a;--shiki-dark:#85E89D;"> type</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><spanstyle="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">file</span><spanstyle="--shiki-light:#62687b;--shiki-dark:#818e99;"> # type is file or text; a list of entries is also accepted</span></span>
<spanclass="line"><spanstyle="--shiki-light:#11782a;--shiki-dark:#85E89D;"> lang</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><spanstyle="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">c</span><spanstyle="--shiki-light:#62687b;--shiki-dark:#818e99;"> # Optional, implementation language of the library (c / c++ etc.)</span></span>
<spanclass="line"><spanstyle="--shiki-light:#11782a;--shiki-dark:#85E89D;"> frameworks</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: [] </span><spanstyle="--shiki-light:#62687b;--shiki-dark:#818e99;"># Optional, list of related framework tags</span></span>
<spanclass="line"><spanstyle="--shiki-light:#11782a;--shiki-dark:#85E89D;"> artifact</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><spanstyle="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'{artifact-name}'</span><spanstyle="--shiki-light:#62687b;--shiki-dark:#818e99;"> # Required; when a string, references the named Artifact definition;</span></span>
<spanclass="line"><spanstyle="--shiki-light:#62687b;--shiki-dark:#818e99;"> # when an object, it is an inline Artifact</span></span>
<spanclass="line"><spanstyle="--shiki-light:#11782a;--shiki-dark:#85E89D;"> depends</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: [] </span><spanstyle="--shiki-light:#62687b;--shiki-dark:#818e99;"># Optional, hard dependency list (library names or PHP extension names with ext- prefix)</span></span>
<spanclass="line"><spanstyle="--shiki-light:#11782a;--shiki-dark:#85E89D;"> suggests</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: [] </span><spanstyle="--shiki-light:#62687b;--shiki-dark:#818e99;"># Optional, optional dependency list (same format as depends)</span></span>
<spanclass="line"><spanstyle="--shiki-light:#11782a;--shiki-dark:#85E89D;"> tools</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: [] </span><spanstyle="--shiki-light:#62687b;--shiki-dark:#818e99;"># Optional, ToolPackage names required only while building</span></span>
<spanclass="line"><spanstyle="--shiki-light:#62687b;--shiki-dark:#818e99;"> # ── library / target Specific Fields ───────────────────────────────────────</span></span>
<spanclass="line"><spanstyle="--shiki-light:#62687b;--shiki-dark:#818e99;"> # The following fields are used to verify that artifacts have been correctly</span></span>
<spanclass="line"><spanstyle="--shiki-light:#62687b;--shiki-dark:#818e99;"> # installed after the build. headers, static-libs, and static-bins support</span></span>
<spanclass="line"><spanstyle="--shiki-light:#62687b;--shiki-dark:#818e99;"> # Verify that specified header files or directories exist under buildroot/include/</span></span>
<spanclass="line"><spanstyle="--shiki-light:#62687b;--shiki-dark:#818e99;"> # Relative paths are based on buildroot/include/, absolute paths are used directly</span></span>
<spanclass="line"><spanstyle="--shiki-light:#62687b;--shiki-dark:#818e99;"> # Verify that specified static library files exist under buildroot/lib/</span></span>
<spanclass="line"><spanstyle="--shiki-light:#62687b;--shiki-dark:#818e99;"> # Relative paths are based on buildroot/lib/, absolute paths are used directly</span></span>
<spanclass="line"><spanstyle="--shiki-light:#62687b;--shiki-dark:#818e99;"> # Verify that specified .pc files exist under buildroot/lib/pkgconfig/</span></span>
<spanclass="line"><spanstyle="--shiki-light:#62687b;--shiki-dark:#818e99;"> # Only checked on non-Windows platforms (pkg-config is not applicable on Windows)</span></span>
<spanclass="line"><spanstyle="--shiki-light:#62687b;--shiki-dark:#818e99;"> # Verify that specified executable files exist under buildroot/bin/</span></span>
<spanclass="line"><spanstyle="--shiki-light:#62687b;--shiki-dark:#818e99;"> # Relative paths are based on buildroot/bin/, absolute paths are used directly</span></span>
<spanclass="line"><spanstyle="--shiki-light:#62687b;--shiki-dark:#818e99;"> # List of directories injected into the global PATH after the package is installed.</span></span>
<spanclass="line"><spanstyle="--shiki-light:#62687b;--shiki-dark:#818e99;"> # Path placeholders are supported (see below for details).</span></span>
<spanclass="line"><spanstyle="--shiki-light:#62687b;--shiki-dark:#818e99;"> # Environment variables set after the package is installed (overwrites existing values).</span></span>
<spanclass="line"><spanstyle="--shiki-light:#62687b;--shiki-dark:#818e99;"> # Path placeholders are supported.</span></span>
<spanclass="line"><spanstyle="--shiki-light:#62687b;--shiki-dark:#818e99;"> # Values appended to the end of existing environment variables after the package is installed.</span></span>
<spanclass="line"><spanstyle="--shiki-light:#62687b;--shiki-dark:#818e99;"> # Path placeholders are supported.</span></span>
<spanclass="line"><spanstyle="--shiki-light:#11782a;--shiki-dark:#85E89D;"> CFLAGS</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><spanstyle="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">' -I{build_root_path}/include'</span></span></code></pre></div><p>The following path placeholders are supported in string values of the <code>path</code>, <code>env</code>, and <code>append-env</code> fields:</p><tabletabindex="0"><thead><tr><th>Placeholder</th><th>Actual Path</th></tr></thead><tbody><tr><td><code>{build_root_path}</code></td><td>buildroot directory (<code>buildroot/</code>)</td></tr><tr><td><code>{pkg_root_path}</code></td><td>pkgroot directory (<code>pkgroot/</code>)</td></tr><tr><td><code>{working_dir}</code></td><td>Working directory (project root)</td></tr><tr><td><code>{download_path}</code></td><td>Download cache directory (<code>downloads/</code>)</td></tr><tr><td><code>{source_path}</code></td><td>Extracted source directory (<code>source/</code>)</td></tr><tr><td><code>{spc_msys2_path}</code></td><td>MSYS2 root directory (<code>msys64/</code>) — Windows only</td></tr></tbody></table><h2id="tool-package-type"tabindex="-1">tool Package Type <aclass="header-anchor"href="#tool-package-type"aria-label="Permalink to “tool Package Type”"></a></h2><p>A <code>tool</code> package represents an executable needed while building another package, rather than a library linked into the final target. Tool packages may use a pre-built binary or build from source, and install under <code>pkgroot/</code> by default, using either a shared <code>bin/</code> directory or a configured subdirectory. Packages request them through the top-level <code>tools</code> field; this dependency set is resolved independently of <code>depends</code> and <code>suggests</code>.</p><divclass="language-yaml"><buttontitle="Copy Code"class="copy"></button><spanclass="lang">yaml</span><preclass="shiki shiki-themes github-light github-dark"style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;"tabindex="0"dir="ltr"><code><spanclass="line"><spanstyle="--shiki-light:#11782a;--shiki-dark:#85E89D;">nasm</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
<spanclass="line"><spanstyle="--shiki-light:#11782a;--shiki-dark:#85E89D;"> min-version</span><spanstyle="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><spanstyle="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'2.16'</span></span></code></pre></div><p>The nested <code>tool</code> object supports:</p><tabletabindex="0"><thead><tr><th>Field</th><th>Required</th><th>Meaning</th></tr></thead><tbody><tr><td><code>provides</code></td><td>Yes</td><td>Executable filenames used to decide whether the tool is installed</td></tr><tr><td><code>binary-subdir</code></td><td>No</td><td>Directory below <code>install-root</code> containing the executables; defaults to the install root</td></tr><tr><td><code>install-root</code></td><td>No</td><td>Installation root; defaults to <code>PKG_ROOT_PATH</code> and supports path placeholders</td></tr><tr><td><code>min-version</code></td><td>No</td><td>Declared minimum version metadata exposed by <code>ToolPackage</code>; the installer does not currently enforce it</td></tr></tbody></table><p>Fields inside <code>tool</code> may use <code>@windows</code>, <code>@unix</code>, <code>@linux</code>, and <code>@macos</code> suffixes. For example, <code>provides@windows</code> can list <code>.exe</code> names while <code>provides@unix</code> lists Unix names.</p><h2id="target-package-type"tabindex="-1">target Package Type <aclass="header-anchor"href="#target-package-type"aria-label="Permalink to “target Package Type”"></a></h2><p>A <code>target</code> package represents a final build artifact. It inherits from <code>library</code>, so it includes all definition fields of <code>library</code>. Its configuration file is located in <code>config/pkg/target/</code>. Optional recipe classes are normally placed in <code>src/Package/Target/</code>, registered with <code>#[Target]</code>, and receive a <code>TargetPackage</code>; inheriting from <code>TargetPackage</code> is optional.</p><p>The only difference from <code>library</code> is that a <code>target</code> package can be registered as a build target and automatically registers the build command <code>spc build:{target-name}</code>.</p><h2id="virtual-target-package-type"tabindex="-1">virtual-target Package Type <aclass="header-anchor"href="#virtual-target-package-type"aria-label="Permalink to “virtual-target Package Type”"></a></h2><p>Unlike <code>target</code>, a <code>virtual-target</code> may omit <code>artifact</code>, meaning it doesn't directly correspond to a buildable entity but is instead an abstract build target, primarily used for dependency management and build scheduling. Its configuration and optional recipe classes use the same directories and <code>#[Target]</code> registration mechanism as <code>target</code>. Its definition is otherwise essentially the same, but the <code>artifact</code> field is optional and typically not set. <code>virtual-target</code> is primarily used in the following scenarios:</p><ul><li>Defining an abstract build target for other packages to depend on, without directly corresponding to a buildable entity.</li><li>Serving as a common dependency for multiple <code>target</code> packages, simplifying dependency management.</li></ul><p>Typical examples are the <code>php-cli</code> and <code>php-fpm</code> build targets. They have no independent source and depend on the <code>php</code> target, whose Artifact is <code>php-src</code>; build scheduling determines whether the CLI or FPM binary is produced.</p></div></div></main><footerclass="VPDocFooter"data-v-7011f0d8data-v-e29034c6><!--[--><!--]--><!----><navclass="prev-next"aria-labelledby="doc-footer-aria-label"data-v-e29034c6><spanclass="visually-hidden"id="doc-footer-aria-label"data-v-e29034c6>Pager</span><divclass="pager"data-v-e29034c6><aclass="VPLink link pager-link prev"href="/en/develop/registry.html"data-v-e29034c6><!--[--><spanclass="desc"data-v-e29034c6>Previous page</span><spanclass="title"data-v-e29034c6>Registry</span><!--]--></a></div><divclass="pager"data-v-e29034c6><aclass="VPLink