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

Ensure that process run logs are directly runnable via copy+paste #1596

Closed
mgsloan opened this issue Jan 3, 2016 · 1 comment
Closed

Ensure that process run logs are directly runnable via copy+paste #1596

mgsloan opened this issue Jan 3, 2016 · 1 comment

Comments

@mgsloan
Copy link
Contributor

mgsloan commented Jan 3, 2016

In order to make stack development / debugging easier, it would be nice if you could rely on copying+pasting process invocations out of the verbose log. This will require a couple things:

  • Make sure temporary files needed by these processes stick around after stack is done executing. In order to ensure eventual deletion, we can either put things in the system temp directory, or manage our own temp directory.

    For example, currently with stack solver -v, you will get a cabal invocation which involves an argument like --config-file=/tmp/cabal-solver3217/cabal.config. It uses withSystemTempDirectory, which deletes the files involved.

    In some circumstances, it the temporary files may be quite large, and so it's wasteful to keep them around. For this, we can have a utility like withTempDir DeletePromptly $ \dir -> ..., and changing the argument to DeleteLazily will cause the stuff to linger. This way, there's a very straightforward change that can be made to enable debugging.

  • When the process logging stuff that has a CWD, output it as a (cd CWD && cmd). This way, it'll temporarily set the current work dir of a subshell.

  • In some cases, we can use commandline arguments instead of setting CWD - Git should use --git-dir and --work-tree not changing directory #1577

@snoyberg
Copy link
Contributor

Closing as WONTFIX

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

No branches or pull requests

3 participants