Skip to content

Conversation

@PVermeer
Copy link
Contributor

@PVermeer PVermeer commented Oct 9, 2025

Description

This is hopefully the last PR. This fixes the fedora package build via cmake. When I build sunshine locally I could never get cuda to work so I always build it without it since I don't need it.

However I looked into the rpm spec file and transferred those changes to the linux_build.sh script and it now all seems to work.

Issues & solutions

  • wget Complained about the relative link in the -O argument when downloading cuda so I made it resolve to an an absolute path before it gets used (2beecac).
  • cmake Complained it could not find compilers so these are now explicitly set. This was already done in the copr build (0279b20).
  • cuda Could not build so I copied some config over from the rpm spec (16918a8):
    • added the --override flag conditionally
    • added CMAKE_CUDA_HOST_COMPILER flag to cmake

Every docker (including my own Fedora) is now building and packaging correctly. I don't know anything about building cuda so please look carefully.

I also want to note that it should also be possible to use the linux_build.sh script in the copr build so you don't have to maintain two separate builds. Things like cuda, the build and install could be run from the script.

Screenshot

Issues Fixed or Closed

Roadmap Issues

Type of Change

  • feat: New feature (non-breaking change which adds functionality)
  • fix: Bug fix (non-breaking change which fixes an issue)
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semicolons, etc.)
  • refactor: Code change that neither fixes a bug nor adds a feature
  • perf: Code change that improves performance
  • test: Adding missing tests or correcting existing tests
  • build: Changes that affect the build system or external dependencies
  • ci: Changes to CI configuration files and scripts
  • chore: Other changes that don't modify src or test files
  • revert: Reverts a previous commit
  • BREAKING CHANGE: Introduces a breaking change (can be combined with any type above)

Checklist

  • Code follows the style guidelines of this project
  • Code has been self-reviewed
  • Code has been commented, particularly in hard-to-understand areas
  • Code docstring/documentation-blocks for new or existing methods/components have been added or updated
  • Unit tests have been added or updated for any new or modified functionality

AI Usage

  • None: No AI tools were used in creating this PR
  • Light: AI provided minor assistance (formatting, simple suggestions)
  • Moderate: AI helped with code generation or debugging specific parts
  • Heavy: AI generated most or all of the code changes

In Fedora wget complains about -O relative path
Cmake complains about not finding compilers
This is copied from the rpm spec file.
Copy link
Member

@ReenigneArcher ReenigneArcher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for another PR!

As a note: we don't use this script for Fedora or Arch internally, so it's likely those 2 will break from time to time. We used it for Fedora before we changed to the copr builds.

@PVermeer
Copy link
Contributor Author

PVermeer commented Oct 9, 2025

As a note: we don't use this script for Fedora or Arch internally, so it's likely those 2 will break from time to time. We used it for Fedora before we changed to the copr builds.

I know, I'm just saying you could ;). The logic in the script and the rpm spec is now basically the same.

Simplify compiler version definitions
@PVermeer
Copy link
Contributor Author

I've removed all the compiler version logic with alternative compilers and just set the compiler with version before cmake runs. It's much cleaner indeed.

Tested all build again, no issues found.

@codecov
Copy link

codecov bot commented Oct 10, 2025

Bundle Report

Bundle size has no change ✅

@codecov
Copy link

codecov bot commented Oct 10, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 11.98%. Comparing base (ed7b78f) to head (20cec98).
⚠️ Report is 79 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4325      +/-   ##
==========================================
- Coverage   12.01%   11.98%   -0.03%     
==========================================
  Files          87       87              
  Lines       17572    17572              
  Branches     8076     8076              
==========================================
- Hits         2111     2106       -5     
- Misses      14743    14748       +5     
  Partials      718      718              
Flag Coverage Δ
Linux-AppImage 11.49% <ø> (ø)
Windows-AMD64 13.26% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.
see 1 file with indirect coverage changes

@ReenigneArcher
Copy link
Member

ReenigneArcher commented Oct 10, 2025

Just one thing to fix/tweak.

This step (https://github.com/PVermeer/Sunshine/blob/699e8347da229243c190cea1fb8950a5b0f35ecd/.github/workflows/ci-linux.yml#L180) is failing because it's finding a different gcov version than what version of gcc the code was compiled with. I guess because the export variables are not getting picked up by this step.

I think to solve it we can echo the variables to the GITHUB_ENV file, like so. Then they will picked up in later steps automatically.

{
  echo "CC=gcc-${gcc_version}"
  echo "CXX=g++-${gcc_version}"
} >> "${GITHUB_ENV}"

This assumes gcovr/gcov will use the CC/CXX variables.

@PVermeer
Copy link
Contributor Author

Setting the variables doesn't work.
We need to do this: https://gcovr.com/en/latest/guide/compiling.html#choosing-the-right-gcov-executable.
I've done some testing and this works:

python3 -m gcovr --gcov-executable gcov-14 . -r ../src \
    --exclude-noncode-lines \
    --exclude-throw-branches \
    --exclude-unreachable-branches \
    --verbose \
    --xml-pretty \
    -o coverage.xml

I've implemented your suggestion with the info above (20cec98).

@sonarqubecloud
Copy link

@ReenigneArcher ReenigneArcher changed the title build(linux): sunshine now builds correctly in Fedora build(linux): explicitely set CC and CXX compilers Oct 11, 2025
@ReenigneArcher ReenigneArcher merged commit 246d8f1 into LizardByte:master Oct 11, 2025
48 checks passed
@PVermeer PVermeer deleted the build_fedora_docker branch October 11, 2025 15:28
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

Successfully merging this pull request may close these issues.

2 participants