Re-run pre-build rules when necessary#4923
Conversation
| -- Use a version of Cabal that writes the pre-build rule manifest. | ||
| -- | ||
| -- TODO: remove this. | ||
| source-repository-package | ||
| type: git | ||
| location: https://github.com/sheaf/cabal.git | ||
| subdir: Cabal-syntax Cabal Cabal-hooks | ||
| tag: 2a320cac93255683829768517ceadcd25cbf8f11 |
There was a problem hiding this comment.
I need to pin the Cabal version for the tests to ensure the pre-build rule manifest file is being written. I'm not sure whether there's a better way to do this? We need to guarantee we use the right Cabal library when compiling SetupHooks (or defaultMainWithSetupHooks setupHooks if we are falling back to the Setup CLI, e.g. because of an old cabal-install that is incompatible with this newer version of the Cabal library).
The fact that we need to compile SetupHooks against this version of Cabal also means the test is a bit slow to run as it needs to build Cabal-syntax, Cabal and Cabal-hooks.
There was a problem hiding this comment.
We can run this test only if we can ensure the cabal-install version is recent enough and then ensure in CI the cabal version is new :)
|
Failing on Windows with MAX_PATH issues: Not sure why the test is hanging on Linux, I will investigate tomorrow. |
Some tests run into the Windows MAX_PATH restriction, in particular when git operations are involved in a nested subdirectory.
This adds a new 'globWatchers' alongside the 'filesMap' for watching glob patterns. This is used for cradle dependencies, so that HLS reloads the cradle when these change. The intended usage is to allow HLS to re-run the Cabal pre-build stage when dependent files are modified, in particular with build-type: Hooks and pre-build rules (but that part is left to a separate commit).
|
I ran the Hooks tests locally on Linux and they worked fine. I think it's just that the timeout needed increasing. For Windows, I added a patch that lifts the maximum path length restriction in CI, but I'm not sure whether that's the way we want to proceed given that we might deliberately want to not set that so that we can detect bugs that users who haven't lifted the MAX_PATH restriction might run into. We're only running into it due to the |
HLS now reads the pre-build rule monitor manifest file to determine which files and file globs to monitor in order to detect when to re-run pre-build rules.
Companion to Cabal PR #11776.
This PR allow HLS to re-run pre-build rules when needed. That is, when either:
The existing logic in
Cabalhandles recompilation logic and only re-runs rules that are stale. See Cabal PR #11731 for more information on pre-build rule staleness.