-
Notifications
You must be signed in to change notification settings - Fork 841
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
Dev tools like flycheck & flycheck-haskell need the host's TMPDIR and HOME mounted in the docker container #1949
Comments
This is for development tools like Emacs flycheck. Some tools expect to be able to write temp files into /tmp and then run `stack ....` to process them. Except, without this patch, the /tmp dir files are gone. resolves #1949 |
This patch is for docker projects and specifically to assist tools (e.g. Emacs) that read/write files in $HOME for dev work (flycheck & friends) resolves #1949
This patch is for docker projects and specifically to assist tools (e.g. Emacs) that read/write files in $HOME for dev work (flycheck & friends) resolves #1949
This patch is for docker projects and specifically to assist tools (e.g. Emacs) that read/write files in $HOME for dev work (flycheck & friends) resolves #1949
This patch is for docker projects and specifically to assist tools (e.g. Emacs) that read/write files in $HOME for dev work (flycheck & friends) resolves #1949
Wait, is there any way to turn this new feature off? It seems likely to lead to accidental impurities in docker based builds. |
It is true that this opens the door to dependence on the user's environment. On the other hand, nothing stack does should be dependent on this. A dependency should only really be added if something is really trying to add it. So anyway, I don't feel too strongly about adding a flag or not, just not sure how necessary it is. |
Gosh, it's hard to stay pure. You're right that the stack stuff should be pretty well isolated from home directory builds. I just worry that it compromises other software. However, since the user is basing their Having the homedir mounted sure is convenient for dropping into the image with |
@dysinger I know it's been 4 years, but what's the incantation for making flycheck use the --docker flag in a stack project ? |
I'm using emacs (spacemacs with the default 'haskell' & 'syntax-checker' layer in this case) which means flycheck w/ flycheck-haskell. While flycheck-haskell accounts for stack usage, it doesn't work for docker enabled stack projects.
flycheck-haskell expects to run
stack --verbosity silent runghc -- ....
on 2 files in the host's $HOME/.emacs.d/elpa/flycheck-haskell/ dir. Of course when you run this on a docker project your $HOME/.emacs.d dir is out of sight when stack runs. [I'll work with the flycheck project to fix this in a stack-friendly way that accounts for diving into the stack docker container. Like maybe putting the haskell files it needs in $PROJECT/.stack-work/flycheck-haskell or something.]flycheck-haskell also expects to write files in the temp dir before running stack. These files also disappear as soon as stack is called & it jumps into the container. Having the host's $TMPDIR mounted as the container's /tmp dir seems useful.
It's a tiny patch. It seems harmless. I've submitted a pull request. This solves part of the problem with flycheck-haskell in a way that's transparent to flycheck-haskell. (I don't have to ask them to change even more things for stack users.)
I do my work on Linux. How can I make the patch better for windows %TEMP_DIR% or Mac (if needed) ?
reference:
The text was updated successfully, but these errors were encountered: