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

bugfix: Unable to find "/usr/sbin/neato" when adding binary and data … #520

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jan-fuchs-fuky
Copy link

…files.

Problem on Debian GNU/Linux 11 (bullseye) and Ubuntu 22.04.1 LTS:

In : os.path.realpath(shutil.which("dot"))
Out: '/usr/sbin/libgvc6-config-update'

In : os.path.dirname(os.path.realpath(shutil.which("dot")))
Out: '/usr/sbin'

Solution:

In : os.path.dirname(shutil.which("dot"))
Out: '/usr/bin'

…files.

Problem on Debian GNU/Linux 11 (bullseye) and Ubuntu 22.04.1 LTS:

    In : os.path.realpath(shutil.which("dot"))
    Out: '/usr/sbin/libgvc6-config-update'

    In : os.path.dirname(os.path.realpath(shutil.which("dot")))
    Out: '/usr/sbin'

Solution:

    In : os.path.dirname(shutil.which("dot"))
    Out: '/usr/bin'
@bwoodsend
Copy link
Member

Indeed, dot is a symlink so we want to collect the file it points to but still call it dot.

root@924c75cb9e42:/# stat /usr/bin/dot                   
  File: /usr/bin/dot -> ../sbin/libgvc6-config-update

The comment just above however points out that on macOS, you need to resolve the symlink to get to the real graphviz installation hiding in homebrew's cellar.

@rokm
Copy link
Member

rokm commented Nov 22, 2022

For the executables, wouldn't it be safer if we just resolved each and every one using shutil.which instead of trying to resolve their directory and collecting them from it?

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

Successfully merging this pull request may close these issues.

3 participants