Build system CLI: behavior that disagrees with the help text

Abierto
#9,242 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@cknitt ya está trabajando en esto.

Desde el 6/11/2026.

  • #9248 de @cknitt — abierto

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
43/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
ocaml
Área
cli

Línea de trabajo

Start with the listed entry points in rewatch-ocaml/: build.ml, build_report.ml, rescript_ocaml.ml, after_build.ml, project_context.ml, cli.ml, and compiler_args_command.ml. Reproduce each behavior with ReScript 13.0.0-alpha.8 and trace its command handling and diagnostics. Done means the reported mismatches are corrected consistently; the issue does not name tests to run.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

CLI behavior that disagrees with the help text or with common conventions. All reproduce with rescript 13.0.0-alpha.8 (found while reviewing #9238); paths are in rewatch-ocaml/.

  • --no-timing prints zero timings instead of none. In a terminal, rescript build -n prints Parsed 1 source files in 0.00s … Finished compilation in 0.00s. The times are zeroed (build.ml:305, build_report.ml:79, :108) instead of left out.
  • watch exits 0 when interrupted. rescript watch, then SIGINT or SIGTERM: prints Exiting..., exit 0. rescript watch --help says 129-143 when interrupted by a signal. rescript_ocaml.ml:84 maps Watcher.Stop to 0.
  • --after-build does not use a shell. rescript build --after-build 'echo hi; exit 3' prints hi; exit 3 and exits 0; quotes are passed literally ('echo "a b" c' prints "a b" c). after_build.ml:5 splits on whitespace. Either run the command through the shell or document that it is split on whitespace.
  • A missing dependency is a usage error and blocks clean. With "dependencies": ["missing-dep"] and nothing installed, both rescript build and rescript clean print Could not build package tree reading dependency 'missing-dep' at path '<project root>'. Error: Could not resolve dependency missing-dep and exit 2, the code for command-line usage errors. clean deletes nothing. The "at path" is the requesting project, not the dependency. (project_context.ml:169-173, rescript_ocaml.ml:73-76)
  • An unknown subcommand is reported as a lockfile problem. rescript bogus prints Could not start Rescript build: Could not write lockfile because the specified project folder does not exist: bogus, exit 1. A bare word is taken as the build folder (normalize_argv in cli.ml); the message should say that neither a command nor a folder of that name exists.
  • Invalid --features and --warn-error values are accepted silently. rescript build --features nope and rescript build --warn-error zzz exit 0 without a diagnostic; zzz is ignored (cli.ml:63-80 and the --warn-error option).
  • Some usage errors lack the Usage: line. rescript -v -q (rescript: --verbose cannot be used together with --quiet) and rescript format -c -s .res (rescript: --stdin conflicts with --check) exit 2 without it, unlike rescript build --unknown-option; they use Term.term_result without ~usage:true (cli.ml:42-47, :192-196). rescript compiler-args rescript.json prints compiler-args expects a .res or .resi source file without the rescript: prefix and exits 1 (compiler_args_command.ml:50).
  • -h and -V are undocumented. Both work, but rescript --help lists only --help[=FMT] and --version: cli.ml:286-336 rewrites them before Cmdliner sees them.
Lenguaje dominante
OCaml
Estrellas
7.5k
Forks
485
Merge medio
16 h 51 min
PR fusionados (30 d)
268

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de rescript-lang/rescript

Todos los issues de rescript-lang/rescript

Issues similares

Más issues de CLI

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.