Skip to content

Error while processing file from main-is in a certain project structure. #756

@typetetris

Description

@typetetris

If one has a project with a single executable and at least two modules and a cabal.project file, ghcide fails to process the file listed under main-is in the cabal file.

The error produced:

    ghcide version: 0.2.0 (GHC: 8.6.5) (PATH: /nix/store/f6hxh9b0679v0yl5amlmwcwfj21xm4rr-ghcide-0.2.0/bin/ghcide)
    Ghcide setup tester in <redacted>/minimal-example-c01.
    Report bugs at https://github.com/digital-asset/ghcide/issues

    Step 1/4: Finding files to test in <redacted>/minimal-example-c01
    Found 1 files

    Step 2/4: Looking for hie.yaml files that control setup
    Found 1 cradle

    Step 3/4: Initializing the IDE

    Step 4/4: Type checking the files
    [INFO] Consulting the cradle for "<redacted>/minimal-example-c01/src/Main.hs"
    > cabal: Unknown target '<redacted>/minimal-example-c01/src/Main.hs'.
    > The package minimal-example-c01 has no file target 'src/Main.hs'.
    >
    >
    File:     <redacted>/minimal-example-c01/src/Main.hs
    Hidden:   no
    Range:    1:0-100001:0
    Source:   compiler
    Severity: DsError
    Message:
      Failed to parse result of calling cabal

        cabal: Unknown target '<redacted>/minimal-example-c01/src/Main.hs'.
          The package minimal-example-c01 has no file target 'src/Main.hs'.




          Files that failed:
           * <redacted>/minimal-example-c01/src/Main.hs

           Completed (0 files worked, 1 file failed)

Example project: minimal-example-c01.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions