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 347825 - exports internal symbols
exports internal symbols
Status: RESOLVED WONTFIX
Product: pygtk
Classification: Bindings
Component: general
Git Master
Other All
: Normal enhancement
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
gnome[unmaintained]
: 348229 348286 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-07-17 18:45 UTC by Rafael Ávila de Espíndola
Modified: 2018-08-17 13:43 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
use hidden visibility if compiling with gcc >= 3.4 (4.63 KB, patch)
2006-07-17 18:46 UTC, Rafael Ávila de Espíndola
none Details | Review
define HAVE_GNUC_VISIBILITY (4.70 KB, patch)
2006-07-18 12:19 UTC, Rafael Ávila de Espíndola
needs-work Details | Review
define PYGOBJECT_HIDDEN (786 bytes, patch)
2006-07-18 14:12 UTC, Rafael Ávila de Espíndola
none Details | Review
use PYGOBJECT_HIDDEN (1.92 KB, patch)
2006-07-18 14:13 UTC, Rafael Ávila de Espíndola
none Details | Review
define PYG_HIDDEN (774 bytes, patch)
2006-07-18 14:39 UTC, Rafael Ávila de Espíndola
none Details | Review
use PYG_HIDDEN (1.92 KB, patch)
2006-07-18 14:39 UTC, Rafael Ávila de Espíndola
none Details | Review
alternative patch that uses G_GNUC_INTERNAL (3.77 KB, patch)
2006-07-18 16:56 UTC, Rafael Ávila de Espíndola
committed Details | Review
make pyglade_xml_new static (459 bytes, patch)
2006-07-24 11:14 UTC, Rafael Ávila de Espíndola
none Details | Review
make pygdk_event_handler_marshal static (381 bytes, patch)
2006-07-24 11:16 UTC, Rafael Ávila de Espíndola
none Details | Review
make PyGContainerIter_Type static (454 bytes, patch)
2006-07-24 11:17 UTC, Rafael Ávila de Espíndola
none Details | Review
make pygtk_tree_model_row_iter_getiter static (372 bytes, patch)
2006-07-24 11:19 UTC, Rafael Ávila de Espíndola
none Details | Review
make pygtk_tree_model_row_iter_next static (372 bytes, patch)
2006-07-24 11:21 UTC, Rafael Ávila de Espíndola
none Details | Review
make _wrap_gdk_event_tp_getattr static (443 bytes, patch)
2006-07-24 11:22 UTC, Rafael Ávila de Espíndola
none Details | Review
make _wrap_gdk_gc_tp_getattro static (386 bytes, patch)
2006-07-24 11:25 UTC, Rafael Ávila de Espíndola
none Details | Review
make pygtk_make_pixbuf_format_dict static (849 bytes, patch)
2006-07-24 11:27 UTC, Rafael Ávila de Espíndola
none Details | Review
make pygtk_find_char_pred static (419 bytes, patch)
2006-07-24 11:29 UTC, Rafael Ávila de Espíndola
none Details | Review
make PyGtkDeprecationWarning static (487 bytes, patch)
2006-07-24 11:32 UTC, Rafael Ávila de Espíndola
none Details | Review
make some symbols static (6.78 KB, patch)
2006-07-24 13:35 UTC, Rafael Ávila de Espíndola
none Details | Review
hide some symbols (25.71 KB, patch)
2006-07-31 12:42 UTC, Rafael Ávila de Espíndola
none Details | Review

Description Rafael Ávila de Espíndola 2006-07-17 18:45:55 UTC
use __attribute__ ((visibility ("hidden")))
Comment 1 Rafael Ávila de Espíndola 2006-07-17 18:46:57 UTC
Created attachment 69065 [details] [review]
use hidden visibility if compiling with gcc >= 3.4
Comment 2 Murray Cumming 2006-07-18 06:24:45 UTC
Ideally you would have a configure test that discovered whether this compiler feature was supported. Then you'd use the resulting define (from your config.h) to conditionally define a macro for this. glibmm does this kind of thing often for other compiler features.
Comment 3 Rafael Ávila de Espíndola 2006-07-18 12:19:55 UTC
Created attachment 69108 [details] [review]
define HAVE_GNUC_VISIBILITY

Defining something like HAVE_GNUC_VISIBILITY is an improvement, since new tests don't have to test the gcc version. I don't like to use configure for such simple tests, but if it is required I can create a new patch.
Comment 4 Gustavo Carneiro 2006-07-18 12:36:19 UTC
Comment on attachment 69108 [details] [review]
define HAVE_GNUC_VISIBILITY

>+#define HIDDEN __attribute__ ((visibility ("hidden")))

This is missing proper namespacing.  Please change the macro name to PYGTK_HIDDEN.
It would be nice also to push this macro upstream to glib, for glib 2.14.

Other problems:

hidden.h is not installed.  Yet, codegen unconditionally generates code that requires inclusion of this header.  I bet gnome-python-* will no longer build with this patch.
I suggest merging hidden.h into gtk/pygtk.h, or into pygobject.h (in pygobject), or install hidden.h and include it from pygtk.h.
Comment 5 Rafael Ávila de Espíndola 2006-07-18 14:12:36 UTC
Created attachment 69118 [details] [review]
define PYGOBJECT_HIDDEN
Comment 6 Rafael Ávila de Espíndola 2006-07-18 14:13:24 UTC
Created attachment 69119 [details] [review]
use PYGOBJECT_HIDDEN
Comment 7 Rafael Ávila de Espíndola 2006-07-18 14:15:14 UTC
(In reply to comment #4)
> It would be nice also to push this macro upstream to glib, for glib 2.14.
I will ask them to make G_HAVE_GNUC_VISIBILITY visible to user code.


Comment 8 Gustavo Carneiro 2006-07-18 14:32:48 UTC
G_HAVE_GNUC_VISIBILITY is already used in gtk+ 2.10..

PYGOBJECT_HIDDEN should be PYG_HIDDEN; that's for consistency, we've used PYG_ prefix in pygobject since forever...
Comment 9 Rafael Ávila de Espíndola 2006-07-18 14:39:01 UTC
Created attachment 69120 [details] [review]
define PYG_HIDDEN
Comment 10 Rafael Ávila de Espíndola 2006-07-18 14:39:43 UTC
Created attachment 69121 [details] [review]
use PYG_HIDDEN
Comment 11 Rafael Ávila de Espíndola 2006-07-18 14:44:21 UTC
(In reply to comment #8)
> G_HAVE_GNUC_VISIBILITY is already used in gtk+ 2.10..
I think that it is used internally only. I have gtk+ 2.10 installed and "grep -r G_HAVE_GNUC_VISIBILITY" in /usr/include returns

/usr/include/gtk-2.0/gdk/gdkalias.h:#ifdef G_HAVE_GNUC_VISIBILITY
/usr/include/gtk-2.0/gdk/gdkalias.h:#endif /* G_HAVE_GNUC_VISIBILITY *
Comment 13 Gustavo Carneiro 2006-07-18 15:06:24 UTC
PS: these macros are in /usr/lib/glib-2.0/include/glibconfig.h, that's why you can't find them grepping /usr/include.
Comment 14 Rafael Ávila de Espíndola 2006-07-18 16:56:54 UTC
Created attachment 69130 [details] [review]
alternative patch that uses G_GNUC_INTERNAL
Comment 15 Gustavo Carneiro 2006-07-18 17:19:57 UTC
Comment on attachment 69130 [details] [review]
alternative patch that uses G_GNUC_INTERNAL

>Index: atk.override
>===================================================================
>RCS file: /cvs/gnome/pygtk/atk.override,v
>retrieving revision 1.15
>diff -u -r1.15 atk.override
>--- atk.override	6 Jul 2006 17:44:55 -0000	1.15
>+++ atk.override	18 Jul 2006 16:55:15 -0000
>@@ -23,6 +23,7 @@
> headers
> #define NO_IMPORT_PYGOBJECT
> #include "pygobject.h"
>+#include <glibconfig.h>

Please drop the <glibconfig.h> includes everywhere; you don't need them.  After that, it's ready for commit.
Comment 16 Rafael Ávila de Espíndola 2006-07-18 17:22:00 UTC
> Please drop the <glibconfig.h> includes everywhere; you don't need them.  After
> that, it's ready for commit.

Actually we do. I added them because the build was failing.
Comment 17 Gustavo Carneiro 2006-07-18 17:34:24 UTC
(In reply to comment #16)
> > Please drop the <glibconfig.h> includes everywhere; you don't need them.  After
> > that, it's ready for commit.
> 
> Actually we do. I added them because the build was failing.
> 

Weird... :|  glib/gtypes.h includes it, and glib/gtypes.h is needed everywhere...
Comment 18 Gustavo Carneiro 2006-07-18 18:37:50 UTC
In fact, the patch compiles fine here in HEAD if I remove the <glibconfig.h> #includes; what glib version do you have?
Comment 19 Rafael Ávila de Espíndola 2006-07-18 18:53:27 UTC
I have just tried the patch without the includes and it works. I was having some problems with the *.c not being regenerated automatically. I though that the problem was the missing includes.
Comment 20 Gustavo Carneiro 2006-07-22 10:29:09 UTC
Reopening to hold any extra patches floating around...
Comment 21 Rafael Ávila de Espíndola 2006-07-24 11:14:28 UTC
Created attachment 69474 [details] [review]
make pyglade_xml_new static
Comment 22 Rafael Ávila de Espíndola 2006-07-24 11:16:03 UTC
Created attachment 69475 [details] [review]
make pygdk_event_handler_marshal static
Comment 23 Rafael Ávila de Espíndola 2006-07-24 11:17:58 UTC
Created attachment 69476 [details] [review]
make PyGContainerIter_Type static
Comment 24 Rafael Ávila de Espíndola 2006-07-24 11:19:38 UTC
Created attachment 69477 [details] [review]
make pygtk_tree_model_row_iter_getiter static
Comment 25 Rafael Ávila de Espíndola 2006-07-24 11:21:01 UTC
Created attachment 69478 [details] [review]
make pygtk_tree_model_row_iter_next static
Comment 26 Rafael Ávila de Espíndola 2006-07-24 11:22:41 UTC
Created attachment 69479 [details] [review]
make _wrap_gdk_event_tp_getattr static
Comment 27 Rafael Ávila de Espíndola 2006-07-24 11:25:46 UTC
Created attachment 69480 [details] [review]
make _wrap_gdk_gc_tp_getattro static
Comment 28 Rafael Ávila de Espíndola 2006-07-24 11:27:56 UTC
Created attachment 69481 [details] [review]
make pygtk_make_pixbuf_format_dict static
Comment 29 Rafael Ávila de Espíndola 2006-07-24 11:29:51 UTC
Created attachment 69482 [details] [review]
make pygtk_find_char_pred static
Comment 30 Rafael Ávila de Espíndola 2006-07-24 11:32:19 UTC
Created attachment 69484 [details] [review]
make PyGtkDeprecationWarning static
Comment 31 Murray Cumming 2006-07-24 11:57:39 UTC
Is it really necessary to put every single change in its own patch?
Comment 32 Rafael Ávila de Espíndola 2006-07-24 12:04:49 UTC
No, but I did it to make it easier for you to accept or reject it. I have them in a local branch with svn. I can build larger patches if necessary.
Comment 33 Johan (not receiving bugmail) Dahlin 2006-07-24 12:14:09 UTC
(In reply to comment #32)
> No, but I did it to make it easier for you to accept or reject it. I have them
> in a local branch with svn. I can build larger patches if necessary.
> 

Yes, please, it'll make it easier to apply them. If you feel that the changes are unrelated, group some of them together. Sending one change per patch provides a bit of overhead, for both you and the review/applier.
Comment 34 Rafael Ávila de Espíndola 2006-07-24 13:35:38 UTC
Created attachment 69494 [details] [review]
make some symbols static
Comment 35 Rafael Ávila de Espíndola 2006-07-24 13:40:10 UTC
*** Bug 348286 has been marked as a duplicate of this bug. ***
Comment 36 Rafael Ávila de Espíndola 2006-07-24 13:44:46 UTC
*** Bug 348229 has been marked as a duplicate of this bug. ***
Comment 37 Johan (not receiving bugmail) Dahlin 2006-07-27 23:06:38 UTC
Committed to CVS, thanks!

Checking in ChangeLog;
/cvs/gnome/pygtk/ChangeLog,v  <--  ChangeLog
new revision: 1.1581; previous revision: 1.1580
done
Checking in atkrectangle.override;
/cvs/gnome/pygtk/atkrectangle.override,v  <--  atkrectangle.override
new revision: 1.2; previous revision: 1.1
done
Checking in gtk/gdk.override;
/cvs/gnome/pygtk/gtk/gdk.override,v  <--  gdk.override
new revision: 1.149; previous revision: 1.148
done
Checking in gtk/gdkevent.override;
/cvs/gnome/pygtk/gtk/gdkevent.override,v  <--  gdkevent.override
new revision: 1.4; previous revision: 1.3
done
Checking in gtk/gdkgc.override;
/cvs/gnome/pygtk/gtk/gdkgc.override,v  <--  gdkgc.override
new revision: 1.2; previous revision: 1.1
done
Checking in gtk/gdkpixbuf.override;
/cvs/gnome/pygtk/gtk/gdkpixbuf.override,v  <--  gdkpixbuf.override
new revision: 1.2; previous revision: 1.1
done
Checking in gtk/gtk-types.c;
/cvs/gnome/pygtk/gtk/gtk-types.c,v  <--  gtk-types.c
new revision: 1.58; previous revision: 1.57
done
Checking in gtk/gtkcontainer.override;
/cvs/gnome/pygtk/gtk/gtkcontainer.override,v  <--  gtkcontainer.override
new revision: 1.17; previous revision: 1.16
done
Checking in gtk/gtkmodule.c;
/cvs/gnome/pygtk/gtk/gtkmodule.c,v  <--  gtkmodule.c
new revision: 1.74; previous revision: 1.73
done
Checking in gtk/gtktextview.override;
/cvs/gnome/pygtk/gtk/gtktextview.override,v  <--  gtktextview.override
new revision: 1.19; previous revision: 1.18
done
Checking in gtk/libglade.override;
/cvs/gnome/pygtk/gtk/libglade.override,v  <--  libglade.override
new revision: 1.31; previous revision: 1.30
done
Comment 38 Rafael Ávila de Espíndola 2006-07-31 12:42:58 UTC
Created attachment 69964 [details] [review]
hide some symbols
Comment 39 André Klapper 2018-08-17 13:43:30 UTC
pygtk is not under active development anymore and had its last code changes
in 2013. Its codebase has been archived:
https://gitlab.gnome.org/Archive/pygtk/commits/master

PyGObject at https://gitlab.gnome.org/GNOME/pygobject is its successor. See https://pygobject.readthedocs.io/en/latest/guide/porting.html for porting info.

Closing this report as WONTFIX as part of Bugzilla Housekeeping to reflect
reality. Feel free to open a task in GNOME Gitlab if the issue described in this task still applies to a recent version of PyGObject. Thanks!