Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Env stanza: warn if some rules are ignored #5898

Merged
merged 1 commit into from
Jul 20, 2022

Conversation

emillon
Copy link
Collaborator

@emillon emillon commented Jun 20, 2022

Since matching is sequential, anything after _ cannot be reached.

Closes #5886

@emillon emillon requested a review from rgrinberg June 20, 2022 15:32
@emillon
Copy link
Collaborator Author

emillon commented Jun 20, 2022

Some questions:

  • should this be an error instead?
  • should we try to have better locs for these warnings?

@Alizter
Copy link
Collaborator

Alizter commented Jun 20, 2022

Is there any use case for ignoring this warning? If not then it should be an error no?

@emillon
Copy link
Collaborator Author

emillon commented Jun 21, 2022

Right. A possibility is to make that a warning for all versions, which is fatal for >= 3.4.

src/dune_rules/dune_env.ml Outdated Show resolved Hide resolved
@emillon emillon force-pushed the env-warn-unreachable-rules branch 2 times, most recently from 4412b70 to d8d61d8 Compare June 28, 2022 15:13
@emillon emillon force-pushed the env-warn-unreachable-rules branch from d8d61d8 to 4413bdb Compare July 4, 2022 12:05
@emillon emillon force-pushed the env-warn-unreachable-rules branch from 51e437a to e0802f7 Compare July 12, 2022 09:28
@hhugo
Copy link
Collaborator

hhugo commented Jul 20, 2022

Can we land this in 3.4 ?

@emillon emillon added this to the 3.4.0 milestone Jul 20, 2022
@emillon emillon force-pushed the env-warn-unreachable-rules branch from e0802f7 to 10087d7 Compare July 20, 2022 08:54
Copy link
Collaborator

@voodoos voodoos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me.

src/dune_rules/dune_env.ml Outdated Show resolved Hide resolved
Since matching is sequential, anything after `_` cannot be reached.
This warning is fatal in 3.4.

Closes ocaml#5886

Signed-off-by: Etienne Millon <[email protected]>
@emillon emillon force-pushed the env-warn-unreachable-rules branch from 10087d7 to a7e4082 Compare July 20, 2022 09:58
@emillon emillon merged commit c6e2773 into ocaml:main Jul 20, 2022
@emillon emillon deleted the env-warn-unreachable-rules branch July 20, 2022 10:05
emillon added a commit to emillon/opam-repository that referenced this pull request Jul 20, 2022
…ne-site, dune-rpc, dune-rpc-lwt, dune-private-libs, dune-glob, dune-configurator, dune-build-info, dune-action-plugin and chrome-trace (3.4.0)

CHANGES:

- Make `dune describe` correctly handle overlapping implementations
  for virtual libraries (ocaml/dune#5971, fixes ocaml/dune#5747, @esope)

- Building the `@check` alias should make sure the libraries and executables
  don't have dependency cycles (ocaml/dune#5892, @rgrinberg)

- [ctypes] Add support for the `errno` parameter using the `errno_policy` field
  in the ctypes settings. (ocaml/dune#5827, @droyo)

- Fix `dune coq top` when it is invoked on files from a subdirectory of the
  directory containing the associated stanza (ocaml/dune#5784, fixes ocaml/dune#5552, @ejgallego,
  @rlepigre, @Alizter)

- Fix hint when an invalid module name is found. (ocaml/dune#5922, fixes ocaml/dune#5273, @emillon)

- The `(cat)` action now supports several files. (ocaml/dune#5928, fixes ocaml/dune#5795, @emillon)

- Dune no longer uses shimmed `META` files for OCaml 5.x, solely using the ones
  installed by the compiler. (ocaml/dune#5916, @dra27)

- Fix handling of the `(deps)` field in `(test)` stanzas when there is an
  `.expected` file. (ocaml/dune#5952, ocaml/dune#5951, fixes ocaml/dune#5950, @emillon)

- Ignore insignificant filesystem events. This stops RPC in watch mode from
  flashing errors on insignificant file system events such as changes in the
  `.git/` directory. (ocaml/dune#5953, @rgrinberg)

- Fix parsing more error messages emitted by the OCaml compiler. In
  particular, messages where the excerpt line number started with a blank
  character were skipped. (ocaml/dune#5981, @rgrinberg)

- env stanza: warn if some rules are ignored because they appear after a
  wildcard rule. (ocaml/dune#5898, fixes ocaml/dune#5886, @emillon)

- On Windows, XDG_CACHE_HOME is taken to be the `FOLDERID_InternetCache` if
  unset, and XDG_CONFIG_HOME and XDG_DATA_HOME are both taken to be
  `FOLDERID_LocalAppData` if unset.  (ocaml/dune#5943, fixes ocaml/dune#5808, @nojb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dune should complain if it find "deadcode" in the env stanza
4 participants