GNOME Bugzilla – Bug 793299
valac: public header is included in internal vapi when --includedir is specified
Last modified: 2018-02-08 16:08:56 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
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()
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