racket / racket/racket

Report offending file for invalid require

Open
#2,680 0 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature request
Dominant language
Racket
Stars
5.2k
Forks
698
Avg merge
18h 34m
Merged PRs (30d)
5

Description

It's always been a surprise to me that Racket only says that it couldn't require X, but doesn't say where X is required, making it difficult to find the problem and fix it.

E.g.,

;; a.rkt

#lang racket

(require "b.rkt")
;; b.rkt

#lang racket

(require "c.rkt")

(c.rkt doesn't exist)

Running a.rkt, I get:

../../Applications/Racket v7.3/share/pkgs/gui-lib/mred/private/snipfile.rkt:324:2: open-input-file: cannot open module file
  module path: c.rkt
  path: c.rkt
  system error: no such file or directory; rktio_err=3
  no package suggestions are available .

I expect that b.rkt shows up in the error message so that users know that it should be fixed there.

Contributor guide

Open the contributing guide

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 using the a.rkt, b.rkt, and missing c.rkt example, then inspect the reported error path at snipfile.rkt:324. Trace how the require of c.rkt is reported when it originates in b.rkt; done means the error identifies b.rkt as the offending requiring file.

Written by the indexing model from the issue text.

Assessment

Domain
developer-experience
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.