Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 5.5k
    • Issues 5.5k
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 635
    • Merge requests 635
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Model experiments
  • Analytics
    • Analytics
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #17761

An exceptionfree readFile or filtering for -xc

Motivation

In order to reduce the amount of lines in the logs that are false positives, I'd like to have a version of base's readFile that does not log exceptions. The current readFile uses ioe_eof (IIRC) to exit, and this means that if you run with +RTS -xc -RTS, an error is output to the logs.

To get past this I created a library called exceptionfree-readfile (suggestions/issues/PRs welcome, perf is 1x-10x worse than the code in base), but it was mentioned that I should submit this to the issue tracker to see if there's another way people work around it/a better way.

Alternatively a way to filter the modules that are captured by -xc would be much easier way to solve this problem -- as my goal was reducing the amount of false positives that showed up in the logs (a few libraries use exceptions in this way).

Related links/background:

  • Original r/haskell ask comment
  • r/haskell ANN thread

Proposal (2 alternatives)

Updating base with a readFileEither

A function called readFileEither :: FilePath -> IO (Either IOError String) is created and added to base

Adding an option like --xc-ignored-modules to GHC

An option like --xc-ignored-modules is added that contains a list of modules that are checked when -xc-related logging is done, to ignore certain modules.

Edited Jan 29, 2020 by Victor Adossi
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking