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

Anarki hangs when starting on Windows via arc.cmd #217

Open
xenogl opened this issue Nov 19, 2022 · 10 comments
Open

Anarki hangs when starting on Windows via arc.cmd #217

xenogl opened this issue Nov 19, 2022 · 10 comments

Comments

@xenogl
Copy link

xenogl commented Nov 19, 2022

When I try to start Anarki via arc.cmd on windows 10, a command prompt opens, but only the blinking cursor is visible and it waits endlessly. Only when I press some key (e.g. space), the text "initializing arc... (may take a minute)" appears. After about 30 seconds the arc prompt appears. But, if I now type something in that prompt (say, number 1) nothing happens, as if repl doesn't work at all. This was tested on Racket version 8.7

@akkartik
Copy link
Member

I don't have a solution but I do see similar problems. I'm on Windows 11. I have to press enter, space doesn't help. Then I see an error about not finding collection sha.

@akkartik
Copy link
Member

Ah, I forgot the raco pkg install sha

Now I can reproduce the second half of your report as well. And when I hit Ctrl+d I get this error:

char-whitespace?: contact violation
expected: char?
given: #<eof>

@akkartik akkartik reopened this Nov 20, 2022
@akkartik
Copy link
Member

One issue: Racket's (char-ready?) hangs on Windows where it immediately returns on Linux.

There may be others.

@xenogl
Copy link
Author

xenogl commented Nov 20, 2022

One issue: Racket's (char-ready?) hangs on Windows where it immediately returns on Linux.

There may be others.

How to solve this problem, what shoud I do?

@akkartik
Copy link
Member

I'm not sure. I'm not an expert in Windows or Racket. I'm poking at the problem when I have some time. Let's see if others have ideas as well.

I don't see any discussion online that Racket's char-ready? misbehaves on Windows, but I tested it in isolation outside of Anarki and saw the same behavior. Racket's documentation does say:

..byte-ready? and char-ready? are rarely the right choice.

I wonder now if trash-whitespace was just a bad idea. It was introduced in 421c700, and there have only been a couple of changes to it since. I suspect the initial commit.

I'm not at my Windows machine right now, but try deleting this line and see if it helps.

@akkartik
Copy link
Member

Though I don't think this explains why it hangs waiting for the initial key. Well, let's fix the second problem first.

@xenogl
Copy link
Author

xenogl commented Nov 20, 2022

I'm not at my Windows machine right now, but try deleting this line and see if it helps.

Yes, it helps: now I can type in repl.
But, i still got that hang on startup, where I have to press enter key first to get initial message "initializing arc... (may take a minute)". I cannot figure out how to fix this.

And second, what keystroke I should use to break back to repl when I want to break some unwanted long computation? (Ctrl-c exit from arc entirely, but i want only to break back to repl)

@akkartik
Copy link
Member

I think that ctrl+c might be a known issue..

For the first key, I'd try inserting some prints (display in Racket) between lines in the anarki-windows-cli function in the boot.rkt file. Try to figure out precisely what line causes it to wait for keyboard input.

@xenogl
Copy link
Author

xenogl commented Nov 20, 2022

I think that ctrl+c might be a known issue..

For the first key, I'd try inserting some prints (display in Racket) between lines in the anarki-windows-cli function in the boot.rkt file. Try to figure out precisely what line causes it to wait for keyboard input.

Something really strange happens here: when I run Anarki from the command line, not via a .cmd file, like this:

c:\Anarki>racket -t boot.rkt -e "(anarki-windows-cli)"

then everything works ok and there is no initial hang.

The problem only appears when Anarki is started via a .cmd file! I don't know how to explain this.

@akkartik
Copy link
Member

Wow! Good find.

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

No branches or pull requests

2 participants