Closed ndmitchell closed 8 years ago
This one is trickier, but https://github.com/jacereda/fsatrace/compare/stat seems to work properly on Darwin.
Linux version is even more ugly. I'll attempt Windows tomorrow.
I guess we need a flag to tell what ops you're interested in to reduce parsing cost.
Agreed, flags would be very useful.
I'm interested in such a tool, in my case stack build
takes 2.2 secs.
Writing it on top of the shake forward mode I added is trivial. I was going to have shake --forward -- stack build do it.
Can you try this one? https://github.com/jacereda/fsatrace/compare/file-args
For some reason the travis build gets stuck on Mac, I can't reproduce it here.
Some results:
C:\Neil\neil>cabal --version
cabal-install version 1.22.6.0
using version 1.22.4.0 of the Cabal library
C:\Neil\neil>fsatrace rwqmv - -- cabal --version
fsatrace.exe(8092): error: verbose
argv[0]=cabal
argv[1]=--version
cabal --version
cabal-install version 1.22.0.0
using version 1.22.0.0 of the Cabal library
C:\Neil\neil>fsatrace rwqmvv - -- cabal configure
fsatrace.exe(7668): error: verbose
argv[0]=cabal
argv[1]=configure
cabal configure
Fatal: win/utf8.c:9: l || !sl, err: 7a
fsatrace.exe(7668): error: command failed with code 777
argv[0]=cabal
argv[1]=configure
C:\Neil\neil>fsatrace rwqmv - -- cmd /c cabal build
fsatrace.exe(1704): error: verbose
argv[0]=cmd
argv[1]=/c
argv[2]=cabal
argv[3]=build
cmd /c cabal build
Building neil-0.10...
Preprocessing executable 'neil' for neil-0.10...
r|C:\Windows\Globalization\Sorting\SortDefault.nls
So:
cabal --version
gives different results whether I run it directly or via cmd. Any idea why that might be?cabal configure
fails in your utf8 stuff.The neil
directory is a checked out copy of https://github.com/ndmitchell/neil, but I have no reason to think that is particularly relevant.
What does this yield?
where cabal
fsatrace q - -- where cabal
As for invoking cabal via cmd, you probably want
fsatrace q - -- cmd /c "cabal build"
(Note the quotes)
I think I fixed the utf8 error.
C:\Neil>where cabal
C:\ghc\minghc-7.10.2-i386\bin\cabal.exe
C:\bin\cabal.exe
C:\Program Files (x86)\MinGHC-7.8.3\bin\cabal.exe
C:\Neil>fsatrace q - -- where cabal
where cabal
C:\ghc\minghc-7.10.2-i386\bin\cabal.exe
C:\bin\cabal.exe
C:\Program Files (x86)\MinGHC-7.8.3\bin\cabal.exe
I'll do some more digging tonight.
Is this one fixed?
Seemingly - both now give the same cabal version. Whether that is due to changes in fsatrace or the things on my PATH I don't really know... Sorry I totally forgot about this bug.
Good, closing.
Not sure if this is possible, but it would be good if fsatrace could write some information whenever a file had its modification time queried, something like q|filename. If this worked, then it would be very easy to speed up slow rebuild checkers, using Shake. For example, on my system
cabal build
takes 0.625s, but in certain circumstances,ghc --make
can take > 1 min. If you could runfsatrace - -- cabal build
, and then capture everything it reads and queries, and only rerun if any of that changes, you could reduce the rebuild time to 0.01s. The tool ghc-make already does that using custom logic forghc --make
, but withfsatrace
it could be totally generic and I could killghc-make
entirely.