[GHC] #16400: Hadrian: support shake's --lint-fsatrace feature
GHC
ghc-devs at haskell.org
Thu Mar 7 17:19:55 UTC 2019
#16400: Hadrian: support shake's --lint-fsatrace feature
-------------------------------------+-------------------------------------
Reporter: davide | Owner: davide
Type: bug | Status: new
Priority: normal | Milestone:
Component: Build System | Version: 8.6.3
(Hadrian) | Keywords: lint shake
Resolution: | hadrian fsatrace
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Old description:
> Shake's `--lint-fsatrace` feature uses
> [https://github.com/jacereda/fsatrace fsatrace] to track file accesses of
> external commands. This allows for more accurate dependency linting which
> is important e.g. for caching.
>
> Hadrian already accepts the `--lint-fsatrace` command line option (it is
> passed on to shake automatically), but it currently has no effect. The
> shake options are not set correctly (In particular
> [https://github.com/jacereda/fsatrace shakeLintInside] must be set).
>
> Required Changes:
>
> * [https://github.com/jacereda/fsatrace shakeLintInside] must be set
> * Out of tree build dirs don't get linted.
> {{{
> buildRoot -/- "lint-test" %> \out ->
> let gen t f = cmd Shell "echo" t ">" (toNative f) :: Action ()
> gen "x" $ out <.> "txt"
> need [out <.> "txt"] -- This need should set off a lint error.
> writeFile' out ""
> }}}
> * fsatrace gives absolute paths. Shake then tries and fails to convert
> to relative paths
> [https://github.com/ndmitchell/shake/blob/master/src/Development/Shake/Command.hs#L148
> here]. Stuck with an unexpected absolute path, shake think the file isn't
> needed event thought the relative path **is** needed.
> * What else?
New description:
Shake's `--lint-fsatrace` feature uses
[https://github.com/jacereda/fsatrace fsatrace] to track file accesses of
external commands. This allows for more accurate dependency linting which
is important e.g. for caching.
Hadrian already accepts the `--lint-fsatrace` command line option (it is
passed on to shake automatically), but it currently has no effect. The
shake options are not set correctly (In particular
[https://github.com/jacereda/fsatrace shakeLintInside] must be set).
Required Changes:
1. [https://github.com/jacereda/fsatrace shakeLintInside] must be set
2. Out of tree build dirs don't get linted.
{{{
buildRoot -/- "lint-test" %> \out ->
let gen t f = cmd Shell "echo" t ">" (toNative f) :: Action ()
gen "x" $ out <.> "txt"
need [out <.> "txt"] -- This need should set off a lint error.
writeFile' out ""
}}}
* fsatrace gives absolute paths. Shake then tries and fails to convert
to relative paths
[https://github.com/ndmitchell/shake/blob/master/src/Development/Shake/Command.hs#L148
here]. Stuck with an unexpected absolute path, shake thinks the file isn't
needed even thought the relative path **is** needed.
3. What else?
--
Comment (by davide):
I've added a shake PR https://github.com/ndmitchell/shake/pull/656 (this
related to point 2 above).
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/16400#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list