After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 794210 - Solve the "empty file problem"
Solve the "empty file problem"
Status: RESOLVED OBSOLETE
Product: vala
Classification: Core
Component: Code Generator
unspecified
Other All
: Normal normal
: 0.42
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2018-03-09 16:58 UTC by Al Thomas
Modified: 2018-05-22 16:01 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Al Thomas 2018-03-09 16:58:41 UTC
The "empty file problem" is an indication of Vala's current dependence on GLib, even when there is no code in the Vala source file. It currently has three things that need solving:
 
1. An empty Vala files compiled to C will have includes for glib.h and glib-object.h. The C file should be empty

2. There is currently nothing in the test infrastructure to check C output from valac. A test should be implemented to check that an empty source file produces an empty C file

3. Compiling an empty Vala source file with --nostdpkg produces an error "The namespace name `GLib' could not be found". It should produce an empty C file

At present an empty Vala files produces something like:

/* empty_vala_source.c generated by valac 0.39.92.14-46f76-dirty, the Vala compiler
 * generated from empty_vala_source.vala, do not modify */



#include <glib.h>
#include <glib-object.h>

The includes don't need to be there. There is currently no option to not have the comment at the beginning, but that is probably fine. Any test mechanism would need to take account of the comment.
Comment 1 Rico Tzschichholz 2018-03-09 17:47:52 UTC
I agree that compiling an empty vala source file should be handled properly. Although it should not result in an empty C file, but containing the mentioned commented generation header.
Comment 2 GNOME Infrastructure Team 2018-05-22 16:01:40 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/vala/issues/623.