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 631834 - libsoup-2.4 Invalid type_cname in generated VAPI
libsoup-2.4 Invalid type_cname in generated VAPI
Status: RESOLVED DUPLICATE of bug 625026
Product: vala
Classification: Core
Component: Bindings
0.10.x
Other Linux
: Normal major
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2010-10-10 21:06 UTC by Pascal Hartig
Modified: 2010-10-16 07:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
example code that triggers the error (417 bytes, text/x-vala)
2010-10-10 21:06 UTC, Pascal Hartig
Details

Description Pascal Hartig 2010-10-10 21:06:14 UTC
Created attachment 172062 [details]
example code that triggers the error

Hi there,

I tried to implement a Soup.SessionFeature, but it turned out the libsoup VAPI got an error that leads to invalid C code.

Clang provided a good hint where to search for the error:

$ valac -c --cc clang --pkg libsoup-2.4 TestFeature.vala
TestFeature.vala.c:32:8: error: unknown type name 'SoupSessionFeatureIface'; did you
      mean 'SoupSessionFeatureInterface'?
static SoupSessionFeatureIface* test_feature_soup_session_feature_parent_iface = NULL;
       ^~~~~~~~~~~~~~~~~~~~~~~
       SoupSessionFeatureInterface
In file included from /home/pascal/Projekte/vala/download/dlclass/TestFeature.vala.c:7:
In file included from /usr/include/libsoup-2.4/libsoup/soup.h:37:
/usr/include/libsoup-2.4/libsoup/soup-session-feature.h:40:3: note: 'SoupSessionFeatureInterface' declared here
} SoupSessionFeatureInterface;
  ^
/home/pascal/Projekte/vala/download/dlclass/TestFeature.vala.c:104:63: error: unknown type name 'SoupSessionFeatureIface'; did
      you mean 'SoupSessionFeatureInterface'?
static void test_feature_soup_session_feature_interface_init (SoupSessionFeatureIface * iface) {
                                                              ^~~~~~~~~~~~~~~~~~~~~~~
                                                              SoupSessionFeatureInterface
In file included from /home/pascal/Projekte/vala/download/dlclass/TestFeature.vala.c:7:
In file included from /usr/include/libsoup-2.4/libsoup/soup.h:37:
/usr/include/libsoup-2.4/libsoup/soup-session-feature.h:40:3: note: 'SoupSessionFeatureInterface' declared here
} SoupSessionFeatureInterface;
  ^
2 errors generated.
error: cc exited with status 256
Compilation failed: 1 error(s), 0 warning(s)


The error can be fixed manually by extending the libsoup-2.4.vapi with a proper type_cname:

[CCode (cheader_filename = "libsoup/soup.h", type_cname = "SoupSessionFeatureInterface") ] 
public interface SessionFeature : GLib.Object {
    public abstract void attach (Soup.Session session);
    public abstract void detach (Soup.Session session);
    [NoWrapper]
    public abstract void request_queued (Soup.Session session, Soup.Message msg);
    [NoWrapper]
    public abstract void request_started (Soup.Session session, Soup.Message msg, Soup.Socket socket);
    [NoWrapper]
    public abstract void request_unqueued (Soup.Session session, Soup.Message msg);
}

But as the code seems to be automatically generated that should only work as temporary work-around.

Cheers,
Pascal
Comment 1 Jürg Billeter 2010-10-16 07:44:39 UTC
Thanks for the bug report. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find.

*** This bug has been marked as a duplicate of bug 625026 ***