-
Notifications
You must be signed in to change notification settings - Fork 711
Last step in cabal-nix sometimes takes a loooooooooong time #3019
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
Comments
.. rebooted machine, same problem. Started with a completely blank |
What commit ID? (I hope I didn't push a regression!) |
f8d8f85 . I haven't updated my nix branch in a while so I doubt it's your doing :) |
If you can, try strace'ing the process and see what it's churning on. |
Hmmm, that was a good suggestion.
and so on and so forth for lots of files. I have no idea what's going on, but if it's somehow trying to read all the blobs in the server So that leaves the question, why is it even looking at those files? My project file doesn't have a single wildcard:
|
I'm also somewhat confused by that |
The issue here is we need to track the files that are part of the package as specified by the .cabal file, not just look at all files in the package dir (as there can be lots of them like in this example and we don't want to hash them all). |
We know the previous mtime and content hash of lots of files, so reuse these content hashes when the file mtime is the same. Should fix issue #3019.
Actually there was another issue. We were not taking advantage of the fact that we know the previous content hashes when we're updating the file monitor state and so were re-hashing every time. Of course we only need to rehash if the mtime has changed. So now we do that. But for this specific example we do also need to be properly selective in which files we monitor. So I'll leave this open for that aspect. |
We know the previous mtime and content hash for all the files in the previous file set, so reuse these content hashes when we determine they are still valid (which is when the mtime is the same). This saves re-hashing files that have not changed. No test for this as such since it's a performance rather than correctness thing, but checked ad-hoc that the cache does get a perfect hit rate. Fixes one of two parts of issue haskell#3019.
We know the previous mtime and content hash for all the files in the previous file set, so reuse these content hashes when we determine they are still valid (which is when the mtime is the same). This saves re-hashing files that have not changed. No test for this as such since it's a performance rather than correctness thing, but checked ad-hoc that the cache does get a perfect hit rate. Fixes one of two parts of issue #3019.
We know the previous mtime and content hash for all the files in the previous file set, so reuse these content hashes when we determine they are still valid (which is when the mtime is the same). This saves re-hashing files that have not changed. No test for this as such since it's a performance rather than correctness thing, but checked ad-hoc that the cache does get a perfect hit rate. Fixes one of two parts of issue haskell#3019.
I can still confirm that this is a problem for me on latest nix-local-build branch. strace'ing Cabal shows it is statting things it has no business statting. |
There is an extra problem here, which is that if I'm edit anything in my package directory, nix-local-build will then decide that the package needs to be rebuilt, even if it's completely irrelevant to compilation. For example, I was dumping out build profiles, and Cabal kept deciding that packages needed to be rebuilt because this file had changed. |
Relevant code in ProjectBuilding (took me a while to find!!)
|
…al files Signed-off-by: Edward Z. Yang <[email protected]>
@edsko, I have a provisional fix for this problem, at least for non-Custom Setup scripts. I did this by piggy backing off of sdist: any files which would get sdisted, we'll track; any files which aren't, we don't track. There is one problem with this (as well as the previous code): if a user ADDs a new file which gets picked up on a search, the rebuilder won't notice. I don't think we can solve this problem without (1) duplicating all of the sdist code into cabal-install, rewritten to use the rebuild probing functions, or (2) dropping the rebuilder functionality into Cabal so that SrcDist can be written in the correct way. |
As a refactoring, this moves allPackageSourceFiles from Distribution.Client.Sandbox.Timestamp to Distribution.Client.SrcDist, makes it thread safe, and has it return files relative to the source directory. Signed-off-by: Edward Z. Yang <[email protected]>
As a refactoring, this moves allPackageSourceFiles from Distribution.Client.Sandbox.Timestamp to Distribution.Client.SrcDist, makes it thread safe, and has it return files relative to the source directory. Signed-off-by: Edward Z. Yang <[email protected]>
As a refactoring, this moves allPackageSourceFiles from Distribution.Client.Sandbox.Timestamp to Distribution.Client.SrcDist, makes it thread safe, and has it return files relative to the source directory. Signed-off-by: Edward Z. Yang <[email protected]>
As a refactoring, this moves allPackageSourceFiles from Distribution.Client.Sandbox.Timestamp to Distribution.Client.SrcDist, makes it thread safe, and has it return files relative to the source directory. Signed-off-by: Edward Z. Yang <[email protected]>
As a refactoring, this moves allPackageSourceFiles from Distribution.Client.Sandbox.Timestamp to Distribution.Client.SrcDist, makes it thread safe, and has it return files relative to the source directory. Signed-off-by: Edward Z. Yang <[email protected]>
Building
hackage-server
:and then.. nothing.. The
cabal-nix
process is using some 25% CPU at this point, and I have no idea what it's doing. That temp directory mentioned on the last line is already gone, so it's not just deleting. What it is doing is anyone's guess.. I CTRL-C'ed it after 12 minutes. Retried, same thing. Wipeddist-newbuild
, same thing. I've seen long times before but never something like this. No idea what's happening. Will reboot machine and see if that resolved anything. (Incidentally, I thought maybe it was busy waiting for thehackage-server
executable, but the server was not running at this point.)The text was updated successfully, but these errors were encountered: