rpm-4.18.92-1.fc39 Reproducible: Always Steps to Reproduce: 1. use $RPM_BUILD_DIR in %files %doc 2. 3. Actual Results: It is not expanded Expected Results: It is expanded It was working for a long time, e.g. here: https://kojipkgs.fedoraproject.org//packages/espeak/1.48.04/24.fc38/data/logs/x86_64/build.log Where: cp -pr /builddir/build/BUILD/espeak-1.48.04-source/ReadMe /builddir/build/BUILDROOT/espeak-1.48.04-24.fc38.x86_64/usr/share/doc/espeak Was originally in the espeak spec: %doc $RPM_BUILD_DIR/espeak-%{version}-source/ReadMe Now it doesn't expand, e.g.: https://kojipkgs.fedoraproject.org//work/tasks/1116/104531116/build.log + cp -pr '/builddir/build/BUILD/espeak-1.48.04-source/$RPM_BUILD_DIR/espeak-1.48.04-source/ReadMe' /builddir/build/BUILDROOT/espeak-1.48.04-25.fc39.x86_64/usr/share/doc/espeak cp: cannot stat '/builddir/build/BUILD/espeak-1.48.04-source/$RPM_BUILD_DIR/espeak-1.48.04-source/ReadMe': No such file or directory It breaks several builds.
FEDORA-2023-e4d5549651 has been submitted as an update to Fedora 39. https://bodhi.fedoraproject.org/updates/FEDORA-2023-e4d5549651
FEDORA-2023-e4d5549651 has been pushed to the Fedora 39 stable repository. If problem still persists, please make note of it in this bug report.
(In reply to Jaroslav Škarvada from comment #0) > Was originally in the espeak spec: > %doc $RPM_BUILD_DIR/espeak-%{version}-source/ReadMe Environment variables were never supported in the %files section. The reason it worked previously was just a side effect of RPM passing the filenames verbatim to the "cp" command in a shell script that it internally creates in order to copy %doc entries to the build root. There is a bug fix in the 4.19 codebase which makes those filenames single-quoted, to prevent any shell meta characters to interfere, including the dollar sign, which is why you're seeing this behavior now. This is the patch: https://github.com/rpm-software-management/rpm/commit/a06374be2f85e457cb526edb8ead40f57c82bfd6 Hence, the fix here would be to use the %{_builddir} macro which gets expanded at SPEC parse time, i.e. before "cp" is invoked. That said, you don't need to specify an absolute path here. The %doc directive, if given a relative path, looks for the filename relative to the build directory [1]. I can see you've already fixed this in your SPEC so that relative paths are used instead, which is correct. [1] http://ftp.rpm.org/max-rpm/s1-rpm-inside-files-list-directives.html
Not sure why the needinfo flag was activated, fixing.
Minor correction for: (In reply to Michal Domonkos from comment #3) > Hence, the fix here would be to use the %{_builddir} macro which gets > expanded at SPEC parse time, i.e. before "cp" is invoked. This actually wouldn't work since the macro would expand to an absolute path at parse time, triggering the code path in RPM that treats the %doc entry as a path relative to the build root, not build dir. So you would need to install the file to the appropriate location in %install and refer to it normally as any other %files entry here, or specify a relative path to make it do that automatically (as you now do).
Changing resolution to NOTABUG which this is. Linking this to an errata gives an impression of something being fixed in rpm for this which is not the case.