haskell / haskell/haskell-language-server

Potential Inconsistency from `resetInterfaceStore` with Stale Artifacts

Open
#4,697 1 comment 0 reactions 0 assignees View on GitHub
component: ghcide status: in discussion type: bug
Dominant language
Haskell
Stars
3k
Forks
455
Avg merge
3d 21h
Merged PRs (30d)
13

Description

When `resetInterfaceStore` is invoked, there is no session restart after resetting the GHC artifact’s `GetModificationTime`.
As a result, two different versions of the same artifact may be used within the same session:

1. The version loaded **before** `resetInterfaceStore`, version A.
2. The version loaded **after** `resetInterfaceStore`, version B.

This mismatch could potentially lead to inconsistencies or incorrect behavior, since the our build system may simultaneously rely on outdated and updated artifacts.

But there is no easy way to workaround this. The main point is that the rule `GetModificationTime` is seperated from the caller rule of `resetInterfaceStore`. The caller rule of `resetInterfaceStore` actually have much left to do. And we can not restart session here, otherwise the caller rule would end up in a loop since `resetInterfaceStore` would just be called again and we need to restart session again. Further, doing one session restart per GHC artifact is also not a workable choice:(

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing the caller of resetInterfaceStore and the separate GetModificationTime rule; the issue does not name files or tests. Determine how session restarts and GHC artifact versions interact, then define a way to prevent mixed versions without creating a restart loop or restarting once per artifact.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.