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

VM CLI: make it work on Windows #2268

Closed
AnnaShaleva opened this issue Nov 18, 2021 · 1 comment · Fixed by #2365
Closed

VM CLI: make it work on Windows #2268

AnnaShaleva opened this issue Nov 18, 2021 · 1 comment · Fixed by #2365
Labels
windows Windows platform
Milestone

Comments

@AnnaShaleva
Copy link
Member

Currently VM CLI doesn't pass tests on Windows with errors like:

2021-11-17T15:51:18.0009119Z === RUN   TestErrorOnStepInto
2021-11-17T15:51:18.0009542Z EOF
2021-11-17T15:51:18.0009888Z     cli_test.go:102: 
2021-11-17T15:51:18.0010323Z         	Error Trace:	cli_test.go:102
2021-11-17T15:51:18.0010765Z         	            				cli_test.go:495
2021-11-17T15:51:18.0011184Z         	Error:      	Expect "
2021-11-17T15:51:18.0011513Z �
2021-11-17T15:51:18.0011799Z �
2021-11-17T15:51:18.0012069Z �
2021-11-17T15:51:18.0012351Z �
2021-11-17T15:51:18.0012710Z �
2021-11-17T15:51:18.0012993Z �
2021-11-17T15:51:18.0013274Z �
2021-11-17T15:51:18.0013537Z �
2021-11-17T15:51:18.0013987Z �
2021-11-17T15:51:18.0014299Z �
2021-11-17T15:51:18.0014583Z �
2021-11-17T15:51:18.0014901Z ��[JNEO-GO-VM > 
2021-11-17T15:51:18.0015237Z �
2021-11-17T15:51:18.0015502Z �
2021-11-17T15:51:18.0015780Z �
2021-11-17T15:51:18.0016043Z �
2021-11-17T15:51:18.0016324Z �
2021-11-17T15:51:18.0016606Z �
2021-11-17T15:51:18.0016868Z �
2021-11-17T15:51:18.0017146Z �
2021-11-17T15:51:18.0017407Z �
2021-11-17T15:51:18.0017686Z �
2021-11-17T15:51:18.0017948Z �
2021-11-17T15:51:18.0018278Z ��[JNEO-GO-VM > 
...
2021-11-17T15:51:18.0077972Z ��[JNEO-GO-VM > stepover
2021-11-17T15:51:18.0078737Z         	            	" to match "Error:.*no program loaded"
2021-11-17T15:51:18.0079361Z         	Test:       	TestErrorOnStepInto
2021-11-17T15:51:18.0080021Z --- FAIL: TestErrorOnStepInto (0.01s)

The problem is in interactive console library we're using (https://github.com/abiosoft/ishell). See also example of failing Windows, Go 1.17 test job: https://github.com/nspcc-dev/neo-go/runs/4252308539.
Running VM CLI manually on Windows results in the following:

PS C:\Users\Anna\Documents\GitProjects\nspcc-dev\neo-go> .\bin\neo-go.exe vm

    _   ____________        __________      _    ____  ___
   / | / / ____/ __ \      / ____/ __ \    | |  / /  |/  /
  /  |/ / __/ / / / /_____/ / __/ / / /____| | / / /|_/ /
 / /|  / /___/ /_/ /_____/ /_/ / /_/ /_____/ |/ / /  / /
/_/ |_/_____/\____/      \____/\____/      |___/_/  /_/


NEO-GO-VM > ←[J←[2K

So there are problems with input.

There's also #1743, so maybe it's time to replace this CLI library.

AnnaShaleva pushed a commit that referenced this issue Nov 26, 2021
The problem I have recently encountered is that our tests fail
if I build a binary with `go test -c ./pkg/vm/cli` and run it.
This commit fixes this. It can be related to #2268, though it affects
tests only.

Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
@roman-khimov roman-khimov added this to the v0.98.2 milestone Jan 31, 2022
@roman-khimov roman-khimov added the windows Windows platform label Feb 8, 2022
@AnnaShaleva
Copy link
Member Author

All in all, the only issue with NEO-GO-VM > ←[J←[2K is left unresolved. These are escaping symbols aimed to clear line\screen (see https://github.com/abiosoft/readline/blob/master/runebuf.go#L591) and should be supported by Windows console (https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences#text-modification), but somehow they don't.

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

Successfully merging a pull request may close this issue.

2 participants