Skip to main content
Version: 2.23 (prerelease)

nfpm


The nFPM deb, rpm, apk, and archlinux packager (https://nfpm.goreleaser.com).

Backend: pants.backend.experimental.nfpm

Config section: [nfpm]

Basic options

default_mtime

--nfpm-default-mtime=<str>
PANTS_NFPM_DEFAULT_MTIME
pants.toml
[nfpm]
default_mtime = <str>
default: 1980-01-01T00:00:00Z

The file modification time as an RFC 3339 formatted string.

For example: 2008-01-02T15:04:05Z

The format is defined in RFC 3339: https://rfc-editor.org/rfc/rfc3339.html

This option sets the default value for: - the package_mtime field on nfpm_*_package targets, and - the file_mtime field on nfpm_content_* targets.

The default value is '1980-01-01T00:00:00Z'. You may also set the SOURCE_DATE_EPOCH environment variable to override this default.

See also: https://reproducible-builds.org/docs/timestamps/

Can be overriden by fieldnfpm_default_mtime on local_environment, docker_environment, or remote_environmenttargets.

Advanced options

known_versions

--nfpm-known-versions="['<str>', '<str>', ...]"
PANTS_NFPM_KNOWN_VERSIONS
pants.toml
[nfpm]
known_versions = [
'<str>',
'<str>',
...,
]
default:
[
  "2.38.0|linux_arm64 |e63be8d586d7c8f6af06945956aa29fb88388caa19d7c5b652f41ae37a155b27|4780662",
  "2.38.0|linux_x86_64|d9eebe93ee2832cfc8435b3f79ee92a845f1e5fbb99db5a3777a0013e175170d|5196368",
  "2.38.0|macos_arm64 |48788831696cf056b1a0f9f52e187dbb65c191f5488962696ab3b98fff9f7821|4978997",
  "2.38.0|macos_x86_64|781420f18ed6bd84a437fe3b272c1b1a03bad546aaaf4f7251b21c25a24ce32b|5294310",
  "2.38.0|win_arm64   |1a9c7fcd50eb105231f6f6f6cb90d7cdf50e6c34665eb6e881a185387ad158b1|4888861",
  "2.38.0|win_x86_64  |3124f9bb838410ef98eebfed2267670790ce6bb262ae2a6ca1938a69e087593b|5389117"
]

Known versions to verify downloads against.

Each element is a pipe-separated string of version|platform|sha256|length or version|platform|sha256|length|url_override, where:

  • version is the version string
  • platform is one of [linux_arm64,linux_x86_64,macos_arm64,macos_x86_64]
  • sha256 is the 64-character hex representation of the expected sha256 digest of the download file, as emitted by shasum -a 256
  • length is the expected length of the download file in bytes, as emitted by wc -c
  • (Optional) url_override is a specific url to use instead of the normally generated url for this version

E.g., 3.1.2|macos_x86_64|6d0f18cd84b918c7b3edd0203e75569e0c7caecb1367bbbe409b44e28514f5be|42813. and 3.1.2|macos_arm64 |aca5c1da0192e2fd46b7b55ab290a92c5f07309e7b0ebf4e45ba95731ae98291|50926|https://example.mac.org/bin/v3.1.2/mac-aarch64-v3.1.2.tgz.

Values are space-stripped, so pipes can be indented for readability if necessary.

url_platform_mapping

--nfpm-url-platform-mapping="{'key1': val1, 'key2': val2, ...}"
PANTS_NFPM_URL_PLATFORM_MAPPING
pants.toml
[nfpm.url_platform_mapping]
key1 = val1
key2 = val2
...
default:
{
  "linux_arm64": "Linux_arm64.tar.gz",
  "linux_x86_64": "Linux_x86_64.tar.gz",
  "macos_arm64": "Darwin_arm64.tar.gz",
  "macos_x86_64": "Darwin_x86_64.tar.gz",
  "win_arm64": "Windows_arm64.zip",
  "win_x86_64": "Windows_x86_64.zip"
}

A dictionary mapping platforms to strings to be used when generating the URL to download the tool.

In --url-template, anytime the {platform} string is used, Pants will determine the current platform, and substitute {platform} with the respective value from your dictionary.

For example, if you define {"macos_x86_64": "apple-darwin", "linux_x86_64": "unknown-linux"}, and run Pants on Linux with an intel architecture, then {platform} will be substituted in the --url-template option with unknown-linux.

url_template

--nfpm-url-template=<str>
PANTS_NFPM_URL_TEMPLATE
pants.toml
[nfpm]
url_template = <str>
default: https://github.com/goreleaser/nfpm/releases/download/v{version}/nfpm_{version}_{platform}

URL to download the tool, either as a single binary file or a compressed file (e.g. zip file). You can change this to point to your own hosted file, e.g. to work with proxies or for access via the filesystem through a file:$abspath URL (e.g. file:/this/is/absolute, possibly by templating the buildroot in a config file).

Use {version} to have the value from --version substituted, and {platform} to have a value from --url-platform-mapping substituted in, depending on the current platform. For example, https://github.com/.../protoc-&#123;version&#125;-&#123;platform&#125;.zip.

use_unsupported_version

--nfpm-use-unsupported-version=<UnsupportedVersionUsage>
PANTS_NFPM_USE_UNSUPPORTED_VERSION
pants.toml
[nfpm]
use_unsupported_version = <UnsupportedVersionUsage>
one of: error, warning
default: error

What action to take in case the requested version of nFPM is not supported.

Supported nFPM versions: unspecified

version

--nfpm-version=<str>
PANTS_NFPM_VERSION
pants.toml
[nfpm]
version = <str>
default: 2.38.0

Use this version of nFPM.

Deprecated options

None

None