Skip to content

Re-raised at Stdune__exn.raise_with_backtrace in file "src/stdune/exn.ml" with stdio.v0.14.0 and dune.2.9.0 #5028

@shakthimaan

Description

@shakthimaan

Expected Behavior

Clean build of stdio.v0.14.0 with OCaml 4.14.0+trunk and dune.2.9.0 (or dune.2.9.1) with Sandmark.

Actual Behavior

# File "src/stdio.ml", line 5, characters 21-32:
# 5 | module Out_channel = Out_channel
#                          ^^^^^^^^^^^
# Alert deprecated: module Base.Out_channel
# [2016-09] this element comes from the stdlib distributed with OCaml.
# Referring to the stdlib directly is discouraged by Base. You should either
# use the equivalent functionality offered by Base, or if you really want to
# refer to the stdlib, use Caml.Out_channel instead
# File "src/stdio.ml", line 11, characters 20-39:
# 11 | let eprintf       = Out_channel.eprintf
#                          ^^^^^^^^^^^^^^^^^^^
# Error: Unbound value Out_channel.eprintf

Tried the following patch changes to stdio.v0.14.0:

diff --git a/dune-project b/dune-project
index eb10bcb..c2e4660 100644
--- a/dune-project
+++ b/dune-project
@@ -1 +1 @@
-(lang dune 1.10)
\ No newline at end of file
+(lang dune 2.8)
diff --git a/src/dune b/src/dune
index dc5a9e2..90cae31 100644
--- a/src/dune
+++ b/src/dune
@@ -1,5 +1,6 @@
 (library (name stdio) (public_name stdio) (libraries base base.caml)
  (preprocess no_preprocessing)
+ (root_module Root)
  (lint
   (pps ppx_base -check-doc-comments -type-conv-keep-w32=impl
-   -apply=js_style,type_conv)))
\ No newline at end of file
+   -apply=js_style,type_conv)))
diff --git a/src/stdio.ml b/src/stdio.ml
index b33f377..c78bb1f 100644
--- a/src/stdio.ml
+++ b/src/stdio.ml
@@ -2,7 +2,7 @@ open! Base
 open! Import
 
 module In_channel  = In_channel
-module Out_channel = Out_channel
+module Out_channel = Root.Out_channel

But, this causes a exception with both dune.2.9.0 as well as dune.2.9.1:

### output ###
# [...]
# Re-raised at Stdune__exn.raise_with_backtrace in file "src/stdune/exn.ml"
#   (inlined), line 36, characters 27-56
# Called from Stdune__exn_with_backtrace.reraise in file
#   "src/stdune/exn_with_backtrace.ml", line 13, characters 33-71
# Called from Fiber.Execution_context.forward_exn_with_bt in file
#   "src/fiber/fiber.ml", line 138, characters 10-17
# 
# I must not crash.  Uncertainty is the mind-killer. Exceptions are the
# little-death that brings total obliteration.  I will fully express my cases. 
# Execution will pass over me and through me.  And when it has gone past, I
# will unwind the stack along its path.  Where the cases are handled there will
# be nothing.  Only I will remain.

Reproduction

$ git clone https://github.com/ocaml-bench/sandmark.git
$ cd sandmark
$ git fetch origin pull/257/head:PR-257
$ git checkout PR-257
$  make clean; TAG='"run_in_ci"' make run_config_filtered.json 
$ RUN_CONFIG_JSON=run_config_filtered.json make ocaml-versions/4.14.0+trunk.bench

Specifications

  • Version of dune (output of dune --version): 2.9.0 or 2.9.1
  • Version of ocaml (output of ocamlc --version): 4.14.0+trunk
  • Operating system (distribution and version): Ubuntu 20.04.3 LTS

Metadata

Metadata

Assignees

No one assigned

    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