GithubHelp home page GithubHelp logo

dep-check's People

Contributors

anis-campos avatar cedroyer avatar dependabot[bot] avatar imonor avatar jbbqqf avatar lionelmoi avatar lumautomation avatar noirbee avatar sebastien-boulle avatar tleveque69 avatar tvuillemin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dep-check's Issues

AttributeError when creating dependency graph

Version

dep-check V1.0.3
Python V3.8.2
OS: macOS Big Sur V11.2.3

Problem description & steps to reproduce

Creation of the graph succeeds, but the script exits with an AttributeError when trying to create a dependency graph for pylint:

(venv38) andreas@Air-von-Andreas pylint % dep_check graph --lang python pylint
WARNING:root:Couldn't load GO library, you won't be able to use dep-check on GO projects.
Traceback (most recent call last):
  File "/Users/andreas/programming/forks/pylint/venv38/bin/dep_check", line 10, in <module>
    sys.exit(main())
  File "/Users/andreas/programming/forks/pylint/venv38/lib/python3.8/site-packages/dep_check/main.py", line 209, in main
    sys.exit(MainApp().main())
  File "/Users/andreas/programming/forks/pylint/venv38/lib/python3.8/site-packages/dep_check/main.py", line 143, in main
    return code.value
AttributeError: 'NoneType' object has no attribute 'value'

Segmentation fault error

Env

OS: MacOS Catalina 10.15.4 (19E287)
Python: Python 3.7.7 ( using asdf )

Issue

Nominal case

After creating a venv, runnin dep_check shows help preceded by a error message like the following:

(venv) ➜  dep_check  

# pkg-config --cflags  -- python3
Package python3 was not found in the pkg-config search path.
Perhaps you should add the directory containing `python3.pc'
to the PKG_CONFIG_PATH environment variable
No package 'python3' found
pkg-config: exit status 1
WARNING:root:Couldn't load GO library, you won't be able to use dep-check on GO projects.
usage: dep_check [-h] {build,check,graph}
dep_check: error: the following arguments are required: feature
(venv) ➜  

Segfault

I tried to remove the warning by adding to the the following to my profile file

#setup for pkg-config
export PKG_CONFIG_PATH=$(asdf where python 3.7.7)/lib/pkgconfig/

This solves the warning issue but the resulting goparse.so from the go build is faulty creating a segmentation fault:

(venv) ➜  test python -Xfaulthandler venv/bin/dep_check 

Fatal Python error: Segmentation fault

Current thread 0x0000000112af9dc0 (most recent call first):
  File "<frozen importlib._bootstrap>", line 219 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 1043 in create_module
  File "<frozen importlib._bootstrap>", line 583 in module_from_spec
  File "<frozen importlib._bootstrap>", line 670 in _load_unlocked
  File "<frozen importlib._bootstrap>", line 967 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 983 in _find_and_load
  File "<frozen importlib._bootstrap>", line 219 in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1035 in _handle_fromlist
  File "/private/tmp/test/venv/lib/python3.7/site-packages/dep_check/infra/go_parser.py", line 9 in <module>
  File "<frozen importlib._bootstrap>", line 219 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 728 in exec_module
  File "<frozen importlib._bootstrap>", line 677 in _load_unlocked
  File "<frozen importlib._bootstrap>", line 967 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 983 in _find_and_load
  File "/private/tmp/test/venv/lib/python3.7/site-packages/dep_check/main.py", line 13 in <module>
  File "<frozen importlib._bootstrap>", line 219 in _call_with_frames_removed
  File "<frozen importlib._bootstrap_external>", line 728 in exec_module
  File "<frozen importlib._bootstrap>", line 677 in _load_unlocked
  File "<frozen importlib._bootstrap>", line 967 in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 983 in _find_and_load
  File "venv/bin/dep_check", line 6 in <module>
[1]    93970 segmentation fault  python -Xfaulthandler venv/bin/dep_check

I'm not sure why there is a segmentation fault, might be related to my environment. But in any case, the project is python only so this seg fault should no happen

Proposed solution:

There 2 solution for this issue from what I could investigate.

1 - No error message:

Do no show the pkg-config error message if possible. This would prevent people like me to try solving it as it is pretty explicit and easy to follow

2 - Only import GoParser if necessary

The seg fault is caused by the

#infra/go_parser.py 
9: from .lib import goparse

I don't the reason why there is a seg fault, but it's most likely a library linking issue, but in a python project this should not matter !

So instead of importing the go module in every case, import it on demand if the project uses go.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.