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 793299 - valac: public header is included in internal vapi when --includedir is specified
valac: public header is included in internal vapi when --includedir is specified
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Code Generator
0.36.x
Other Linux
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2018-02-08 13:57 UTC by Daiki Ueno
Modified: 2018-02-08 16:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
compiler: Prefix headers for set_cheader_override() if includedir is given (1.46 KB, patch)
2018-02-08 15:21 UTC, Rico Tzschichholz
committed Details | Review

Description Daiki Ueno 2018-02-08 13:57:31 UTC
Suppose the following snippet:

 $ cat test.vala
 class Foo : Object {
 }

If I generate an internal vapi file without --includedir:

 $ valac -C -vapi=foo.vapi --internal-vapi=foo-internal.vapi --header=foo.h -h foo-internal.h --library=libfoo test.vala

 $ cat foo-internal.vapi
 /* foo-internal.vapi generated by valac 0.36.11, do not modify. */

 [CCode (cheader_filename = "foo-internal.h")]
 internal class Foo : GLib.Object {
	 public Foo ();
 }

This is expected.  However, if I add --includedir to the command line:

 $ valac -C --includedir=foo --vapi=foo.vapi --internal-vapi=foo-internal.vapi --header=foo.h -h foo-internal.h --library=libfoo test.vala

 $ cat foo-internal.vapi
 /* foo-internal.vapi generated by valac 0.36.11, do not modify. */

 [CCode (cheader_filename = "foo/foo.h")] // <--
 internal class Foo : GLib.Object {
	 public Foo ();
 }

The internal vapi file refers to the public header file instead.

I believe this is a regression in 0.36.x.  It is causing FTBFS in my packages, e.g.,:
https://github.com/ueno/libkkc/pull/13
Comment 1 Rico Tzschichholz 2018-02-08 15:21:00 UTC
Created attachment 368156 [details] [review]
compiler: Prefix headers for set_cheader_override() if includedir is given

We need to account for changes done by SourceFile.get_cinclude_filename()
Comment 2 Rico Tzschichholz 2018-02-08 16:08:50 UTC
Attachment 368156 [details] pushed as 8d8fafd - compiler: Prefix headers for set_cheader_override() if includedir is given

This fix will also be part of 0.34.17, 0.36.12 and 0.38.8