Repository navigation
Conversation
7176501 to
2759d1d
Compare
|
I may have missed something and I haven't looked through much of the code, but I must say that I think that we should really be aiming for a more stateless approach (over all) such as #2631 instead of trying to fix these state-induced bugs. I'm well aware that this may be controversial. It looks like some these commits could be useful on their own in terms of advancing the state of the code base independently of this partiular PR/Issue. Is that right? EDIT: Maybe file separate PRs for those? (Obviously, I don't have any authority on the project, I just wanted to offer my opinion. EDIT: Yes, I realize that you are a long-time contributor :)) |
Yes, I agree we should aim for statelessness to the degree possible, and that's what I'm really doing here. Let me elaborate on my philosophy of state. There are two sources of state, Cabal and the surrounding system (OS, GHC, foreign libraries, ...). The former should introduce as little state as possible. The latter is inherently stateful and we need to query that state from time to time. These queries are expensive, and the environment only changes slowly, so it is appropriate to cache these queries. Furthermore, it makes sense to build the cache of environment data up-front rather than on-the-fly: you may do work that is not required, but that's preferable to getting half-way through compilation to find that
Yes, I'm cleaning things up as I go along. |
|
Kewl! :) |
|
@ttuegel What's the status of this? I'm going to create the 1.24 branch soon, do you want this to go in? |
|
Yes, I think I can finish this over the weekend. |
|
Nice! |
d667137 to
e6a408a
Compare
The 'setup test' and 'setup bench' commands will now automatically build tests and benchmarks, if needed.
This moves some utilities for dealing with UserHooks into that module to avoid circular imports.
Fix the cabal-install build with Cabal's new reconfigure feature. Does not yet take advantage of it, just builds correctly.
Redundant imports were introduced by merge conflicts.
Redundant imports were introduced by merge conflicts.
It is not actually possible to determine which of the individual flags passed to `reconfigure` is responsible for triggering the reconfiguration.
The argument strings can be regenerated from the flag settings using `commandShowOptions`.
The short option `-f` conflicts with the flags to `configure`.
|
I can't have this finished in time for the next release; it requires more extensive changes to cabal-install than I previously believed. |
|
OK, noted. |
|
@ttuegel perhaps we should confer here on how to include these things in the nix-local-build branch. In that branch I do all the state tracking at the cabal-install level, so at the package level, nothing within Cabal at the component level. |
Which state tracking are we talking about? All this does is remember what arguments There is one thing holding me back from finishing this: I need to change |
|
@ttuegel |
|
Since this is self-marked as WIP, I'm going to close the PR for now. Please open a new one if you make more progress / need to RFC more stuff! |
This is a work-in-progress preview of my solution to #2214.
Already implemented:
configureindist/setup-config-argsin a version-independent way.setup reconfigure, that calls configure with the last arguments used. It can also take additional arguments andmappendthem to the command line.dist/setup-configis outdated,reconfigureis automatically called.setup testandsetup benchreconfigure and rebuild as necessary.Not yet implemented:
Again, this is a work-in-progess, please do not merge yet.