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 771920 - Add --hide-internal to VALAFLAGS in build system
Add --hide-internal to VALAFLAGS in build system
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: general
0.34.x
Other All
: Normal normal
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2016-09-24 15:41 UTC by Al Thomas
Modified: 2016-10-26 08:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add --hide-internal to VALAFLAGS in Vala build system (753 bytes, patch)
2016-09-24 15:41 UTC, Al Thomas
none Details | Review
Add --hide-internal to VALAFLAGS in build system when building with Vala 0.26.0+ (939 bytes, patch)
2016-09-24 18:27 UTC, Al Thomas
none Details | Review
Add --hide-internal to VALAFLAGS in build system when building with Vala 0.25.1+ (843 bytes, patch)
2016-09-24 19:02 UTC, Al Thomas
none Details | Review
build: Conditionally adjust VALAFLAGS in case of proper bootsrapped builds (1.24 KB, patch)
2016-10-13 21:16 UTC, Rico Tzschichholz
committed Details | Review

Description Al Thomas 2016-09-24 15:41:10 UTC
Created attachment 336195 [details] [review]
Add --hide-internal to VALAFLAGS in Vala build system

The --hide-internal switch of valac add the GLib macro G_GNUC_INTERNAL before symbols that should not be exported to the dynamic symbol table of a shared object. Adding this to VALAFLAGS allows symbols to be hidden from the libvala dynamic symbol table.
Comment 1 Al Thomas 2016-09-24 15:43:26 UTC
To test this the .c files need to be removed from the vala build. Using:
make maintainer-clean
first works for me.
Comment 2 Al Thomas 2016-09-24 17:09:54 UTC
The --hide-internal switch went in to Vala 24 March 2014, just after the release of Vala 0.24.0. The commit for the switch is https://git.gnome.org/browse/vala/commit/?id=970f58989a2863faca11e30fdbcf4da1273a6acd 

This means that a minimum of Vala 0.26.0 (released 22 September 2014) would be needed to build Vala from Vala source files. Vala can still be built from the tarball with only a C compiler.
Comment 3 Al Thomas 2016-09-24 18:27:31 UTC
Created attachment 336201 [details] [review]
Add --hide-internal to VALAFLAGS in build system when building with Vala 0.26.0+

Vala 0.26.0 introduced the --hide-internal switch. Adding this to the Vala internal build system allows symbols to be marked 'internal' and they will be removed from the dynamic symbol table of the shared object built.
Comment 4 Al Thomas 2016-09-24 19:02:23 UTC
Created attachment 336202 [details] [review]
Add --hide-internal to VALAFLAGS in build system when building with Vala 0.25.1+

Less verbose version and changed minimum version of vala for --hide-internal to 0.25.1
Comment 5 Rico Tzschichholz 2016-09-25 14:56:12 UTC
That is not the diff I suggested. Not passing [] to the false-path will prompt a warning which is not wanted.
Comment 6 Al Thomas 2016-09-25 15:14:57 UTC
From autogen.sh without the [] for the false-path I get:

configure: WARNING: no proper vala compiler found
checking whether /usr/bin/valac is at least version 0.35.1... no
configure: WARNING: you will not be able to compile vala source files

with the [], I get:

:configure: WARNING: no proper vala compiler found
configure: WARNING: you will not be able to compile vala source files

Maybe I should try AS_IF or AS_VERSION_COMPARE
Comment 7 Rico Tzschichholz 2016-10-13 21:16:41 UTC
Created attachment 337670 [details] [review]
build: Conditionally adjust VALAFLAGS in case of proper bootsrapped builds

This adds --hide-internal to VALAFLAGS to allow symbols to be marked
'internal' in Vala source files and not appear in the dynamic symbol table
of libvala.

The build system checks for minimum valac version to fullfill required
support of needed VALAFLAGS.
Comment 8 Rico Tzschichholz 2016-10-26 08:33:12 UTC
Comment on attachment 337670 [details] [review]
build: Conditionally adjust VALAFLAGS in case of proper bootsrapped builds

commit fbc749bd4ec84673ace5b311ec468c75ab049e1f
Author: Rico Tzschichholz <ricotz@ubuntu.com>
Date:   Thu Oct 13 22:25:56 2016 +0200

    build: Conditionally adjust VALAFLAGS in case of proper bootsrapped builds
    
    This adds --hide-internal to VALAFLAGS to allow symbols to be marked
    'internal' in Vala source files and not appear in the dynamic symbol table
    of libvala.
    
    The build system checks for minimum valac version to fullfill required
    support of needed VALAFLAGS.