Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 734732 - dev-libs/libclangformat-ide-10.0.1 version bump
Summary: dev-libs/libclangformat-ide-10.0.1 version bump
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Deadline: 2020-12-29
Assignee: Jason A. Donenfeld
URL:
Whiteboard:
Keywords: PMASKED
: 755668 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-07-30 10:13 UTC by Althorion
Modified: 2021-02-26 14:40 UTC (History)
15 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Updated version of the patch (clang-qtcreator-compat.patch,6.14 KB, patch)
2020-08-02 08:39 UTC, Alessandro Di Federico
Details | Diff
Updated version of the patch (clang-qtcreator-compat.patch,6.38 KB, patch)
2020-09-20 10:35 UTC, Alessandro Di Federico
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Althorion 2020-07-30 10:13:53 UTC
Since the most current version of sys-devel/llvm in ~amd64 is 10.0.1, can we get a version bump for dev-libs/libclangformat-ide, so it wouldn’t require masking/downgrading?

Reproducible: Always
Comment 1 Alessandro Di Federico 2020-08-02 08:39:13 UTC
Created attachment 652276 [details, diff]
Updated version of the patch

This version of the patch applies cleanly and targets the `clang/` subdirectory.
Comment 2 Cyril 2020-08-26 11:35:56 UTC
Thanks Alessandro, path works here.
Comment 3 bugsgentoo 2020-08-29 13:13:46 UTC
Thx, patch works here as well.
Comment 4 Sam James archtester gentoo-dev Security 2020-09-19 21:56:14 UTC
(In reply to Alessandro Di Federico from comment #1)
> Created attachment 652276 [details, diff] [details, diff]
> Updated version of the patch
> 
> This version of the patch applies cleanly and targets the `clang/`
> subdirectory.

Can you provide the GCO sign off, please? Thanks!

https://www.gentoo.org/glep/glep-0076.html#certificate-of-origin
Comment 5 Alessandro Di Federico 2020-09-20 10:35:25 UTC
Created attachment 661614 [details, diff]
Updated version of the patch

Here, let me know if this works.

I've to get familiar with the GitHub process.
Comment 6 gerion 2020-11-03 09:59:16 UTC
Just ran into the same issue. I saw that the (website) link is dead, too.
Comment 7 Larry the Git Cow gentoo-dev 2020-11-15 20:52:37 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f188540291c05a3011cc88b1d00f59013e85f8f0

commit f188540291c05a3011cc88b1d00f59013e85f8f0
Author:     Andreas Sturmlechner <asturm@gentoo.org>
AuthorDate: 2020-11-15 20:49:50 +0000
Commit:     Andreas Sturmlechner <asturm@gentoo.org>
CommitDate: 2020-11-15 20:51:52 +0000

    dev-libs/libclangformat-ide: Assign zx2c4 as maintainer
    
    This package was added without approval of the maintainer it was assigned to.
    
    See also commit dd9332b486f8dcc772654c2f6d57e14e383d0081
    
    Bug: https://bugs.gentoo.org/734732
    Package-Manager: Portage-3.0.9, Repoman-3.0.2
    Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>

 dev-libs/libclangformat-ide/metadata.xml | 4 ++++
 1 file changed, 4 insertions(+)
Comment 8 Dib 2020-11-18 09:32:28 UTC
I just tried this patch with the stable clang/llvm 11 and it works fine there too
Comment 9 Larry the Git Cow gentoo-dev 2020-11-29 09:30:57 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8555f565ff38171328cfcd9aee46b07a6ccfbfd4

commit 8555f565ff38171328cfcd9aee46b07a6ccfbfd4
Author:     Michał Górny <mgorny@gentoo.org>
AuthorDate: 2020-11-29 09:04:52 +0000
Commit:     Michał Górny <mgorny@gentoo.org>
CommitDate: 2020-11-29 09:05:13 +0000

    package.mask: Last rite dev-libs/libclangformat-ide
    
    Bug: https://bugs.gentoo.org/734732
    Signed-off-by: Michał Górny <mgorny@gentoo.org>

 profiles/base/package.use.mask | 4 ++++
 profiles/package.mask          | 7 +++++++
 2 files changed, 11 insertions(+)
Comment 10 Dmitry Grigoriev 2020-11-29 13:27:58 UTC
Just updated and rebuilt qt-creator without "clang" USE flag (suppose it was masked). Not only ClangFormat plugin has disappeared, but also ClangCodeModel (essential), ClangTools (was enabled too), ClangRefactoring. As result, qt-creator became unusable. Had to add "-clang" to package.use.mask to get it back.
Comment 11 Cyril 2020-11-29 14:54:53 UTC
(In reply to Dmitry Grigoriev from comment #10)
> Just updated and rebuilt qt-creator without "clang" USE flag (suppose it was
> masked). Not only ClangFormat plugin has disappeared, but also
> ClangCodeModel (essential), ClangTools (was enabled too), ClangRefactoring.
> As result, qt-creator became unusable. Had to add "-clang" to
> package.use.mask to get it back.

Same here, really nead clang plugin
Comment 12 Hans F. Nordhaug 2020-12-11 15:24:20 UTC
As reported by other users the package is sorely needed for Qt Creator users. There is a patch reported to work in this issue. And I created a new patch https://bugs.gentoo.org/755668 (that applies cleanly for LLVM 11.0.0) since I was unaware of this bug.

So maybe the package is "an awful hack-package that was dumped on others, and not touched by the person adding it since." - ref entry in profiles/package.mask, but there is clearly interest in keeping it up-to-date.
Comment 13 Hans F. Nordhaug 2020-12-24 13:21:56 UTC
What is the best way to get the mask of clang use reverted? It's completely wrong as it removes support for clang model and analysis which is very important. (The Clang format plugin is disabled by default.)

As I pointed out in the https://bugs.gentoo.org/750527 the dev-libs/libclangformat-ide package is still needed for the newly released 4.14.0 version of Qt Creator, to make the Clang format plugin work - ref https://code.qt.io/cgit/qt-creator/qt-creator.git/tree/README.md

There are patches to update dev-libs/libclangformat-ide, but if the package really, really needs to be killed, the correct fix is to remove the dependency from the ebuild, not to mask clang use.
Comment 14 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2020-12-31 08:56:42 UTC
*** Bug 755668 has been marked as a duplicate of this bug. ***
Comment 15 Larry the Git Cow gentoo-dev 2020-12-31 08:58:10 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b59c592cb7fc3de9e1b3ffb30b83424facae8ed4

commit b59c592cb7fc3de9e1b3ffb30b83424facae8ed4
Author:     Michał Górny <mgorny@gentoo.org>
AuthorDate: 2020-12-31 08:56:01 +0000
Commit:     Michał Górny <mgorny@gentoo.org>
CommitDate: 2020-12-31 08:56:01 +0000

    dev-libs/libclangformat-ide: Remove last-rited pkg
    
    Closes: https://bugs.gentoo.org/734732
    Signed-off-by: Michał Górny <mgorny@gentoo.org>

 dev-libs/libclangformat-ide/Manifest               |   2 -
 .../files/clang-qtcreator-compat.patch             | 185 ---------------------
 .../libclangformat-ide-10.0.0.ebuild               |  72 --------
 .../libclangformat-ide-9.0.1.ebuild                |  72 --------
 dev-libs/libclangformat-ide/metadata.xml           |   8 -
 profiles/package.mask                              |   7 -
 6 files changed, 346 deletions(-)
Comment 16 Hans F. Nordhaug 2020-12-31 09:50:25 UTC
@Michał Górny: Sorry to bother you, but I have to ask: Are you planning to fix the problem that this removal has caused? It's bad that this removes Clang formatting support in Qt Creator, but the main problem is that you have masked "clang" use. That is a major drawback as I have tried to explain.
Comment 17 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2020-12-31 10:50:21 UTC
I'm not the maintainer of Qt Creator.
Comment 18 Hans F. Nordhaug 2020-12-31 11:46:38 UTC
I know, but who decided that the solution is just to mask clang usage (for Qt Creator) because this package has to be removed? Was the Qt Creator maintainer involved? And so on. I know too little about the removal process, sorry.

Anyway, you have seen my posts about this already (and it didn't make any difference), so  I assume the constructive solution is to step up as Qt Creator maintainer?
Comment 19 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2020-12-31 12:17:55 UTC
(In reply to Hans F. Nordhaug from comment #18)
> I know, but who decided that the solution is just to mask clang usage (for
> Qt Creator) because this package has to be removed? Was the Qt Creator
> maintainer involved? And so on. I know too little about the removal process,
> sorry.

The Qt Creator maintainer indicated that he's not interested in maintaining libclangformat-ide.

> Anyway, you have seen my posts about this already (and it didn't make any
> difference), so  I assume the constructive solution is to step up as Qt
> Creator maintainer?

It would be sufficient to step up as the maintainer for libclangformat-ide, and readd it.
Comment 20 Alessandro Di Federico 2021-01-01 14:53:19 UTC
I was looking at the patches QtCreator needs on LLVM:

    https://code.qt.io/cgit/clang/llvm-project.git/log/?h=release_10.0.1-based

The tag `upstream/release/10.x` is the upstream release:

    https://github.com/llvm/llvm-project/commits/llvmorg-10.0.1

There are 5 commits:

1. [clang-format] Introduce the flag which allows not to shrink lines
2. libclang: Add static build support for Windows
3. [clang][test] Headers/max_align.c fix for MinGW
4. [clang] Cache preamble-related data
5. [clang] [mac] Disable crash-recovery-reparse testrelease_10.0.1-based

2), 3) and 5) are not relevant for Linux.
1) is a matter of objectionable decisions in how clang-format should work.
4) seems to be only a performance issue.

I think we can link against system LLVM.
Comment 21 Hans F. Nordhaug 2021-01-02 17:12:56 UTC
Regarding patches QtCreator needs on LLVM:

Yes, it seems it's only the first commit - "[clang-format] Introduce the flag which allows not to shrink lines" - that is needed. However, just ignoring that commit and linking against the system LLVM will disable the Clang format plugin as there is a runtime check. (It's just the 

Or in other words: Removing the "libclangformat-ide" patch from QtCreator (which introduces the need for this package / the LLVM commit), also disables the Clang format plugin - verified for Qt Creator 4.14.0 (using my/the patch from https://bugs.gentoo.org/750527 and then removing the "libclangformat-ide" patch).

I think it's sad to indirectly disable the Clang format plugin and I am willing to step up as maintainer of this package until Qt Creator doesn't need the LLVM commit / patch anymore. Or is there a better solution preserving a correctly functioning Clang format plugin?
Comment 22 Alessandro Di Federico 2021-01-02 20:57:38 UTC
The alternative would be to patch out the checks from Qt Creator and see what happens. It seems to check the presence of `KEEP_LINE_BREAKS_FOR_NON_EMPTY_LINES_BACKPORTED`:

    https://github.com/qt-creator/qt-creator/search?q=KEEP_LINE_BREAKS_FOR_NON_EMPTY_LINES_BACKPORTED

Or, we could apply the Qt patch onto `sys-devel/llvm`, but I doubt that's a viable approach.
Comment 23 Hans F. Nordhaug 2021-01-03 10:31:37 UTC
Modifying sys-devel/clang is no option - ref https://bugs.gentoo.org/722892

Removing the check from Qt Creator seems like a strange solution since the Qt Creator devs decided to add it (and spent some effort doing so). Read https://www.qt.io/blog/2019/04/17/clangformat-plugin-qt-creator-4-9 for motivation.

I still think preserving this package is the best option and I can step up as maintainer if no other Qt people will do so.
Comment 24 Peter Levine 2021-01-05 02:44:41 UTC
Why not at least something like this for dev-qt/qt-creator?

> pkg_setup() {
> 	if use clang; then
> 		llvm_pkg_setup
> 		local llvm_prefix=$(get_llvm_prefix "${LLVM_MAX_SLOT}")
>		local format_file="${llvm_prefix}"/include/clang/Format/Format.h
>		local patched_string="^#define KEEP_LINE_BREAKS_FOR_NON_EMPTY_LINES_BACKPORTED$"
>		if ! grep "${patched_string}" "${format_file}" &> /dev/null; then
>			ewarn "For clangformat functionality, sys-devel/clang:${LLVM_MAX_SLOT}"
>			ewarn "first needs to built with an upstream patch thet ihhibits"
>			ewarn "clangformat's line shrinkage. You're welcome to maintain"
>			ewarn "the patch but it will not be supported by Gentoo."
>			ewarn
>			ewarn "See https://codereview.qt-project.org/c/clang/clang/+/258014"
>		fi
>	fi
> }
Comment 25 Hans F. Nordhaug 2021-01-05 07:19:43 UTC
> You're welcome to maintain the patch but it will not be supported by Gentoo.

But is that the case? Michał Górny wrote: "It would be sufficient to step up as the maintainer for libclangformat-ide, and readd it." 

Anyway, to get Qt Creator 4.14.0 quickly into Gentoo, I'm happy to modify my patch in https://bugs.gentoo.org/750527 so it doesn't depend on libclangformat-ide so we can remove the profile mask of clang usage.

Personally, I don't use the Clang format plugin / beautifier, but since the work is done - this package already has a patch for LLVM 11 - it seems strange to throw it away.
Comment 26 Peter Levine 2021-01-05 21:39:34 UTC
(In reply to Hans F. Nordhaug from comment #25)
> > You're welcome to maintain the patch but it will not be supported by Gentoo.
> 
> But is that the case? Michał Górny wrote: "It would be sufficient to step up
> as the maintainer for libclangformat-ide, and readd it." 
> 
> Anyway, to get Qt Creator 4.14.0 quickly into Gentoo, I'm happy to modify my
> patch in https://bugs.gentoo.org/750527 so it doesn't depend on
> libclangformat-ide so we can remove the profile mask of clang usage.
> 
> Personally, I don't use the Clang format plugin / beautifier, but since the
> work is done - this package already has a patch for LLVM 11 - it seems
> strange to throw it away.

Someone maintaining libclangformat-ide would be ideal.  QT Creator isn't my go-to IDE but if I were to use it, I would expect clangformat support.  Barring that, however, IMHO it should at least be addressed with ewarn or eerror.
Comment 27 Hans F. Nordhaug 2021-02-26 14:40:15 UTC
I have sent in PR to maintain this package - ref https://github.com/gentoo/gentoo/pull/19665