Bug 2179136 - budgie-desktop: Fix C99 compatibility issues in Vala-generated C code
Summary: budgie-desktop: Fix C99 compatibility issues in Vala-generated C code
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: budgie-desktop
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Florian Weimer
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: PortingToModernCHelpNeeded
TreeView+ depends on / blocked
 
Reported: 2023-03-16 17:26 UTC by Florian Weimer
Modified: 2023-03-20 09:25 UTC (History)
1 user (show)

Fixed In Version: vala-0.56.4-2.fc39 budgie-desktop-10.7.1-2.fc39
Clone Of:
Environment:
Last Closed: 2023-03-20 09:22:58 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Upstream patch for budgie-desktop C99 compat issue (1.92 KB, patch)
2023-03-20 08:02 UTC, Florian Weimer
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Github BuddiesOfBudgie budgie-desktop pull 330 0 None open Use correct C header for meta_keybindings_set_custom_handler 2023-03-16 17:27:01 UTC

Description Florian Weimer 2023-03-16 17:26:52 UTC
After fixing what appears to be a package-specific issue (undeclared function meta_keybindings_set_custom_handler, see
<https://github.com/BuddiesOfBudgie/budgie-desktop/pull/330>), building budgie-desktop still fails due to what seems to be a Vala compiler problem:

Missing declarations of called functions in [ModuleInit] function
<https://gitlab.gnome.org/GNOME/vala/-/issues/1422>

Until the Vala compiler can be fixed, we need to build budgie-desktop in C89 mode, to avoid build failures with future compilers.

Comment 1 Florian Weimer 2023-03-16 18:35:39 UTC
Unfortunately, I am unable to build in C89 with the current exception framework we have. The reason is that the project also contains hand-written C code that must be built in C99 or later language modes. The meson build generator does not seem to allow setting different compiler flags for Vala-generated C sources and regular C resources.

Comment 2 Joshua Strobl 2023-03-16 19:15:22 UTC
Yea, we take advantage of specifying initializers in our `for` loop which requires c11 / gnu11. gvc (gnome-volume-control) which we use as a subproject also appears to have issues with compiling against c89, which would prevent building in c89 mode.

So even if I was to fix our code to just specify the variable outside our loops, it wouldn't fix the gvc compilation and it'd just be a workaround for the issue you identified with Vala.

Regardless, your PR to budgie-desktop is LGTM and much appreciated. I'll get that merged in.

Comment 3 Florian Weimer 2023-03-16 20:40:04 UTC
(In reply to Joshua Strobl from comment #2)
> Yea, we take advantage of specifying initializers in our `for` loop which
> requires c11 / gnu11. gvc (gnome-volume-control) which we use as a
> subproject also appears to have issues with compiling against c89, which
> would prevent building in c89 mode.
> 
> So even if I was to fix our code to just specify the variable outside our
> loops, it wouldn't fix the gvc compilation and it'd just be a workaround for
> the issue you identified with Vala.

Yes, there are multiple packages that need both C89-only features and C99-only features at the same time. I need to rework the exception mechanism. I don't think it's necessary to change anything in budgie-desktop while the Vala issues persist (and the [ModuleInit] problem isn't rhe only one, unfortunately).

> Regardless, your PR to budgie-desktop is LGTM and much appreciated. I'll get
> that merged in.

Thanks.

Comment 4 Florian Weimer 2023-03-20 08:02:22 UTC
Created attachment 1951925 [details]
Upstream patch for budgie-desktop C99 compat issue

Vala upstream fixed the compiler issue in this commit:

codegen: Add declaration for register call of dynamic DBus interfaces
<https://gitlab.gnome.org/GNOME/vala/-/commit/a902d7eae96a3f1ab0cb64f268443b23ee8ab45a>

budgie-desktop upstream applied my patch as well. This means that budgie-desktop can now build with strict(er) C99 compilers.


Note You need to log in before you can comment on or make changes to this bug.