ocaml / ocaml/dune

[RFC] Compiler warnings DSL

Open
#1,933 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

proposal
Dominant language
OCaml
Stars
1.9k
Forks
500
Avg merge
15h 17m
Merged PRs (30d)
287

Description

Hi,

The OCaml compilers have several options to control what warnings are active, and which ones are fatal.

However, it's a bit difficult to remember all the details:

  • how do -w and -warn-error interact
  • what happens when -w or -warn-error is passed several times
  • what do numbers mean
  • what do letters mean, including uppercase and lowercase

This can be eased by adding a DSL that's available in places where (flags) is accepted:

(warnings
 (enabled ..)
 (disabled ...)
 (fatal ...))

Exact syntax & semantics are to be discussed, but the general idea is to convert this into a flag that will be combined with the rest of the command line.

cc @rgrinberg

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

Start by reviewing Dune's handling of (flags) and the OCaml compiler options -w and -warn-error; the issue names no files or tests. Done means agreeing on syntax and semantics for enabled, disabled, and fatal warnings and converting the DSL into a combined command-line flag.

Written by the indexing model from the issue text.

Assessment

Tech stack
ocaml
Domain
build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.