Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 606162

Summary: dev-util/astyle-2.06 Changes all visibility to hidden - Code::Blocks no longer merges
Product: Gentoo Linux Reporter: Sven Eden <yamakuzure>
Component: Current packagesAssignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it <maintainer-needed>
Status: RESOLVED TEST-REQUEST    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Fix the visibility of astyle::ASFormatter and astyle::ASBeautifier

Description Sven Eden 2017-01-18 09:39:03 UTC
Created attachment 460522 [details, diff]
Fix the visibility of astyle::ASFormatter and astyle::ASBeautifier

When updating to dev-util/astyle-2.06, its library is now built with -fvisibility=hidden.

This causes Code::Blocks with "contrib" USE flag to no longer merge.

The reason is, that the astyle plugin does include <astyle.h>, which is then the system one, and links against -lastyle, which is no longer the bundled one.

AFAIK Code::Blocks still builds its bundled variant, if no system installed astyle is found.

Unfortunately the plugin tries to use the astyle::ASFormatter class directly, which is now hidden. The linker then complains about unresolved symbols, of course.

Please see upstream Issue https://sourceforge.net/p/astyle/bugs/406 for more information.

I have created the attached patch, which makes astyle::ASFormatter and astyle::ASBeautifier visible again, and Code::Blocks builds and links just fine with it.

Mabye the visibility change will be reverted, maybe my patch (submitted in said upstream issue) will be accepted eventually.
But until then it would be nice, if the patch could be added to the tree for astyle-2.06, as this would make life easier for Code::Blocks live ebuild users.

Note: As far as I understood Jim Pattee, astyle.h was never meant to be distributed and used directly anyway.
Comment 1 zlg (RETIRED) gentoo-dev 2017-01-28 08:37:23 UTC
If I'm understanding the linked conversations correctly, this is an issue caused by code::blocks relying on an API that was meant to be hidden? And Fedora has changes to their astyle package that facilitate unbundling astyle from code::blocks (probably similar to us)?

The proposed patch appears to be moving the #ifdefs and the accompanying functionality from astyle_main.h to astyle.h. Were there any important changes to the underlying code? A brief glance showed nothing different. Then the classes have 'EXPORT' added so that they are visible when #include'd, which codeblocks depends on (for now, it seems), correct?

I've never used codeblocks before, so what should I be testing to ensure this patch works correctly?

Thanks for reporting.
Comment 2 Sven Eden 2017-06-02 12:09:10 UTC
(In reply to Daniel Campbell from comment #1)
> I've never used codeblocks before, so what should I be testing to ensure
> this patch works correctly?

The minimal test program I have posted in my first comment.

Although, at least with astyle-2.06, it is fixed. :-)
Comment 3 Sven Eden 2017-06-02 12:13:54 UTC
Sorry for this, I am in a bad shape it seems.

I was so happy that my astyle did not come from a local ebuild or something, that I totally forgot that I added my patch to
  /etc/portage/patches/dev-util/astyle-2.06

Upstream might change this in their next release. But for now the patch at least works for all consumers of /usr/include/astyle.h
Comment 4 Pacho Ramos gentoo-dev 2017-12-14 20:39:36 UTC
please retry with 3.0.1