Skip to content

Detect newer GCC, and quiet a desktop-file-validate warning - #2

Open
jason-c-dev wants to merge 1 commit into
tirtha4:mainfrom
jason-c-dev:compiler-detection-and-desktop-entry
Open

Detect newer GCC, and quiet a desktop-file-validate warning#2
jason-c-dev wants to merge 1 commit into
tirtha4:mainfrom
jason-c-dev:compiler-detection-and-desktop-entry

Conversation

@jason-c-dev

Copy link
Copy Markdown

Two small independent fixes found while reproducing the build on Arch. Split
from the checksum PR so they can be taken separately.

The compiler search stops at g++-15

for v in 15 14 13 12 11; do

GCC 16 is out, so this list is already one release stale and will go stale
again. The plain-g++ fallback rescues most systems — it's what saved my Arch
box, where g++ is 16 — but it doesn't rescue the case the loop exists for:
a machine whose only suitable compiler is installed under a versioned name
newer than the list, with an older default g++. That combination dies with

error: need g++ 11 or newer (Electron 42 headers require C++20).

while g++-16 sits right there on PATH. The message points at the wrong
problem, which is the expensive part.

Changed to walk down from 30. It's a handful of command -v builtin lookups
and won't need revisiting.

I tried deriving the list from compgen -c 'g++-' first, which reads better,
but compgen -c returns nothing in a non-interactive shell — so it silently
selects no compiler. Mentioning it in case it looks like the obvious cleanup
later; it isn't.

Categories=Office;Utility; trips desktop-file-validate

$ desktop-file-validate ~/.local/share/applications/granola.desktop
granola.desktop: hint: value "Office;Utility;" for key "Categories" contains
more than one main category; application might appear more than once in the
application menu

Both are main categories per the freedesktop menu spec, so some menu
implementations list the app twice. Office alone is the accurate one.

Testing

Full script run on Arch (gcc 16, glibc 2.42), Granola 7.522.2 / Electron
42.7.0 — builds and smoke-tests clean, compiler detection resolves to
g++ (16), and desktop-file-validate now passes with no hints.

Unrelated, so not touched here: StartupWMClass=granola is correct — I
confirmed the window class really is granola under Hyprland via
hyprctl clients.

🤖 Generated with Claude Code

https://claude.ai/code/session_01EaTeCExac9ue2MGZt7LL8a

The compiler search stopped at g++-15, so a machine whose only versioned
compiler is g++-16 fell through to the plain-g++ fallback -- and if the
default g++ happened to be older than 11, the script died with a message
pointing at the wrong problem. Walking down from 30 costs a few builtin
lookups and does not need touching again.

Separately, desktop-file-validate warns on Categories=Office;Utility;

  value "Office;Utility;" for key "Categories" ... contains more than one
  main category; application might appear more than once in the menu

Office alone is the accurate one.
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.

1 participant