-
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
Provide an option to configure the location .stack-work
directory
#1178
Comments
You can set the |
~/.stack
and .stack-work
directories.stack-work
directory
I don't think overriding |
Thanks for the |
I would also like to see this implemented. My use case is that I need to produce two build flavors: with and without hpc. The best way (for incremental compilation) to do this is to build them in two different build trees. I plan to work around this for now by making |
In case nobody is doing this already, I try could to implement the feature (once my current PR is merged). We could make |
Shouldn't this be passed on the command line? Programming using environment variables is very error-prone: if you make a typo in the environment variable name nothing will catch the error |
@Gabriel439 Good point, this makes more sense as a commandline argument, since it's probably something local to your current build. @mrkkrp Feel free to add this! |
Addition of ‘--work-dir’ option to override working directory, #1178
@Gabriel439, @feuerbach, this is solved now. You can add Here is the PR: #1442. @mgsloan, Looks like this may be closed. |
@mrkkrp Thanks for implementing this! |
Thank you! This is fantastic :) |
Brilliant! |
Thanks for providing this option. Is there a specific why it is not possible to pass an absolute directory? |
@abailly, It's mainly because of |
Here is a short description of my usage:
Plus, supporting both absolute and relative paths seems rather more common than supporting only one type of paths. I can provide a PR if that makes sense to you. |
Another reason it has to be a relative directory is that there is a separate |
My use case is basically: I have a bunch of packages I'm developing in tandem, where some are libraries and some are applications that depend on the libraries. I'd like to share the build artifacts between them so that changes in library A only have to be rebuilt once, rather than many times for libraries P Q R and applications X Y Z that depend on library A. So I figured I'd just use the parent directory of packages A-Z for .stack-work, but got:
(and of course the same setting it in stack.yaml) |
Aha! It looks like my use case is well covered by placing a stack.yaml in the parent directory and using the STACK_YAML environment variable. Great! : ) |
I see a very strange behavior here. I'm using |
@wdanilo Yes, it's an unfortunate compromise due to cabal or ghc's behavior on windows. It doesn't need to act like this, but we'd need to change some paths and add some special cases for non-windows (and potentially special cases based on cabal / ghc version if it's fixed in newer versions). See the discussion in this issue or #1731 for more info. Feel free to take on implementation. It hasn't been a priority for us, because it hasn't affected our usage of stack. We'd also prefer to have things behave the same on windows, but directory compatibility is already gone due to the usage of SHAs to keep the dirs shorter to avoid MAX_PATH. |
@mgsloan: Oh, I'm sorry for the confusion! I've overlooked the #1731 and I just saw the "closed" label next to the reference to this ticket on the bottom, which consequently made me wrongly believe it is closed too. We will definitively send you the alpha! We haven't released it yet to anybody. I was planning to write an email to you on monday regarding few things, including the alpha :) |
@mgsloan sorry for writing here, but I was not able to catch you any other way - have you seen mails from me? I've sent 2 over the last 3 weeks - regarding the alpha software :) |
@wdanilo Woops sorry about the delay. Looking forward to trying it out! |
Right now I'm working on implementing a Haskell plugin for Twitter's build tool,
pants
, and one thing we'd like to have is the ability to configure the location of the~/.stack
and.stack-work
directories under directories managed by thepants
tool.If this is already possible, just let me know, but the last time I checked I couldn't figure out how to do this.
The text was updated successfully, but these errors were encountered: