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

Print previous errors if local module fails to load #2663

Merged
merged 1 commit into from
Feb 13, 2024
Merged

Conversation

martijnbastiaan
Copy link
Member

@martijnbastiaan martijnbastiaan commented Feb 8, 2024

Fixes #2365


Example of a new-style error message:

<no location info>: error:
    Other error:
    Failed to load module 'Bittide.Instances.Hitl.Tcl.ExtraProbes'.
    
    Tried to load it from precompiled sources, error was:
    
      Function Clash.Cores.Xilinx.Dna.dnaPorte2 was annotated with an inline primitive for Clash.Cores.Xilinx.DnaPorte.deviceDna.dnaPorte2. These names should be the same.
      CallStack (from HasCallStack):
        error, called at src-ghc/Clash/GHC/LoadInterfaceFiles.hs:482:5 in clash-ghc-1.9.0-inplace:Clash.GHC.LoadInterfaceFiles
    
    Tried to load it from local sources, error was:
    
      module ‘Bittide.Instances.Hitl.Tcl.ExtraProbes’ cannot be found locally

Instead of the old:

<no location info>: error:
    Other error: 
      module ‘Bittide.Instances.Hitl.Tcl.ExtraProbes’ cannot be found locally

Still TODO:

  • Write a changelog entry (see changelog/README.md)
  • Check copyright notices are up to date in edited files

:: Monad m
=> String
-> Data.Text.Text
-> (t -> r)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note for reviewers: there's a slight refactor in here. I've removed the (t -> r) argument. Is now handled by the caller.

Copy link
Contributor

@lmbollen lmbollen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM modulo simple comment

clash-ghc/src-ghc/Clash/GHC/LoadModules.hs Outdated Show resolved Hide resolved
Copy link
Member

@christiaanb christiaanb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@martijnbastiaan martijnbastiaan merged commit 2b76b07 into master Feb 13, 2024
10 checks passed
@martijnbastiaan martijnbastiaan deleted the fix-2365 branch February 13, 2024 15:39
mergify bot pushed a commit that referenced this pull request Feb 13, 2024
martijnbastiaan added a commit that referenced this pull request Feb 13, 2024
Fixes #2365

(cherry picked from commit 2b76b07)

Co-authored-by: Martijn Bastiaan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Non-sensical error message when failing to parse InlineYaml from precompiled module
3 participants