Open antheas opened 1 month ago
A reproducer that is runnable via podman (or docker) if this is needed for the maintainers to confirm the problem (and the fix as proposed in #2082):
> cat Dockerfile
ARG FEDORA_VERSION=41
FROM quay.io/fedora/fedora:${FEDORA_VERSION}
RUN dnf install -y \
gcc \
libffi-devel \
rpm-build \
ruby-devel
RUN gem install --no-document fpm
RUN mkdir -p /package-content && touch package-content/some-file
RUN fpm --verbose -a noarch -s dir -t rpm -n some-package -v 1.0.42 /package-content
> podman build --build-arg FEDORA_VERSION=41 .
Trying to pull quay.io/fedora/fedora:41...
Getting image source signatures
Copying blob sha256:369613bebfa25e0c521a99acae45fac060a223d7c89b4c678a35221a3772be91
Copying config sha256:ef6d734948fdbd09a99edcd486a7b01f5adfa3c8846186c62673d26c1dc7d324
Writing manifest to image destination
STEP 2/5: RUN dnf install -y gcc libffi-devel rpm-build ruby-devel
... (snapped)
STEP 4/5: RUN mkdir -p /package-content && touch package-content/some-file
--> 993dccd7d451
STEP 5/5: RUN fpm --verbose -a noarch -s dir -t rpm -n some-package -v 1.0.42 /package-content
{:timestamp=>"2024-11-04T23:30:03.305935+0000", :message=>"Setting workdir", :workdir=>"/tmp", :level=>:info}
{:timestamp=>"2024-11-04T23:30:03.309508+0000", :message=>"Setting from flags: architecture=noarch", :level=>:info}
{:timestamp=>"2024-11-04T23:30:03.309567+0000", :message=>"Setting from flags: epoch=", :level=>:info}
{:timestamp=>"2024-11-04T23:30:03.309587+0000", :message=>"Setting from flags: iteration=", :level=>:info}
{:timestamp=>"2024-11-04T23:30:03.309615+0000", :message=>"Setting from flags: name=some-package", :level=>:info}
{:timestamp=>"2024-11-04T23:30:03.309635+0000", :message=>"Setting from flags: url=http://example.com/no-uri-given", :level=>:info}
{:timestamp=>"2024-11-04T23:30:03.309662+0000", :message=>"Setting from flags: version=1.0.42", :level=>:info}
{:timestamp=>"2024-11-04T23:30:03.309716+0000", :message=>"Converting dir to rpm", :level=>:info}
{:timestamp=>"2024-11-04T23:30:03.313736+0000", :message=>"Reading template", :path=>"/usr/local/share/gems/gems/fpm-1.15.1/templates/rpm.erb", :level=>:info}
{:timestamp=>"2024-11-04T23:30:03.316696+0000", :message=>"Running rpmbuild", :args=>["rpmbuild", "-bb", "--target", "noarch", "--define", "buildroot /tmp/package-rpm-build-b4e60ee6d12dcb42e9a90eb872c34a2c23085601b35a04dc8eea26024886/BUILD", "--define", "_topdir /tmp/package-rpm-build-b4e60ee6d12dcb42e9a90eb872c34a2c23085601b35a04dc8eea26024886", "--define", "_sourcedir /tmp/package-rpm-build-b4e60ee6d12dcb42e9a90eb872c34a2c23085601b35a04dc8eea26024886", "--define", "_rpmdir /tmp/package-rpm-build-b4e60ee6d12dcb42e9a90eb872c34a2c23085601b35a04dc8eea26024886/RPMS", "--define", "_tmppath /tmp", "/tmp/package-rpm-build-b4e60ee6d12dcb42e9a90eb872c34a2c23085601b35a04dc8eea26024886/SPECS/some-package.spec"], :level=>:info}
{:timestamp=>"2024-11-04T23:30:03.325700+0000", :message=>"Building target platforms: noarch", :level=>:info}
{:timestamp=>"2024-11-04T23:30:03.325771+0000", :message=>"Building for target noarch", :level=>:info}
{:timestamp=>"2024-11-04T23:30:03.328723+0000", :message=>"warning: Macro expanded in comment on line 24: %undefine __check_files", :level=>:info}
{:timestamp=>"2024-11-04T23:30:03.328772+0000", :message=>"", :level=>:info}
{:timestamp=>"2024-11-04T23:30:03.330938+0000", :message=>"warning: %source_date_epoch_from_changelog is set, but %changelog has no entries to take a date from", :level=>:info}
{:timestamp=>"2024-11-04T23:30:03.335808+0000", :message=>"Executing(%mkbuilddir): /bin/sh -e /tmp/rpm-tmp.DZdulW", :level=>:info}
{:timestamp=>"2024-11-04T23:30:03.345195+0000", :message=>"Executing(%prep): /bin/sh -e /tmp/rpm-tmp.ez9QB3", :level=>:info}
{:timestamp=>"2024-11-04T23:30:03.347225+0000", :message=>"Executing(%build): /bin/sh -e /tmp/rpm-tmp.7TELox", :level=>:info}
{:timestamp=>"2024-11-04T23:30:03.349317+0000", :message=>"Executing(%install): /bin/sh -e /tmp/rpm-tmp.pF8m7w", :level=>:info}
{:timestamp=>"2024-11-04T23:30:03.351546+0000", :message=>"Processing files: some-package-1.0.42-1.noarch", :level=>:info}
{:timestamp=>"2024-11-04T23:30:03.351588+0000", :message=>"", :level=>:info}
{:timestamp=>"2024-11-04T23:30:03.351652+0000", :message=>"error: File not found: /tmp/package-rpm-build-b4e60ee6d12dcb42e9a90eb872c34a2c23085601b35a04dc8eea26024886/BUILD/some-package-1.0.42-build/BUILDROOT/package-content/some-file", :level=>:info}
{:timestamp=>"2024-11-04T23:30:03.351685+0000", :message=>"RPM build warnings:", :level=>:info}
{:timestamp=>"2024-11-04T23:30:03.351707+0000", :message=>" Macro expanded in comment on line 24: %undefine __check_files", :level=>:info}
{:timestamp=>"2024-11-04T23:30:03.351726+0000", :message=>"", :level=>:info}
{:timestamp=>"2024-11-04T23:30:03.351741+0000", :message=>"", :level=>:info}
{:timestamp=>"2024-11-04T23:30:03.351756+0000", :message=>"RPM build errors:", :level=>:info}
{:timestamp=>"2024-11-04T23:30:03.351783+0000", :message=>" %source_date_epoch_from_changelog is set, but %changelog has no entries to take a date from", :level=>:info}
{:timestamp=>"2024-11-04T23:30:03.351822+0000", :message=>" File not found: /tmp/package-rpm-build-b4e60ee6d12dcb42e9a90eb872c34a2c23085601b35a04dc8eea26024886/BUILD/some-package-1.0.42-build/BUILDROOT/package-content/some-file", :level=>:info}
{:timestamp=>"2024-11-04T23:30:03.355213+0000", :message=>"Process failed: rpmbuild failed (exit code 1). Full command was:[\"rpmbuild\", \"-bb\", \"--target\", \"noarch\", \"--define\", \"buildroot /tmp/package-rpm-build-b4e60ee6d12dcb42e9a90eb872c34a2c23085601b35a04dc8eea26024886/BUILD\", \"--define\", \"_topdir /tmp/package-rpm-build-b4e60ee6d12dcb42e9a90eb872c34a2c23085601b35a04dc8eea26024886\", \"--define\", \"_sourcedir /tmp/package-rpm-build-b4e60ee6d12dcb42e9a90eb872c34a2c23085601b35a04dc8eea26024886\", \"--define\", \"_rpmdir /tmp/package-rpm-build-b4e60ee6d12dcb42e9a90eb872c34a2c23085601b35a04dc8eea26024886/RPMS\", \"--define\", \"_tmppath /tmp\", \"/tmp/package-rpm-build-b4e60ee6d12dcb42e9a90eb872c34a2c23085601b35a04dc8eea26024886/SPECS/some-package.spec\"]", :level=>:error}
Error: building at STEP "RUN fpm --verbose -a noarch -s dir -t rpm -n some-package -v 1.0.42 /package-content": while running runtime: exit status 1
The same reproducer with FEDORA_VERSION=40
works fine with the current code.
When rebuilding an rpm from an rpm on F41, it fails with the following:
It appears that in F41 the
buildroot
define does not work, and rpmbuild tries to useBUILD/pkgname/BUILDROOT
and fails since the files are not there.The following patch fixes it:
Essentially, adding the arg
--buildroot
to rpmbuild. That arg says it is deprecated however a quick search online finds no replacement... As to what happened to--define buildroot <root>
I do not know.