Skip to content

GPU (Linux): fixes builds without DRM headers - #2767

Open
sagar2664 wants to merge 2 commits into
fastfetch-cli:devfrom
sagar2664:fix/linux-gpu-without-drm-headers
Open

sagar2664 wants to merge 2 commits into
fastfetch-cli:devfrom
sagar2664:fix/linux-gpu-without-drm-headers

Conversation

@sagar2664

Copy link
Copy Markdown

Summary

Fastfetch failed to build on Linux when neither libdrm nor the kernel DRM headers were installed. The GPU detector called six ioctl helpers that this configuration leaves out.

Related issue

Closes #2766.

Changes

  • Use the same header check for the GPU helpers and their callers. Keep sysfs detection and Asahi model identification available in builds without DRM headers.
  • Hide the kernel DRM header in the no-features CI job. Ubuntu normally supplies it even with ENABLE_DRM=OFF, which masked the build failure.

Testing

  • Reproduced the compiler errors on the upstream dev branch.
  • Built on Linux arm64 with libdrm, with kernel DRM headers alone, and with neither. All 21 CTests passed in each configuration.
  • Ran the no-features job locally, including packaging, CLI smoke tests, and CTest. The test containers had no GPU device for hardware checks.

Use the same header check for the GPU ioctl helpers and their callers. Keep the sysfs probes and Asahi name lookup available when the headers are missing.
The no-features job disables libdrm, but Ubuntu also provides DRM headers through linux-libc-dev. Divert the header in this job to exercise the configuration used by minimal Linux toolchains.

This branch has not been deployed

No deployments
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.

[BUG] can't build without libdrm on Linux

1 participant