Skip to content

Check if allUnits <> preloadUnits includes all units in ModuleGraph. #351

Description

@Saizan

We want to find all units the debuggee is composed of or depends on for two reasons:

  1. Explicitly expose them for the interactive unit, so imports are resolved to the same unitId the debuggee is compiled against.
  2. Find out if and what subset of haskell-debugger-view we need to compile in memory.

Currently we do it (in graphUnits) by listing all UnitIds we can find in ModuleGraph, however this misses dependencies of units with only ModuleNodeFixed modules, as no downsweep is needed for those and so no UnitNode is created.

Each home unit comes with a preloadUnits :: [UnitId] field (in its UnitState in HomeUnitEnv) which is implemented as the transitive closure of its dependencies, this is true also for the units with only Fixed modules.

If we can rely on that it seems we could avoid traversing the ModuleGraph at all, whose size will generally exceed the one of HomeUnitGraph.

Be sure to test with a wide variety of project structures.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions