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

CodeChecker analyze fails for 6.22.2 under Windows with AttributeError: module 'os' has no attribute 'uname' #3968

Closed
petermbauer opened this issue Jul 25, 2023 · 14 comments
Labels
analyzer 📈 Related to the analyze commands (analysis driver) bug 🐛 platform-Windows 🖥

Comments

@petermbauer
Copy link
Contributor

Describe the bug
Executing CodeChecker analyze leads to AttributeError: module 'os' has no attribute 'uname'.

 Traceback (most recent call last):
   File "D:\somedir\lib\site-packages\codechecker_common\cli.py", line 167, in main
     add_subcommand(subparsers, subcommand,
   File "D:\somedir\lib\site-packages\codechecker_common\cli.py", line 57, in add_subcommand
     command_module.add_arguments_to_parser(sc_parser)
   File "D:\somedir\Lib\site-packages\codechecker_analyzer/cmd\analyze.py", line 456, in add_arguments_to_parser
     clang_has_z3 = analyzer_types.is_z3_capable()
   File "D:\somedir\lib\site-packages\codechecker_analyzer\analyzers\analyzer_types.py", line 73, in is_z3_capable
     enabled_analyzers, _ = check_supported_analyzers([ClangSA.ANALYZER_NAME])
   File "D:\somedir\lib\site-packages\codechecker_analyzer\analyzers\analyzer_types.py", line 144, in check_supported_analyzers
     context = analyzer_context.get_context()
   File "D:\somedir\lib\site-packages\codechecker_analyzer\analyzer_context.py", line 314, in get_context
     return Context()
   File "D:\somedir\lib\site-packages\codechecker_common\singleton.py", line 20, in __call__
     super(Singleton, cls).__call__(*args, **kwargs)
   File "D:\somedir\lib\site-packages\codechecker_analyzer\analyzer_context.py", line 68, in __init__
     machine = os.uname().machine
 AttributeError: module 'os' has no attribute 'uname'

The problematic code has been introduced with 6.22.2: v6.22.1...v6.22.2#diff-b65c399d1bcab9aba1b50586c3ef10dfd319e80a985396c6739f83980a085a98R68

CodeChecker version
6.22.2

To Reproduce
see above

Expected behaviour
Run the analysis without an error

Desktop (please complete the following information)

  • OS: Windows
  • Version: 10
  • Python 3.10.0

Additional context
Add any other context about the problem.

@vodorok
Copy link
Contributor

vodorok commented Jul 26, 2023

Hi @petermbauer , I admit that feature was not implemented in a platform-independent manner, if you start a python interpreter, and do the following, can you post the output of platfom.uname()?

python3
Python 3.8.10 (default, May 26 2023, 14:05:08) 
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform
>>> platform.uname()

@petermbauer
Copy link
Contributor Author

Hi @vodorok , thanks for caring, here is the output:

λ python
Python 3.10.9 (tags/v3.10.9:1dd9be6, Dec  6 2022, 20:01:21) [MSC v.1934 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform
>>> platform.uname()
uname_result(system='Windows', node='myhostname', release='10', version='10.0.19045', machine='AMD64')

@petermbauer
Copy link
Contributor Author

Hi @vodorok , any chance this will be fixed in the near future? The only other option would be to switch back to Python <3.10 to be able to use 6.22.1 again.

@dsmtE
Copy link

dsmtE commented Sep 6, 2023

Hi,
Just to know, same issue with version 6.22.2 (python 3.8.10).

@totocaca123
Copy link
Contributor

totocaca123 commented Sep 17, 2023

same issue with python 3.11 on Windows 11 x64

@petermbauer
Copy link
Contributor Author

Are you willing to release a 6.22.3 if a fix is contributed?

@dragoudin
Copy link

Are you willing to release a 6.22.3 if a fix is contributed?

yes would be nice

@bruntib
Copy link
Contributor

bruntib commented Sep 19, 2023

Hi, we are planning the next release in October with CodeChecker 6.23.0. Unfortunately, this is the earliest date, that I can tell now according to our schedule.

@whisperity
Copy link
Contributor

To all who commented "same": Is this a Windows-specific issue, or are you using Linux and getting the issue?

@totocaca123
Copy link
Contributor

To all who commented "same": Is this a Windows-specific issue, or are you using Linux and getting the issue?

seems it is a windows issue

@Schuchmann
Copy link

To all who commented "same": Is this a Windows-specific issue, or are you using Linux and getting the issue?

seems it is a windows issue

Yes, only windows

@bruntib
Copy link
Contributor

bruntib commented Sep 25, 2023

Fixed by #4012.

@bruntib bruntib closed this as completed Sep 25, 2023
@petermbauer
Copy link
Contributor Author

Hi, we are planning the next release in October with CodeChecker 6.23.0. Unfortunately, this is the earliest date, that I can tell now according to our schedule.

@bruntib , any update on the planned release date?

@whisperity whisperity changed the title CodeChecker analyze fails for 6.22.2 under Windows with "AttributeError: module 'os' has no attribute 'uname'" CodeChecker analyze fails for 6.22.2 under Windows with AttributeError: module 'os' has no attribute 'uname' Oct 19, 2023
@whisperity
Copy link
Contributor

any update on the planned release date?

@petermbauer We're trying to wrap everything up by the end of this month. A release candidate will come very soon, and the clean release will be published in late November.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer 📈 Related to the analyze commands (analysis driver) bug 🐛 platform-Windows 🖥
Projects
None yet
Development

No branches or pull requests

8 participants