Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

various dependency issues on Fedora, search path /usr/lib/x86_64-linux-gnu does not exist, broken links in README files #617

Closed
SomePersonSomeWhereInTheWorld opened this issue Oct 6, 2021 · 21 comments

Comments

@SomePersonSomeWhereInTheWorld
Copy link

Issue Summary

various dependency issues on Fedora, search path /usr/lib/x86_64-linux-gnu does not exist, broken links in README files

Environment

  • Operation system name and version: Fedora 34
  • OCLint version: 21.05
  • How OCLint is installed: local build? prebuilt binary downloaded from github? homebrew install? others?
    via ./make

Reproduction Steps

run ./make

Sample code

First ninja needs to be installed, e.g. with dnf install ninja-build otherwise this error appears:

CMake Error: CMake was unable to find a build program corresponding to "Ninja".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage

Then re2c needs installing, dnf install re2c:
re2c was not found; changes to src/*.in.cc will not affect your build.

Then the path to ncurses-compat-libs or libtinfo.so does not exist on Fedora, so this error happens:
ninja: error: '/usr/lib/x86_64-linux-gnu/libtinfo.so', needed by 'bin/oclint-21.05', missing and no known rule to make it
So a work around is ln -s /usr/lib64/libtinfo.so /usr/lib/x86_64-linux-gnu/libtinfo.so, unless a path can be specified?

The installation instructions says to cp -rp include/* /usr/local/include/ but the only include directory I found was oclint/build/llvm-install

The README in oclint/oclint-scripts has 2 broken links:

(Detail description can be found at
    https://oclint.org/docs/intro/build.html

Compiling in debug mode and enabling testing, please look at
    https://oclint.org/docs/devel/compiletest.html)

Expected Behavior

Better detection of dependencies

Actual Behavior

missing libraries and non-existent path in Fedora

@ryuichi-assistant
Copy link

It seems like you have not followed our issue template.

To make it easier for us help you resolve this issue, please update the issue by following our template.

@SomePersonSomeWhereInTheWorld
Copy link
Author

It seems like you have not followed our issue template.

To make it easier for us help you resolve this issue, please update the issue by following our template.

updated

@ryuichis
Copy link
Contributor

ryuichis commented Oct 9, 2021

Thank you @RobbieTheK . I have updated the broken links in oclint-scripts README. For the other issues, it's mainly due to the fact that many of the scripts are assumed with a Ubuntu distribution, including using an official LLVM ubuntu build. I guess the most straightforward fix would be change that to a LLVM build on Fedora, but LLVM community doesn't seem to have one. Could you by any chance provide me a pointer?

@SomePersonSomeWhereInTheWorld
Copy link
Author

Would this work? https://fedora.pkgs.org/34/fedora-x86_64/clang-12.0.0-0.3.rc1.fc34.x86_64.rpm.html

Perhaps a simple solution is to add the requirements in the README or other file?

@ryuichis
Copy link
Contributor

Don't think this rpm would work since we are pointing to the LLVM/clang 13 build. But I found this https://copr.fedorainfracloud.org/coprs/g/fedora-llvm-team/llvm-snapshots/ that is akin to https://apt.llvm.org/ that might work. However, I don't have a Fedora and it seems to me that GitHub Actions also do not provide a Fedora image. I'll appreciate it if you could give it a try and let me know how it goes.

@ryuichi-assistant
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by adding a comment.

@SomePersonSomeWhereInTheWorld
Copy link
Author

Some updates. First there's in include directory that is mentioned in the installation instructions:

oclint-21.10]# cp -rp include/* /usr/local/include/
cp: cannot stat 'include/*': No such file or directory

Then using the sample instructions there's an issue with ncurses and possibly that symbol versioning isn't enabled or being found. I compiled it based on this SO suggestion and I'm still getting this error:

oclint -report-type html -o report.html sample.cpp -- -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -I/usr/include -I/opt/ncurses-symbol/include -c
oclint: /lib64/libtinfo.so.6: no version information available (required by oclint)

I do have a symbolic link at /lib64/libtinfo.so.6

 ls -l /lib64/libtinfo.so.6
lrwxrwxrwx 1 root root 15 Jul 22  2021 /lib64/libtinfo.so.6 -> libtinfo.so.6.2
readelf -V /lib64/libtinfo.so.5|grep gnu
Version symbols section '.gnu.version' contains 248 entries:
Version needs section '.gnu.version_r' contains 1 entry:

Is the -I option being ignored? And ncurses-devel & ncurses-compat-libs are installed.

Edit: I made some progress using these options with configure: ./configure --prefix=/opt/ncurses-symbol --with-versioned-syms --with-termlib --with-shared and then a sym link, in our case: ln -s /opt/ncurses-symbol/lib/libtinfo.so.6.3 /lib64/libtinfo.so.6

Using your sample code there are some more errors picked up:

oclint sample.cpp -- -c

OCLint Report

Summary: TotalFiles=1 FilesWithViolations=1 P1=0 P2=1 P3=3 

/home/sample.cpp:3:5: collapsible if statements [basic|P3] 
/home/sample.cpp:6:13: dead code [basic|P2] 
/home/sample.cpp:2:5: short variable name [naming|P3] Length of variable name `i` is 1, which is shorter than the threshold of 3
/home/sample.cpp:2:5: short variable name [naming|P3] Length of variable name `j` is 1, which is shorter than the threshold of 3

[OCLint (https://oclint.org) v21.10]

Should there be any output for oclint -report-type html -o report.html sample.cpp -- -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -I/usr/include -I/usr/local/include -c? I just get a blank response.

@ryuichi-assistant
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by adding a comment.

@SomePersonSomeWhereInTheWorld
Copy link
Author

Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by adding a comment.

I still see this, but is this expected?

oclint sample.cpp -- -c
OCLint Report
Summary: TotalFiles=1 FilesWithViolations=1 P1=0 P2=1 P3=3 
/root/sample.cpp:2:5: short variable name [naming|P3] Length of variable name `i` is 1, which is shorter than the threshold of 3
/root/sample.cpp:2:5: short variable name [naming|P3] Length of variable name `j` is 1, which is shorter than the threshold of 3
/root/sample.cpp:6:13: dead code [basic|P2] 
/root/sample.cpp:3:5: collapsible if statements [basic|P3] 

Also the instructions on the web page appear to be incorrect:

cp -rp include/* /usr/local/include/
cp: cannot stat 'include/*': No such file or directory

There is an include directory in ~/lib/clang/13.0.1

And I guess I didn't notice but oclint -report-type html -o report.html sample.cpp -- -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -I/usr/include -I/usr/local/include -c does indeed produce a report.html file.

@ryuichi-assistant
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by adding a comment.

@SomePersonSomeWhereInTheWorld
Copy link
Author

We've been on the latest version from Feb 22 so per my last comment the same problems exist.

@ryuichi-assistant
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by adding a comment.

@SomePersonSomeWhereInTheWorld
Copy link
Author

Issues are still present

@ryuichi-assistant
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by adding a comment.

@SomePersonSomeWhereInTheWorld
Copy link
Author

No update since Feb 2022 of course these issues remain.

@ryuichi-assistant
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by adding a comment.

@SomePersonSomeWhereInTheWorld
Copy link
Author

Problems still exist

@ryuichi-assistant
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by adding a comment.

@SomePersonSomeWhereInTheWorld
Copy link
Author

Issue was not fixed in latest update.

@ryuichi-assistant
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by adding a comment.

@ryuichi-assistant
Copy link

This issue will be auto-closed because there hasn't been any activity for a few months. Feel free to open a new one if you still experience this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants