-
-
Notifications
You must be signed in to change notification settings - Fork 401
Decouple the session loader into reader and writer over the cache #4445
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
soulomoon
wants to merge
85
commits into
haskell:master
Choose a base branch
from
soulomoon:batch-load-multi-read
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,204
−775
Draft
Changes from 81 commits
Commits
Show all changes
85 commits
Select commit
Hold shift + click to select a range
58b8b68
Refactor session loading to manage pending files so we can batch load…
soulomoon ea002d7
distribute errors to all pending files are being loading
soulomoon c78b197
better filter loading files
soulomoon b879375
fallback to non-batch load
soulomoon 8953aec
typo
soulomoon 4bdc2c8
update inline doc
soulomoon c4bb53a
update inline doc
soulomoon 112bc95
add LogSessionReloadOnError to log errors during file reloads; cleanu…
soulomoon 9a2aaf1
Merge branch 'master' into batch-load
soulomoon 6e04d28
refactor loadSessionWithOptions to improve error handling and clarify…
soulomoon 67aebc4
refactor loadSessionWithOptions to improve pending file handling and …
soulomoon 98ae446
add doc about limitation
soulomoon f3eb580
absolute file at the beginning
soulomoon e7bd3d4
run session loader and worker in sperate
soulomoon 1f97c40
cleanup
soulomoon 4c998bd
rename LogGetSessionRetry to LogLookupSessionCache for clarity in log…
soulomoon 79a43a0
extract attempt to load files from errors
soulomoon beb1764
refactor session loading to wait for pending files before cache check
soulomoon 6139522
add LogTime to logging for improved time tracking during session loading
soulomoon 7314509
refactor session loading to handle dependency checks more clearly
soulomoon cddcc55
Refactors session loading logic
soulomoon 4c99c47
Merge branch 'master' into batch-load-multi-read
soulomoon bb78a36
delay the restart
soulomoon 33f788c
Merge branch 'master' into batch-load-multi-read
soulomoon 0913d2e
Merge branch 'master' into batch-load-multi-read
soulomoon 58ec7ea
re-inline the old file instead of loading it twice
soulomoon 60e8427
Merge branch 'master' into batch-load-multi-read
soulomoon d943963
update upload artifact action version
soulomoon 5d01500
update hie-bios tag
soulomoon 10a6f7e
Update hie-bios tag to latest commit
soulomoon de6d5f3
Merge branch 'master' into batch-load-multi-read
soulomoon 45b1241
update hie-bios
soulomoon 219db46
update index-state to reflect the latest project state
soulomoon 2f86db0
update index-state to reflect the new date
soulomoon de98232
update fourmolu dependency version constraints
soulomoon f0a881d
remove ListT from library dependencies
soulomoon 14f6a3b
update hie-bios to a new tag
soulomoon 8b0e246
update fourmolu dependency version constraints to allow 0.16
soulomoon 2dd71c0
add allow-newer constraint for Cabal-syntax
soulomoon b8406d6
remove allow-newer constraint for Cabal-syntax
soulomoon 5ea3d87
bump actions/checkout and actions/upload-artifact to v3
soulomoon 3e0c27b
Revert "bump actions/checkout and actions/upload-artifact to v3"
soulomoon 8c27e34
add allow-older constraint for optparse-applicative in cabal.project
soulomoon bb0a541
Merge branch 'master' into batch-load-multi-read
soulomoon e491f60
Merge branch 'master' into batch-load-multi-read
soulomoon d5c2326
Merge branch 'master' into batch-load-multi-read
soulomoon 9efcb2e
Merge branch 'master' into batch-load-multi-read
soulomoon c883a09
Merge branch 'master' into batch-load-multi-read
soulomoon 9f9b8f7
Merge branch 'master' into batch-load-multi-read
soulomoon b0af634
update hie-bios
soulomoon 06fa5de
introduce SessionState
soulomoon 78e01a8
Merge branch 'master' into batch-load-multi-read
soulomoon 80d0160
update hiebois
soulomoon 24269f6
revert
soulomoon 98999f5
restart the shake if cabal file changed
soulomoon 21dd233
better error handling in session loader
soulomoon f140a2a
refactor error handling in loadSessionWithOptions to improve clarity …
soulomoon e339c1d
refactor SessionState management for improved batch loading logic
soulomoon 1425289
refactor session loading error handling for improved clarity and sepa…
soulomoon de6eb9c
cleanup
soulomoon db18100
Merge branch 'master' into batch-load-multi-read
soulomoon c9926d4
fix
soulomoon 48a46d1
add sessionLoadingPreferenceConfig var to SessionState
soulomoon 90e1df1
Merge branch 'master' into batch-load-multi-read
soulomoon 702e367
refactor SessionState to use Var instead of IORef for loaded and fail…
soulomoon 09213d3
simplified
soulomoon 4a78e6e
Merge branch 'master' into batch-load-multi-read
soulomoon 4cb5a70
Merge branch 'master' into batch-load-multi-read
soulomoon 005f573
Merge branch 'master' into batch-load-multi-read
soulomoon db8b1ac
Merge branch 'master' into batch-load-multi-read
soulomoon f768db0
Extract top-level functions for session initialisation
fendor a92ffb1
Merge branch 'master' into batch-load-multi-read
soulomoon d4fbc2c
Remove unused _removeInplacePackages function
fendor ff807c3
Introduce SessionM for bundling read-only variables
fendor 1aa1e2c
Extract ghc specific functions into separate module
fendor aff67c0
Merge remote-tracking branch 'upstream/master' into batch-load-multi-…
fendor 8957a42
Merge branch 'master' into batch-load-multi-read
soulomoon 7d106cf
fix duplication
soulomoon ddef7d4
Remove RTS options from multi-unit configuration files
soulomoon 3a4ddda
merge master
soulomoon d5632d6
format
soulomoon 4c5bc35
apply the patch from https://github.com/haskell/haskell-language-serv…
soulomoon d943452
add comments for orderedSet
soulomoon bd79156
update comments for orderedSet
soulomoon dc34df6
fix import
soulomoon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,3 @@ base | |
text | ||
-XHaskell98 | ||
A | ||
+RTS | ||
-A32M | ||
-RTS | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,5 +17,3 @@ a-1.0.0-inplace | |
base | ||
-XHaskell98 | ||
C | ||
+RTS | ||
-A32M |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
35 changes: 35 additions & 0 deletions
35
ghcide/session-loader/Development/IDE/Session/Dependency.hs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
module Development.IDE.Session.Dependency where | ||
Check warning on line 1 in ghcide/session-loader/Development/IDE/Session/Dependency.hs
|
||
|
||
import Control.Exception.Safe as Safe | ||
import Data.Either.Extra | ||
import qualified Data.Map.Strict as Map | ||
import Data.Time.Clock | ||
import System.Directory | ||
|
||
type DependencyInfo = Map.Map FilePath (Maybe UTCTime) | ||
|
||
-- | Check if any dependency has been modified lately. | ||
checkDependencyInfo :: DependencyInfo -> IO Bool | ||
checkDependencyInfo old_di = do | ||
di <- getDependencyInfo (Map.keys old_di) | ||
return (di == old_di) | ||
|
||
-- Note [Multi Cradle Dependency Info] | ||
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
-- Why do we implement our own file modification tracking here? | ||
-- The primary reason is that the custom caching logic is quite complicated and going into shake | ||
-- adds even more complexity and more indirection. I did try for about 5 hours to work out how to | ||
-- use shake rules rather than IO but eventually gave up. | ||
|
||
-- | Computes a mapping from a filepath to its latest modification date. | ||
-- See Note [Multi Cradle Dependency Info] why we do this ourselves instead | ||
-- of letting shake take care of it. | ||
getDependencyInfo :: [FilePath] -> IO DependencyInfo | ||
getDependencyInfo fs = Map.fromList <$> mapM do_one fs | ||
|
||
where | ||
safeTryIO :: IO a -> IO (Either IOException a) | ||
safeTryIO = Safe.try | ||
|
||
do_one :: FilePath -> IO (FilePath, Maybe UTCTime) | ||
do_one fp = (fp,) . eitherToMaybe <$> safeTryIO (getModificationTime fp) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.