[GHC] #16295: Enable cached builds with Hadrian
#16295: Enable cached builds with Hadrian -------------------------------------+------------------------------------- Reporter: snowleopard | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Build System | Version: 8.6.3 (Hadrian) | Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- As Neil is working on turning Shake into Cloud Shake [1], Shake has got a new feature of "locally cached builds", making it possible to reuse build artefacts from previous builds on the same machine. This means, in particular, that a clean build could be finished very quickly if you've built GHC before from the same/similar sources. Hopefully, this could also help us speed up GHC's CI some day. To enable cached builds, it is important to find and fix all instances of untracked dependencies in Hadrian, or at least record them using the `produces` feature of Shake [2], because otherwise Shake has no idea that these files are actually needed and should therefore be stored in the cache. Here are a couple of tickets related to untracked dependencies: https://ghc.haskell.org/trac/ghc/ticket/16271 https://ghc.haskell.org/trac/ghc/ticket/16272 I am currently working this and hope to produce a patch soon. [1] See the Build Systems à la Carte paper: https://dl.acm.org/ft_gateway.cfm?id=3236774 [2] http://hackage.haskell.org/package/shake/docs/Development- Shake.html#v:produces -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/16295> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#16295: Enable cached builds with Hadrian -------------------------------------+------------------------------------- Reporter: snowleopard | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Build System | Version: 8.6.3 (Hadrian) | Resolution: | Keywords: 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 snowleopard: Old description:
As Neil is working on turning Shake into Cloud Shake [1], Shake has got a new feature of "locally cached builds", making it possible to reuse build artefacts from previous builds on the same machine. This means, in particular, that a clean build could be finished very quickly if you've built GHC before from the same/similar sources. Hopefully, this could also help us speed up GHC's CI some day.
To enable cached builds, it is important to find and fix all instances of untracked dependencies in Hadrian, or at least record them using the `produces` feature of Shake [2], because otherwise Shake has no idea that these files are actually needed and should therefore be stored in the cache. Here are a couple of tickets related to untracked dependencies:
https://ghc.haskell.org/trac/ghc/ticket/16271 https://ghc.haskell.org/trac/ghc/ticket/16272
I am currently working this and hope to produce a patch soon.
[1] See the Build Systems à la Carte paper: https://dl.acm.org/ft_gateway.cfm?id=3236774
[2] http://hackage.haskell.org/package/shake/docs/Development- Shake.html#v:produces
New description: As Neil is working on turning Shake into Cloud Shake [1], Shake has got a new feature of "locally cached builds", making it possible to reuse build artefacts from previous builds on the same machine. This means, in particular, that a clean build could be finished very quickly if you've built GHC before from the same/similar sources. Hopefully, this could also help us speed up GHC's CI some day. To enable cached builds, it is important to find and fix all instances of untracked dependencies in Hadrian, or at least record them using the `produces` feature of Shake [2], because otherwise Shake has no idea that these files are actually needed and should therefore be stored in the cache. Here are a couple of tickets related to untracked dependencies: https://ghc.haskell.org/trac/ghc/ticket/16271 https://ghc.haskell.org/trac/ghc/ticket/16272 I am currently working this and hope to produce a patch soon. I marked this is a "bug", not a "feature request", since untracked dependencies are bugs, and they prevent us from using Shake's shiny new feature. [1] See the Build Systems à la Carte paper: https://dl.acm.org/ft_gateway.cfm?id=3236774 [2] http://hackage.haskell.org/package/shake/docs/Development- Shake.html#v:produces -- -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/16295#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#16295: Enable cached builds with Hadrian -------------------------------------+------------------------------------- Reporter: snowleopard | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Build System | Version: 8.6.3 (Hadrian) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Marge Bot <ben+marge-bot@…>): In [changeset:"1dad4fc27ea128a11ba0077f459494c2a1ca0d5c/ghc" 1dad4fc2/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="1dad4fc27ea128a11ba0077f459494c2a1ca0d5c" Hadrian: Fix untracked dependencies This is a preparation for #16295: https://ghc.haskell.org/trac/ghc/ticket/16295 This commit mostly focuses on getting rid of untracked dependencies, which prevent Shake's new `--shared` feature from appropriately caching build rules. There are three different solutions to untracked dependencies: * Track them! This is the obvious and the best approach, but in some situations we cannot use it, for example, because a build rule creates files whose names are not known statically and hence cannot be specified as the rule's outputs. * Use Shake's `produces` to record outputs dynamically, within the rule. * Use Shake's `historyDisable` to disable caching for a particular build rule. We currently use this approach only for `ghc-pkg` which mutates the package database and the file `package.cache`. These two tickets are fixed as the result: Ticket #16271: https://ghc.haskell.org/trac/ghc/ticket/16271 Ticket #16272: https://ghc.haskell.org/trac/ghc/ticket/16272 (this one is fixed only partially: we correctly record the dependency, but we still copy files into the RTS build tree). }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/16295#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC