Skip to content

Fails to pass input to program via stdin when launching program with "dune exec" #11870

@mityu

Description

@mityu

Expected Behavior

"abc" is printed at the step 5 in the reproduce steps below.

Actual Behavior

Nothing is printed at the step 5 in the reproduce steps below.

Reproduction

  1. Create a new project directory for reproduce: dune init dune-repro
  2. Enter the project directory: cd dune-repro
  3. Change bin/main.ml to this:
    let () = print_endline @@ read_line ()
  4. dune exec dune-repro
  5. Type abc<Enter> (where the <Enter> means the enter key)

Specifications

  • Version of dune (output of dune --version): 3.19.0
  • Version of ocaml (output of ocamlc --version): 5.3.0
  • Operating system (distribution and version): macOS 15.4.1
  • Shell: bash 5.2.37
    GNU bash, version 5.2.37(1)-release (aarch64-apple-darwin23.4.0)
    Copyright (C) 2022 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
    
    This is free software; you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.
    

Additional information

  • If you run the binary directly from the shell, this bug does not happen: ./_build/install/default/bin/dune-repro
  • This bug is not reproducible with dune 3.18.2.
    • When I tried this, I modified the dune-project file in order to run this project with older dune:
      diff --git a/dune-project b/dune-project
      index 7caa58a..a2241c1 100644
      --- a/dune-project
      +++ b/dune-project
      @@ -1,4 +1,4 @@
      -(lang dune 3.19)
      +(lang dune 3.18)
      
       (name dune-repro)
  • As far as I bisected, this bug is introduced in this commit: 6fa1f6e

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions