Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 823726 - [stable] dev-util/clazy-1.9 - /.../FixItExporter.cpp: error: F_None is not a member of llvm::sys::fs
Summary: [stable] dev-util/clazy-1.9 - /.../FixItExporter.cpp: error: F_None is not a ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo KDE team
URL:
Whiteboard:
Keywords: PullRequest
Depends on: 810307
Blocks:
  Show dependency tree
 
Reported: 2021-11-14 14:38 UTC by Toralf Förster
Modified: 2021-12-13 22:42 UTC (History)
2 users (show)

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


Attachments
emerge-info.txt (emerge-info.txt,16.39 KB, text/plain)
2021-11-14 14:38 UTC, Toralf Förster
Details
dev-util:clazy-1.9:20211114-112346.log (dev-util:clazy-1.9:20211114-112346.log,110.61 KB, text/plain)
2021-11-14 14:38 UTC, Toralf Förster
Details
emerge-history.txt (emerge-history.txt,181.23 KB, text/plain)
2021-11-14 14:38 UTC, Toralf Förster
Details
environment (environment,89.83 KB, text/plain)
2021-11-14 14:38 UTC, Toralf Förster
Details
etc.portage.tar.bz2 (etc.portage.tar.bz2,24.54 KB, application/x-bzip)
2021-11-14 14:38 UTC, Toralf Förster
Details
logs.tar.bz2 (logs.tar.bz2,4.57 KB, application/x-bzip)
2021-11-14 14:38 UTC, Toralf Förster
Details
temp.tar.bz2 (temp.tar.bz2,26.33 KB, application/x-bzip)
2021-11-14 14:38 UTC, Toralf Förster
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Toralf Förster gentoo-dev 2021-11-14 14:38:45 UTC
[106/117] /usr/bin/x86_64-pc-linux-gnu-g++ -DClazyPlugin_EXPORTS -DHAS_STD_FILESYSTEM -DHAVE_CLANG_CONFIG_H -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -I. -I/usr/lib/llvm/13/include -I/var/tmp/portage/dev-util/clazy-1.9/work/clazy-1.9 -I/var/tmp/portage/dev-util/clazy-1.9/work/clazy-1.9/src  -pipe -march=native -fno-diagnostics-color -O2 -std=c++14 -fno-common -Woverloaded-virtual -Wcast-qual -fno-strict-aliasing -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings -fno-exceptions -fno-rtti -fPIC -fPIC -std=gnu++17 -Winvalid-pch -include /var/tmp/portage/dev-util/clazy-1.9/work/clazy-1.9_build/CMakeFiles/ClazyPlugin.dir/cmake_pch.hxx -MD -MT CMakeFiles/ClazyPlugin.dir/src/SuppressionManager.cpp.o -MF CMakeFiles/ClazyPlugin.dir/src/SuppressionManager.cpp.o.d -o CMakeFiles/ClazyPlugin.dir/src/SuppressionManager.cpp.o -c /var/tmp/portage/dev-util/clazy-1.9/work/clazy-1.9/src/SuppressionManager.cpp

  -------------------------------------------------------------------

  This is an stable amd64 chroot image at a tinderbox (==build bot)
  name: 17.1_desktop_gnome_systemd-j4_stable-20211112-181438

  -------------------------------------------------------------------

gcc-config -l:
 [1] x86_64-pc-linux-gnu-11.2.0 *
clang version 13.0.0
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm/13/bin
/usr/lib/llvm/13
13.0.0
Python 3.9.7
Available Ruby profiles:
  [1]   ruby26 (with Rubygems)
  [2]   ruby27 (with Rubygems) *
Available Rust versions:
  [1]   rust-bin-1.56.1
  [2]   rust-1.56.1 *
php cli:
  [1]   php7.3
  [2]   php7.4
  [3]   php8.0 *

  HEAD of ::gentoo
commit 6980474095c30c80f30f5962c049517006f9109b
Author: Repository mirror & CI <repomirrorci@gentoo.org>
Date:   Sun Nov 14 10:06:46 2021 +0000

    2021-11-14 10:06:45 UTC

emerge -qpvO dev-util/clazy
[ebuild  N    ] dev-util/clazy-1.9
Comment 1 Toralf Förster gentoo-dev 2021-11-14 14:38:46 UTC
Created attachment 751100 [details]
emerge-info.txt
Comment 2 Toralf Förster gentoo-dev 2021-11-14 14:38:47 UTC
Created attachment 751102 [details]
dev-util:clazy-1.9:20211114-112346.log
Comment 3 Toralf Förster gentoo-dev 2021-11-14 14:38:48 UTC
Created attachment 751104 [details]
emerge-history.txt
Comment 4 Toralf Förster gentoo-dev 2021-11-14 14:38:50 UTC
Created attachment 751106 [details]
environment
Comment 5 Toralf Förster gentoo-dev 2021-11-14 14:38:51 UTC
Created attachment 751108 [details]
etc.portage.tar.bz2
Comment 6 Toralf Förster gentoo-dev 2021-11-14 14:38:52 UTC
Created attachment 751110 [details]
logs.tar.bz2
Comment 7 Toralf Förster gentoo-dev 2021-11-14 14:38:53 UTC
Created attachment 751112 [details]
temp.tar.bz2
Comment 8 Fernando B. Nascimento 2021-12-10 20:33:57 UTC
The Description doesn't include the error, I would like to add it:

//##### terminal output (citation)
FAILED: CMakeFiles/ClazyPlugin.dir/src/FixItExporter.cpp.o 
/usr/bin/x86_64-pc-linux-gnu-g++ -DClazyPlugin_EXPORTS -DHAS_STD_FILESYSTEM -DHAVE_CLANG_CONFIG_H -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -I. -I/usr/lib/llvm/13/include -I/var/tmp/portage/dev-util/clazy-1.9/work/clazy-1.9 -I/var/tmp/portage/dev-util/clazy-1.9/work/clazy-1.9/src  -march=sandybridge -O2 -ftree-vectorize -fomit-frame-pointer -pipe -std=c++14 -fno-common -Woverloaded-virtual -Wcast-qual -fno-strict-aliasing -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings -fno-exceptions -fno-rtti -fPIC -fPIC -std=gnu++17 -Winvalid-pch -include /var/tmp/portage/dev-util/clazy-1.9/work/clazy-1.9_build/CMakeFiles/ClazyPlugin.dir/cmake_pch.hxx -MD -MT CMakeFiles/ClazyPlugin.dir/src/FixItExporter.cpp.o -MF CMakeFiles/ClazyPlugin.dir/src/FixItExporter.cpp.o.d -o CMakeFiles/ClazyPlugin.dir/src/FixItExporter.cpp.o -c /var/tmp/portage/dev-util/clazy-1.9/work/clazy-1.9/src/FixItExporter.cpp
/var/tmp/portage/dev-util/clazy-1.9/work/clazy-1.9/src/FixItExporter.cpp: In member function ‘void FixItExporter::Export()’:
/var/tmp/portage/dev-util/clazy-1.9/work/clazy-1.9/src/FixItExporter.cpp:201:65: error: ‘F_None’ is not a member of ‘llvm::sys::fs’; did you mean ‘OF_None’?
  201 |         llvm::raw_fd_ostream OS(exportFixes, EC, llvm::sys::fs::F_None);
      |                                                                 ^~~~~~
      |                                                                 OF_None
//##### end terminal output (citation)

I went to look on the specific file that was compiled (path on previous lines) , line 201 and it is indeed written "F_None":

//##### code (citation)
void FixItExporter::Export()
{
    auto tuDiag = getTuDiag();
    if (!tuDiag.Diagnostics.empty()) {
        std::error_code EC;
        llvm::raw_fd_ostream OS(exportFixes, EC, llvm::sys::fs::F_None);
        llvm::yaml::Output YAML(OS);
        YAML << getTuDiag();
    }
}
//##### end code (citation)

Then I went to the github (https://github.com/KDE/clazy/blob/master/src/FixItExporter.cpp) and now (2021-12-10 20:32:00Z) at line 201 it is "OF_None":

//##### code (citation)
void FixItExporter::Export()
{
    auto tuDiag = getTuDiag();
    if (!tuDiag.Diagnostics.empty()) {
        std::error_code EC;
        llvm::raw_fd_ostream OS(exportFixes, EC, llvm::sys::fs::OF_None);
        llvm::yaml::Output YAML(OS);
        YAML << getTuDiag();
    }
}
//##### end code (citation)

May be version differences or incompatibility? Because clazy was compiled on my machine before, probably with llvm 11, now it is 13.
Comment 9 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-12-10 20:49:43 UTC
I think we need to use the LLVM eclass if we're building against LLVM.
Comment 10 Andreas Sturmlechner gentoo-dev 2021-12-10 20:50:31 UTC
Can you deal with that?
Comment 11 Fernando B. Nascimento 2021-12-10 21:04:21 UTC
Well, if this question was directed to me, I don't know what to do or how, not even used to diff files (that is just the start of what would have to be done).

Anyway I should have looked a bit more:

https://github.com/KDE/clazy/commit/fca73257a803dd8d0524e2e0d6927733c500be78

Citation:
"
Fix build with upcoming llvm 13

llvm::sys::fs::F_None was removed
...
 Sergio Martins committed on 20 Jul
"

I don't know if it may be solved or it just makes clazy-1.9 incompatible with llvm-13, as changing it would make it incompatible with <=llvm-12.

May be a #ifndef / #define would work, but i don't know if it is ok, and if other erros would show up.

If it is ok, as I said, unfamiliar with diff files, but that's my idea if anyone experienced know how to do what. May be it is obvious but no cost in saying it. :-)
Comment 12 Fernando B. Nascimento 2021-12-10 21:06:39 UTC
(In reply to Sam James from comment #9)
> I think we need to use the LLVM eclass if we're building against LLVM.

Just pointing if it is of any relevance: you linked a bug for version 1.10, this bug is for version 1.9.
Comment 13 Andreas Sturmlechner gentoo-dev 2021-12-10 21:08:29 UTC
Don't waste your time with 1.9 and llvm:13. There is 1.10 for that and it is available in ~arch.
Comment 14 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-12-10 21:16:05 UTC
(In reply to Fernando B. Nascimento from comment #12)
> (In reply to Sam James from comment #9)
> > I think we need to use the LLVM eclass if we're building against LLVM.
> 
> Just pointing if it is of any relevance: you linked a bug for version 1.10,
> this bug is for version 1.9.

The idea is that 1.10 should fix your issue for now so we should focus on stabling it. We also need to look at using the LLVM eclass probably.
Comment 15 Larry the Git Cow gentoo-dev 2021-12-11 01:16:26 UTC Comment hidden (obsolete)
Comment 16 Larry the Git Cow gentoo-dev 2021-12-11 01:18:14 UTC Comment hidden (obsolete)
Comment 17 Larry the Git Cow gentoo-dev 2021-12-13 00:11:41 UTC
The bug has been referenced in the following commit(s):

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

commit af5f598a4e43dd87b224e4281b167773c3a5d74e
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2021-12-10 23:24:37 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2021-12-13 00:11:29 +0000

    dev-util/clazy: use llvm.eclass to declare compatibility and build patch
    
    - We need to use llvm.eclass to ensure we don't use too new of
      a version of LLVM and Clang.
    
      We're now using the llvm.eclass mechanisms to enforce the same
      versions of Clang and LLVM.
    
    - Throw in a build patch from upstream
      (upstream commit b74c8729b7b71528c1528579435cda7fdb5d31b4) which
      was necessary for me.
    
    Bug: https://bugs.gentoo.org/811723
    Bug: https://bugs.gentoo.org/823726
    Closes: https://bugs.gentoo.org/824986
    Signed-off-by: Sam James <sam@gentoo.org>

 .../{clazy-1.10.ebuild => clazy-1.10-r1.ebuild}    | 25 ++++++------
 dev-util/clazy/files/clazy-1.10-gcc-build.patch    | 44 ++++++++++++++++++++++
 dev-util/clazy/files/clazy-1.10-use-c++17.patch    | 20 ++++++++++
 3 files changed, 78 insertions(+), 11 deletions(-)
Comment 18 Tiernan Hubble 2021-12-13 16:01:48 UTC
The latest change ( https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=af5f598a4e43dd87b224e4281b167773c3a5d74e ) restricts clazy-1.10 from using >llvm-12. But LLVM 13 seems to have been working fine with clazy-1.10 before. Was this change meant to be applied to clazy-1.9? Or are there other issues with clazy-1.10 and LLVM 13?
Comment 19 Larry the Git Cow gentoo-dev 2021-12-13 22:42:02 UTC
The bug has been closed via the following commit(s):

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

commit b4878bbf92012b664886c275514cca0bf50f2897
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2021-12-13 22:41:48 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2021-12-13 22:41:48 +0000

    dev-util/clazy: allow LLVM 13
    
    Omitted by mistake.
    
    Closes: https://bugs.gentoo.org/823726
    Signed-off-by: Sam James <sam@gentoo.org>

 dev-util/clazy/{clazy-1.10-r1.ebuild => clazy-1.10-r2.ebuild} | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)