Re: #16400: Hadrian: support shake's --lint-fsatrace feature

"GHC" <[email protected]> Thu, 07 Mar 2019 12:09:21 -0000
Newsgroups gmane.comp.lang.haskell.glasgow.bugs
Message-ID <[email protected]>
--===============6363594147599199688==
Content-Type: multipart/related;
 boundary="===============7796083476400439597=="

--===============7796083476400439597==
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit

#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:                    |
-------------------------------------+-------------------------------------
Description changed by davide:

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).

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:

 * [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?

--

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/16400#comment:2>