Coder Social home page Coder Social logo

sby: Failed to create process about sby HOT 24 OPEN

yosyshq avatar yosyshq commented on July 28, 2024
sby: Failed to create process

from sby.

Comments (24)

trayres avatar trayres commented on July 28, 2024 1

sby-script.py is located in

C:\msys64\usr\local\bin

sby.exe is in the same location

The shebang line of sby-script is the following:
#!C:/msys64/usr/local/bin/python3

From a MSYS2 prompt, "where python" produces:

C:\msys64\mingw64\bin\python.exe

Replacing the shebang line with #!C:/msys64/mingw64/bin/python.exe returns something now:

$sby
File "C:\msys64\usr\local\bin\sby-script.py", line 130
print("ERROR: Use -f to re-run in existing directory.", file=sys.stderr)
^
SyntaxError: invalid syntax

from sby.

ZipCPU avatar ZipCPU commented on July 28, 2024

Try adding a SymbiYosys script to the command line, such as

sby -f file.sby

One example of such a script would be this one, used to verify this fairly simple bus counter. You can find a longer discussion of this timer, and its proof, here. For more information about the SymbiYosys script file format, check out this readthedocs page.

Dan

from sby.

cliffordwolf avatar cliffordwolf commented on July 28, 2024

Do you get any output at all from sby --help? (Just calling sby should read a .sby file from stdin. So maybe that operating mode is not the best thing to start with.)

from sby.

trayres avatar trayres commented on July 28, 2024

sby --help gives me the same error:
failed to create process.

It didn't give me any build errors and is located in
C:\msys64\usr\local\bin\sby.exe

Hm. Perhaps some combination of things while using MSYS2?

from sby.

cliffordwolf avatar cliffordwolf commented on July 28, 2024

Since I'm not a windows user I can only assume this is somehow related to #32. cc @cr1901

from sby.

trayres avatar trayres commented on July 28, 2024

This DOES look related! Excellent that someone else is in the same (or similar) boat.

from sby.

cr1901 avatar cr1901 commented on July 28, 2024

@cliffordwolf Yes, it's related. failed to create process is the very helpful and definitely-not-opaque error that launcher.c emits when it couldn't launch the Python interpreter. sby.exe is the compiled version of launcher.c.

@trayres Where is the file sby-script.py located? Is it in the same directory as sby.exe? What does the shebang line of sby-script.py look like after installation? sby.exe does use the shebang line to find the Python interpreter.

from sby.

cr1901 avatar cr1901 commented on July 28, 2024

@trayres Replace with #!C:/msys64/mingw64/bin/python3.exe... you appear to be calling the python2 interpreter.

In any case, I provide a Makefile variable called PYTHON to override the autodetection of where your Python interpreter is, in case the default is inappropriate.

Try installing SymbiYosys again with either of the following invocations (I prefer the second one), and sby.exe should work:

make PYTHON=C:\\msys64\\mingw64\\bin\\python3.exe PREFIX=/usr/local install
make PREFIX=/mingw64 install

from sby.

trayres avatar trayres commented on July 28, 2024

Good catch, I thought I had symlinked python to python3 but apparently I had installed them both via MSYS2.

I will pull latest, reinstall and provide feedback this weekend. Thank you.

from sby.

cr1901 avatar cr1901 commented on July 28, 2024

Like yosys, I only intend to support compiling and installing from an MSYS prompt, but users on Windows should be able to use sby outside of said prompt. I should probably add something to the make help or README.md to indicate user-settable Makefile vars...

from sby.

trayres avatar trayres commented on July 28, 2024

Just to clarify: Is using from within MSYS2 recommended or viable practice? Or is the intended workflow to compile/install via MSYS2 then use CMD?

from sby.

cr1901 avatar cr1901 commented on July 28, 2024

@trayres If you're using sby interactively from a console, then either msys2 or cmd will work fine.

However, stuff like Python's subprocess module on Windows (or anything using CreateProcess directly) has no concept of msys2 bash or the shebang; the launcher exectuable called sby.exe is meant to workaround this.

from sby.

trayres avatar trayres commented on July 28, 2024

I used this after git pull:
make PREFIX=/mingw64 install

Now I get:

$sby demo.sby
Traceback (most recent call last):
File "C:\msys64\mingw64\bin\sby-script.py", line 22, in
from sby_core import SbyJob, SbyAbort
File "C:\msys64\mingw64\bin/../share/yosys/python3\sby_core.py", line 37, in
signal.signal(signal.SIGINT, force_shutdown)
NameError: name 'signal' is not defined

from sby.

cr1901 avatar cr1901 commented on July 28, 2024

@trayres Yes I noticed that too about 2 nights ago; that change appears to postdate my PR being accepted. Anyways I have a new PR in the works to improve Windows support, so I would suggest being on standby until that is ready.

from sby.

cr1901 avatar cr1901 commented on July 28, 2024

@trayres Try this branch and see if it fixes your problem :).

from sby.

trayres avatar trayres commented on July 28, 2024

Hm, this is what I get with that branch:

$ sby demo.sby
Traceback (most recent call last):
File "C:\msys64\mingw64\bin\sby-script.py", line 22, in
from sby_core import SbyJob, SbyAbort
File "C:\msys64\mingw64\bin/../share/yosys/python3\sby_core.py", line 37, in
signal.signal(signal.SIGINT, force_shutdown)
NameError: name 'signal' is not defined

from sby.

trayres avatar trayres commented on July 28, 2024

Then I added "import signal" to sby_core.py, and I got a little farther:

$ sby demo.sby
SBY 16:26:18 [demo] Copy 'demo.sv' to 'demo/src/demo.sv'.
SBY 16:26:18 [demo] engine_0: smtbmc z3
SBY 16:26:18 [demo] base: starting process "cd demo/src& yosys -ql ../model/design.log ../model/design.ys"
Traceback (most recent call last):
File "C:\msys64\mingw64\bin\sby-script.py", line 388, in
retcode |= run_job(t)
File "C:\msys64\mingw64\bin\sby-script.py", line 346, in run_job
job.run(setupmode)
File "C:\msys64\mingw64\bin/../share/yosys/python3\sby_core.py", line 625, in run
self.taskloop()
File "C:\msys64\mingw64\bin/../share/yosys/python3\sby_core.py", line 239, in taskloop
select(fds, [], [], 1.0) == ([], [], [])
OSError: [WinError 10093] Either the application has not called WSAStartup, or WSAStartup failed

from sby.

cr1901 avatar cr1901 commented on July 28, 2024

OSError: [WinError 10093] Either the application has not called WSAStartup, or WSAStartup failed

Mmm, that doesn't seem right at all... line 239 in my branch isn't a call to select at all... did you forget to do make PREFIX=/prefix install before testing?

from sby.

trayres avatar trayres commented on July 28, 2024

I just followed https://symbiyosys.readthedocs.io/en/latest/quickstart.html#installing

from sby.

cr1901 avatar cr1901 commented on July 28, 2024

Line 239 on your machine doesn't match line 239 in the branch that I pointed you to. Can you make sure the C:\msys64\mingw64\bin\sby-script.py and C:\msys64\mingw64\bin/../share/yosys/python3\*.py files are identical to the async branch?

from sby.

trayres avatar trayres commented on July 28, 2024

Something ain't right - it looked like there was another set of files from an earlier attempt to get this up and running.

So I blew away everything and reinstalled.

$ sby demo.sby
Traceback (most recent call last):
File "C:\msys64\mingw64\bin\sby-script.py", line 22, in
from sby_core import SbyJob, SbyAbort
ModuleNotFoundError: No module named 'sby_core'

Fine, add it to $PYTHONPATH:

$ export PYTHONPATH=/c/msys64/usr/local/share/yosys/python3/

Let's try again:

$ sby demo.sby
SBY 20:56:17 [demo] Copy 'demo.sv' to 'demo/src/demo.sv'.
SBY 20:56:18 [demo] engine_0: smtbmc z3
SBY 20:56:18 [demo] base: starting process "cd demo/src& yosys -ql ../model/design.log ../model/design.ys"
SBY 20:56:18 [demo] base: finished (returncode=0)
SBY 20:56:18 [demo] smt2: starting process "cd demo/model& yosys -ql design_smt2.log design_smt2.ys"
SBY 20:56:18 [demo] smt2: finished (returncode=0)
SBY 20:56:18 [demo] engine_0: starting process "cd demo& yosys-smtbmc -s z3 --presat --noprogress -t 100 --append 0 --dump-vcd engine_0/trace.vcd --dump-vlogtb engine_0/trace_tb.v --dump-smtc engine_0/trace.smtc model/design_smt2.smt2"
SBY 20:56:18 [demo] engine_0: failed to create process.
SBY 20:56:18 [demo] engine_0: finished (returncode=0)
SBY 20:56:18 [demo] ERROR: engine_0: Engine terminated without status.
SBY 20:56:18 [demo] DONE (ERROR, rc=16)

At this point, I'm sensing that the error is between the screen and the chair, and/or potentially between my ears, however it is now doing more than it previously has.

Does the (current) error make sense to you, or is it still something wrong with my configuration (...seems likely)?

from sby.

cr1901 avatar cr1901 commented on July 28, 2024
SBY 20:56:18 [demo] engine_0: failed to create process.

Make sure your yosys is up to date- at least newer than 53b28b3. Not using an up-to-date yosys would be one source of that that "very helpful" error message.

from sby.

trayres avatar trayres commented on July 28, 2024

Shoot, I thought it was:
$ yosys -V
Yosys 0.8+369 (git sha1 ea0e0722, x86_64-w64-mingw32-g++ 8.3.0 -Os)

from sby.

cr1901 avatar cr1901 commented on July 28, 2024

@trayres Then make sure yosys-smtbmc.exe and yosys-smtbmc-script.py exist on your path.

If they exist on your path already, then I don't know what the problem is then, sorry :(.

from sby.

Related Issues (20)

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.