-
Notifications
You must be signed in to change notification settings - Fork 16
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
Support using sphinxcontrib-hdl-diagrams on MSYS2 #73
base: main
Are you sure you want to change the base?
Conversation
ef60319
to
8da06dd
Compare
I'm running into issues with passing the yosys command as a list to subprocess.check_output(). What errors were you running into using it as it is? For some reason on my machine if it's passed a list, it will only run the first element of the list and ignore everything else. For instance: Python 3.9.3 (default, Apr 8 2021, 23:35:02)
[GCC 10.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import subprocess as sp
>>> sp.check_output('yosys --help', shell=True)
b'\nUsage: yosys [options] [<infile> [..]]\n\n -Q\n suppress printing of banner (copyright, disclaimer, version)\n\n -T\n
... # returns normally
>>> sp.check_output(['yosys --help'], shell=True)
b'\nUsage: yosys [options] [<infile> [..]]\n\n -Q\n suppress printing of banner (copyright, disclaimer, version)\n\n -T\n
... # returns normally
>>> sp.check_output(['yosys', '--help'], shell=True)
# I press CTRL + D as it's stuck at the yosys prompt
...
Yosys 0.9+4052 (open-tool-forge build) (git sha1 dce037a6, gcc 9.3.0-17ubuntu1~20.04 -Os)\n\n\nyosys> exit\nEnd of script.
...
>>> sp.check_output(['echo look at me', 'yosys', '--help'], shell=True)
b'look at me\n'
# returns normally
>>> It does this when I try build the docs (which uses conda python) as well. |
@nobodywasishere. try with #!/usr/bin/env python3
import subprocess as sp
print('First')
print(sp.check_output(['yosys', '--version'], shell=True).decode("utf-8"))
print('Second')
print(sp.check_output('yosys --version', shell=True).decode("utf-8"))
print('Third')
print(sp.check_output(['yosys', '--version'], shell=False).decode("utf-8"))
print('Fourth')
print(sp.check_output('yosys --version', shell=False).decode("utf-8")) On MSYS2 (MINGW64):
On a container (hdlc/yosys):
So, on Linux it seems that the list requires Shell false and the string needs shell true. |
This is running
|
This was significantly more painful than I had expected, but I got something.
In this PR, 5 modifications are contributed:
html
was added.make -C docs html
allows building the docs using locally available tools.hdl_diagram_yosys = 'system'
is added.sphinxcontrib_hdl_diagrams/__init__.py
is broken. I modified it for using a list of arguments instead.Therefore, I will mark this PR as a draft. The following issues need to be solved:
extra.paths
, but I could not have them added to the PATH programmatically. I have problems when readingC:/Program Files/nodejs
, because of the space between "Program" and "Files" and because of the/
. See step "Build Docs" of the workflow.SPHINXBUILD
should not setup Conda by default. That's non idiomatic. InsteadSPHINXBUILD
should allow a regular/typical Sphinx build; what any user would expect in any Sphinx other project. Then, a custom target or envvar can be used for explicitly enabling Conda.dot ... && move ...
internally. To start with,move
seems not to exist.Ref: #72