Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fedora 40: Build from source fails when generating RPM #3184

Open
2 tasks done
corecontingency opened this issue Sep 14, 2024 · 6 comments
Open
2 tasks done

Fedora 40: Build from source fails when generating RPM #3184

corecontingency opened this issue Sep 14, 2024 · 6 comments

Comments

@corecontingency
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Is your issue described in the documentation?

  • I have read the documentation

Is your issue present in the latest beta/pre-release?

This issue is present in the latest pre-release

Describe the Bug

Building from git head on the master branch with fully updated Fedora 40 with:

$ mkdir build
$ cmake -B build -G Ninja -S .
$ ninja -C build

The above commands run successfully, with no failures. However, when generating the RPM package with:

$ cpack -G RPM --config ./build/CPackConfig.cmake

the command fails at generating the RPM with

+ mv /home/user/src/Sunshine/build/cpack_artifacts/_CPack_Packages/Linux/RPM/tmpBBroot /home/user/src/Sunshine/build/cpack_artifacts/_CPack_Packages/Linux/RPM/Sunshine
+ /usr/lib/rpm/check-buildroot
+ /usr/lib/rpm/redhat/brp-ldconfig
+ /usr/lib/rpm/brp-compress
+ /usr/lib/rpm/brp-strip /usr/bin/strip
+ /usr/lib/rpm/brp-strip-comment-note /usr/bin/strip /usr/bin/objdump
+ /usr/lib/rpm/redhat/brp-strip-lto /usr/bin/strip
+ /usr/lib/rpm/brp-strip-static-archive /usr/bin/strip
+ /usr/lib/rpm/check-rpaths
+ /usr/lib/rpm/redhat/brp-mangle-shebangs
+ /usr/lib/rpm/brp-remove-la-files
+ env /usr/lib/rpm/redhat/brp-python-bytecompile '' 1 0 -j20
+ /usr/lib/rpm/redhat/brp-python-hardlink
error: File must begin with "/": sunshine
    File must begin with "/": sunshine
 ***
CPackRPM:Debug:    - /home/user/src/Sunshine/build/cpack_artifacts/_CPack_Packages/Linux/RPM/rpmbuildsunshine.out
CPackRPM:Debug: *** Building target platforms: x86_64
Building for target x86_64
setting SOURCE_DATE_EPOCH=1278201600
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.XnKinq
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.rTWrek
Processing files: sunshine-0.0.0-1.x86_64

RPM build errors:
 ***
CMake Error at /usr/share/cmake/Modules/Internal/CPack/CPackRPM.cmake:1911 (message):
  RPM package was not generated!
  /home/user/src/Sunshine/build/cpack_artifacts/_CPack_Packages/Linux/RPM
Call Stack (most recent call first):
  /usr/share/cmake/Modules/Internal/CPack/CPackRPM.cmake:1982 (cpack_rpm_generate_package)


CPack Error: Error while execution CPackRPM.cmake
CPack Error: Problem compressing the directory
CPack Error: Error when generating package: Sunshine

Thank you for the help. Please let me know if I can do anything else or provide further logging.

Expected Behavior

The RPM package should generate successfully.

Additional Context

No response

Host Operating System

Linux

Operating System Version

Fedora 40, fully up to date.

Architecture

64 bit

Sunshine commit or version

c892026

Package

other (self built)

GPU Type

AMD

GPU Model

N/A

GPU Driver/Mesa Version

N/A

Capture Method

None

Config

N/A

Apps

No response

Relevant log output

N/A, failure output above.
@ReenigneArcher
Copy link
Member

I guess you need to add cmake args:

cmake_args=(

Probably easier to just use our script.

@mattheja
Copy link

I am using Fedora 40 KDE. Followed documentation, installed the pre-reqs for Fedora 38, 39. Same error.

One of my first times building from source, so I may have not done this right.

$ git clone https://github.com/lizardbyte/sunshine.git --recurse-submodules
$ cd sunshine
$ chmod +x scripts/linux_build.sh
$ ./scripts/linux_build.sh
$ cd build
$ cmake ..
$ cpack -G RPM
$ cpack -G RPM
CPack: Create package using RPM
CPack: Install projects
CPack: - Run preinstall target for: Sunshine
CPack: - Install project: Sunshine []
CPack: Create package
CPackRPM:Warning: CPACK_SET_DESTDIR is set (=true) while requesting a relocatable package (CPACK_RPM_PACKAGE_RELOCATABLE is set): this is not supported, the package won't be relocatable.
CPackRPM: Will use GENERATED spec file: /home/mattheja/Projects/sunshine/build/cpack_artifacts/_CPack_Packages/Linux/RPM/SPECS/sunshine.spec
CPackRPM:Debug: You may consult rpmbuild logs in: 
CPackRPM:Debug:    - /home/mattheja/Projects/sunshine/build/cpack_artifacts/_CPack_Packages/Linux/RPM/rpmbuildsunshine.err
CPackRPM:Debug: *** + umask 022
+ cd /home/mattheja/Projects/sunshine/build/cpack_artifacts/_CPack_Packages/Linux/RPM/BUILD
+ mv /home/mattheja/Projects/sunshine/build/cpack_artifacts/_CPack_Packages/Linux/RPM/Sunshine /home/mattheja/Projects/sunshine/build/cpack_artifacts/_CPack_Packages/Linux/RPM/tmpBBroot
+ RPM_EC=0
++ jobs -p
+ exit 0
+ umask 022
+ cd /home/mattheja/Projects/sunshine/build/cpack_artifacts/_CPack_Packages/Linux/RPM/BUILD
+ '[' /home/mattheja/Projects/sunshine/build/cpack_artifacts/_CPack_Packages/Linux/RPM/Sunshine '!=' / ']'
+ rm -rf /home/mattheja/Projects/sunshine/build/cpack_artifacts/_CPack_Packages/Linux/RPM/Sunshine
++ dirname /home/mattheja/Projects/sunshine/build/cpack_artifacts/_CPack_Packages/Linux/RPM/Sunshine
+ mkdir -p /home/mattheja/Projects/sunshine/build/cpack_artifacts/_CPack_Packages/Linux/RPM
+ mkdir /home/mattheja/Projects/sunshine/build/cpack_artifacts/_CPack_Packages/Linux/RPM/Sunshine
+ CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer '
+ export CFLAGS
+ CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer '
+ export CXXFLAGS
+ FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules '
+ export FFLAGS
+ FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -I/usr/lib64/gfortran/modules '
+ export FCFLAGS
+ VALAFLAGS=-g
+ export VALAFLAGS
+ RUSTFLAGS='-Copt-level=3 -Cdebuginfo=2 -Ccodegen-units=1 -Cstrip=none -Cforce-frame-pointers=yes -Clink-arg=-specs=/usr/lib/rpm/redhat/redhat-package-notes --cap-lints=warn'
+ export RUSTFLAGS
+ LDFLAGS='-Wl,-z,relro -Wl,--as-needed  -Wl,-z,pack-relative-relocs -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -Wl,--build-id=sha1 -specs=/usr/lib/rpm/redhat/redhat-package-notes '
+ export LDFLAGS
+ LT_SYS_LIBRARY_PATH=/usr/lib64:
+ export LT_SYS_LIBRARY_PATH
+ CC=gcc
+ export CC
+ CXX=g++
+ export CXX
+ '[' -e /home/mattheja/Projects/sunshine/build/cpack_artifacts/_CPack_Packages/Linux/RPM/Sunshine ']'
+ rm -rf /home/mattheja/Projects/sunshine/build/cpack_artifacts/_CPack_Packages/Linux/RPM/Sunshine
+ mv /home/mattheja/Projects/sunshine/build/cpack_artifacts/_CPack_Packages/Linux/RPM/tmpBBroot /home/mattheja/Projects/sunshine/build/cpack_artifacts/_CPack_Packages/Linux/RPM/Sunshine
+ /usr/lib/rpm/check-buildroot
+ /usr/lib/rpm/redhat/brp-ldconfig
+ /usr/lib/rpm/brp-compress
+ /usr/lib/rpm/brp-strip /usr/bin/strip
+ /usr/lib/rpm/brp-strip-comment-note /usr/bin/strip /usr/bin/objdump
+ /usr/lib/rpm/redhat/brp-strip-lto /usr/bin/strip
+ /usr/lib/rpm/brp-strip-static-archive /usr/bin/strip
+ /usr/lib/rpm/check-rpaths
+ /usr/lib/rpm/redhat/brp-mangle-shebangs
+ /usr/lib/rpm/brp-remove-la-files
+ env /usr/lib/rpm/redhat/brp-python-bytecompile '' 1 0 -j16
+ /usr/lib/rpm/redhat/brp-python-hardlink
error: File must begin with "/": sunshine
    File must begin with "/": sunshine
 ***
CPackRPM:Debug:    - /home/mattheja/Projects/sunshine/build/cpack_artifacts/_CPack_Packages/Linux/RPM/rpmbuildsunshine.out
CPackRPM:Debug: *** Building target platforms: x86_64
Building for target x86_64
setting SOURCE_DATE_EPOCH=1278201600
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.N7IdR4
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.VtzKq3
Processing files: sunshine-0.0.0.dirty-1.x86_64

RPM build errors:
 ***
CMake Error at /usr/share/cmake/Modules/Internal/CPack/CPackRPM.cmake:1911 (message):
  RPM package was not generated!
  /home/mattheja/Projects/sunshine/build/cpack_artifacts/_CPack_Packages/Linux/RPM
Call Stack (most recent call first):
  /usr/share/cmake/Modules/Internal/CPack/CPackRPM.cmake:1982 (cpack_rpm_generate_package)


CPack Error: Error while execution CPackRPM.cmake
CPack Error: Problem compressing the directory
CPack Error: Error when generating package: Sunshine

@ReenigneArcher
Copy link
Member

Stop here: ./scripts/linux_build.sh

@maxdirocco
Copy link

maxdirocco commented Sep 22, 2024

I am experiencing the same issue. I believe I have narrowed it down to this PR: #3013. The changes on Linux do in fact seem to break packaging for RPMs, at least when following build instructions from the docs.

@ReenigneArcher
Copy link
Member

Seems unlikely, since we're building it in CI. Are you following the master branch instructions? https://docs.lizardbyte.dev/projects/sunshine/en/master/md_docs_2building.html

@maxdirocco
Copy link

Ah, nope I was using the latest branch instructions. Sorry for the confusion!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants