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

Optimized builds/runs from IdeSession #181

Closed
snoyberg opened this issue Apr 22, 2014 · 7 comments
Closed

Optimized builds/runs from IdeSession #181

snoyberg opened this issue Apr 22, 2014 · 7 comments

Comments

@snoyberg
Copy link
Member

Goal: in addition to the current runStmt API, we should be able to kick off an optimized build and manage its runtime with a similar API to runStmt.

@Mikolaj
Copy link
Collaborator

Mikolaj commented May 17, 2014

Should I implement buffer timeout when running the exes? And/or separate buffer modes for stdout and stderr? I haven't investigated yet, but that will probably involve importing IdeBackendRTS into Main of the executable, etc. If so, I'd do that later on, as stage 2 of the implementation. Stage 1, with all other features (data dir, args, env, all RunActions operations), is ready, but not tested yet.

But perhaps this is too intrusive for an executable and not needed as much? To make this consistent, I would also need to modify the generated .cabal file to build executables in this way, I suppose?

@snoyberg
Copy link
Member Author

While it would be nice, I think including the buffer timeout code would be too intrusive. Let's start off without it, and we'll start doing some testing. If user testing reveals that we really do need the timeout code, let's investigate again.

@dcoutts
Copy link
Collaborator

dcoutts commented May 20, 2014

The existing RunActions API for snippets provides a way to interrupt. It uses an exception so it's not a forcible termination. The obvious equivalent for running compiled exes is to send a SIGINT, and that's what our patch does currently.

What we're currently missing is that second level: the ability to forcibly interrupt with a SIGTERM.

@dcoutts
Copy link
Collaborator

dcoutts commented May 20, 2014

What we're currently missing is that second level: the ability to forcibly interrupt with a SIGTERM.

Ignore this, I'm wrong. So I think this is all fine.

@Mikolaj
Copy link
Collaborator

Mikolaj commented May 23, 2014

A tested and fixed version is ready on branch runExe, ready to be merged. Here are the differences in behaviour compared to running snippets:

  • we don't control things on the exe side: no setting of buffer modes for stdin, stdout, stderr, no timeout on buffers, no setting of UFT8 encoding (test "Make sure encoding is UTF8" would fail for runExe); possibly there are some workarounds for any of these, but nothing obvious springs to my mind
  • the exes are not registered anywhere in the session state and so are not killed at session shutdown nor at session restart; a side effect is that session can be updated, etc. when the exes are running, without any problems; a bad side effect is that non-terminating exes permanently consume resources if not explicitly killed (via interrupt or forceCancel)
  • there is no counterpart to the resume operation
  • there are no breakpoints, etc.
  • the obvious things:
    • the need to run buildExe first
    • having only the main function executed
    • not reporting the exceptions raised, and other result kinds, but just an ExitStatus of the exe
    • etc.

@snoyberg
Copy link
Member Author

I'm a little concerned that exes aren't being tracked by the session state and automatically killed, but overall that might be a good situation for users, so let's wait until we have user testing to back up any change requests. Everything else makes perfect sense, thank you.

Let me know when we should update to a newer ide-backend commit and start testing this.

@Mikolaj
Copy link
Collaborator

Mikolaj commented May 23, 2014

Merged to experimental and tested with ide-backend tests.

@edsko edsko closed this as completed Sep 13, 2014
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

4 participants