-
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
Avoid rebuilding "sandbox" when profiling options turned off #1132
Comments
This might be the same issue as #1102. |
Looks the same to me. I have the same issue; I'm posting slightly more thoughts at #1102. |
Yes, this issue describes the same case as in #1102 bot the former is closed. Should I close this issue as well? And what is the funal answer? Will issue be fixed, or actual behaviour is considered correct? |
Have you tried stack-0.1.6.0? It now has settings that control when command-line flag changes trigger recompiles, and the defaults for those new settings are for it to default to not rebuilding when command-line flags change. |
I have similar issue, but in my case stack rebuilds packages OpenGLRaw, sdl2, parsec3-numbers. And it does that sometimes when I run
|
Same exact issue as @pakanek, same exact version. I am in fact even building some of the same libraries(OpenGLRaw), which is taking forever on my machine, and it results in a horrible, really frustrating experience with profiling. Why aren't copies of libraries with profiling and without kept around when switching between profiling and no profiling? Am I correct in assuming that would make the build times more tolerable? Moreover, I don't remember having a similar issue when just using vanilla cabal. If I remember correctly, the issue with cabal and profiling was that you'd have to recompile everything once once you enabled profiling, but not constantly, over and over again. Additionally, if you wanted only to profile your own code, you could just enable profiling for your own code. This is basically exactly what I want in my case. I don't really care about the performance of gloss(which is what is being recompiled constantly), so I don't want to enable profiling for gloss. In a vain attempt to fix this issue, I just did a huge refactor, such that all the code I want to I am really not sure if the behavior I expect is unreasonable, but I would like to know if either a) it is possible to make this experience more tolerable with stack as-is or b) if it is something that should However, I do believe there is at least one real issue for which I can submit an actual issue if someone If you enable profiling for your project, build it, and then run EDIT: I just realized that the packages that I keep having to recompile every time are extra-deps. Is it correct that the behavior wrt. profiling is different for extra-deps? |
This is the current expected behaviour. My proposal in #1265 would fix it for extra-deps (by making them act just like snapshots), but wouldn't change the behaviour for regular local packages. I think it would be possible to fix for regular local packages as well. It should be possible to have profiling flags treated specially, and not trigger rebuilds unless actually necessary. The rules might go something like this (assuming no source code or other flags changed between builds):
I haven't really thought about how library profiling vs. executable profiling would fit in here, but I think the basic principle would hold. @snoyberg: does this seem feasible to you? |
Yes, it's feasible. I think in some of the predecessor tools to Stack, we On Mon, Nov 2, 2015 at 3:05 PM, Emanuel Borsboom [email protected]
|
Note that #1265 is now closed, but the way it was implemented means this issue is still not fixed. The reason given in #1265 for not caching extra-deps was that it could lead to too much disk usage. For my purposes, just having two caches -- indexed by flags -- would be sufficient: the most recent non-profiling build and the most-recent profiling build. A more general version could have a conflig setting for how many caches to keep, but two is enough for the common case of speeding up the change between profiling and non-profiling builds. |
This may be mentioned in one of the duplicate tickets, but I think the
for profiling builds and
for non-profiling builds, then the builds don't conflict/invalidate each other. |
@ntc2 nice work-around! Thanks! |
Looks like this will be resolved by #4032, which is currently under development. Closing this as a duplicate. |
Hello, I have an issue. Steps to reproduce:
cd myproject
stack build --library-profiling --executable-profiling
to build "sandbox" andmyproject
with profiling optionsstack build
Expected behaviour:
Reconfigure
myproject
and rebuild it without profiling options likecabal clean && cabal configure && cabal build
would.Actual behaviour:
Stack rebuilds all "sandbox" without profiling options which takes a lot of time.
Use case: when testing
myproject
runtime error occures and developer want to see a stacktrace (which requires profiling options). He/she rebuilds project (with "sandbox") with profiling options, fixes issue and turns profiling options off (to speed up compilation).The text was updated successfully, but these errors were encountered: