Support using sphinxcontrib-hdl-diagrams on MSYS2#73
Draft
umarcor wants to merge 4 commits intoSymbiFlow:mainfrom
Draft
Support using sphinxcontrib-hdl-diagrams on MSYS2#73umarcor wants to merge 4 commits intoSymbiFlow:mainfrom
umarcor wants to merge 4 commits intoSymbiFlow:mainfrom
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. |
Member
Author
|
@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. |
Member
Author
This is running |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This was significantly more painful than I had expected, but I got something.
In this PR, 5 modifications are contributed:
htmlwas added.make -C docs htmlallows building the docs using locally available tools.hdl_diagram_yosys = 'system'is added.sphinxcontrib_hdl_diagrams/__init__.pyis 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.SPHINXBUILDshould not setup Conda by default. That's non idiomatic. InsteadSPHINXBUILDshould 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,moveseems not to exist.Ref: #72