Skip to content
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

Batch loader to better support laoding of multiple home units at once #440

Open
soulomoon opened this issue Sep 25, 2024 · 1 comment
Open

Comments

@soulomoon
Copy link

soulomoon commented Sep 25, 2024

Originates from haskell/haskell-language-server#4381
Batch loading api is needed for performance.
I assume something like this:

loadCradles ::  [FilePath] -> IO [(Cradle Void, [FilePath])]
-- CradleAction
runCradleMultiFiles :: [FilePath] -> LoadStyle -> IO (CradleLoadResult ComponentOptionsMultiResult)
@soulomoon
Copy link
Author

soulomoon commented Oct 21, 2024

The current status for a single file:

  1. find the cradle location for a file.
  2. load hie.yaml or implicit one as cradle config.
  3. resolve cradle config for the file to get theCradle. (Only here we know what build tools are used for the file)
  4. runCradle to run the cradleAction in Cradle and obtain the argumentsghc needed to compile the file

Since only cabal cradle can do batch load. (Multiple cabal files?)
To minimize changes need to be made, internal changes need to be made to cabalActions.
Because we need to merge multiple cabalAction. Current implementation is not possible.

Then the batch load workflow can be:

  • For each file
    • find the cradle location
    • load the hie.yaml to cradle config
    • resolve to get Cradle for the file.
  • Merge the Cabal cradles, leave others.
  • runCradle for each batch of files

@soulomoon soulomoon mentioned this issue Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant