ndmitchell / ndmitchell/hlint

#error in source file causes hlint toprint stack trace

Open
#371 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Haskell
Stars
1.6k
Forks
210
PR merge metrics
No merged PRs in 30d

Description

In this source file, we have:

#ifndef PROJECTM36_VERSION
#error PROJECTM36_VERSION is not defined
#endif

The version is passed in via cabal configuration so that the versioning is centralized. However, hlint actually gives up because of this:

hlint: #error PROJECTM36_VERSION is not defined
in src/bin/TutorialD/tutd.hs  at line 75 col 1
CallStack (from HasCallStack):
  error, called at ./Language/Preprocessor/Cpphs/CppIfdef.hs:113:21 in cpphs-1.20.8-JLeLxWRxjmm1BBYuZIZezR:Language.Preprocessor.Cpphs.CppIfdef

In this case, I can tack on --cpp-define PROJECTM36_VERSION=0.1, but it would be nice if this looked less like a crash and included a tip on how to resolve it.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with hlint on src/bin/TutorialD/tutd.hs, including the #error at lines 74-76, and compare it with --cpp-define PROJECTM36_VERSION=0.1. Start by tracing the reported CppIfdef.hs stack frame. Done means an undefined #error is reported without a stack trace and includes guidance for resolving the missing definition.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
cli, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.