ocaml / ocaml/dune

RPC builds don't transfer warnings to the client

Open
#12,752 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

rpc
Dominant language
OCaml
Stars
1.9k
Forks
500
Avg merge
15h 21m
Merged PRs (30d)
277

Description

Expected Behavior

If there is a non-fatal warning during build, the RPC server should probably relay those warnings to the client, and the client shouldn't just say "Success!"

Actual Behavior

-w +26 means the warning is activated but non-fatal
-w @26 would mean it's activated and fatal
  $ echo "(executable (flags (-w +26)) (name foo))" > dune

  $ echo "let () = let x = 4 in ()" > foo.ml

  $ start_dune

We should see the warning here
  $ dune build
  Success

Modifying foo.ml to invalidate caches
  $ echo "let () = let x = 6 in ()" > foo.ml

We should also see the warning here
  $ dune rpc build
  Success

  $ stop_dune
  File "foo.ml", line 1, characters 13-14:
  1 | let () = let x = 4 in ()
                   ^
  Warning 26 [unused-var]: unused variable x.
  Success, waiting for filesystem changes...
  Success, waiting for filesystem changes...

Found while trying to make a cram test that would only trigger #12578.

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 running the cram reproducer with dune build and dune rpc build, focusing on how the RPC client reports build results and warnings. The change is done when a non-fatal Warning 26 from the shown foo.ml example is relayed to the client instead of reporting only Success.

Written by the indexing model from the issue text.

Assessment

Tech stack
ocaml
Domain
build-system
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.