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

MDX does not rebuild when the prelude changes #7077

Closed
talex5 opened this issue Feb 14, 2023 · 1 comment · Fixed by #7109 or ocaml/opam-repository#23622
Closed

MDX does not rebuild when the prelude changes #7077

talex5 opened this issue Feb 14, 2023 · 1 comment · Fixed by #7109 or ocaml/opam-repository#23622
Assignees

Comments

@talex5
Copy link

talex5 commented Feb 14, 2023

Expected Behavior

When using (mdx (preludes prelude.ml) ...), changing prelude.ml should cause the tests to be run again.

Actual Behavior

It ignores this and you have to do dune clean first.

Reproduction

$ ls
dune  dune-project  prelude.ml  README.md

$ cat dune
(mdx
  (preludes prelude.ml)
  (files README.md))

$ cat dune-project 
(lang dune 3.6)
(using mdx 0.3)

$ cat prelude.ml 
let foo () = 1

$ cat README.md 
```ocaml
# foo();;
- : int = 1

$ dune runtest

$ echo 'let foo () = 2' > prelude.ml
$ dune runtest

$ dune clean; dune runtest
File "README.md", line 1, characters 0-0:
...

Specifications

  • Version of dune (output of dune --version): 3.6.2
  • Version of ocaml (output of ocamlc --version): 5.0.0
  • Operating system (distribution and version): Debian 11
@rgrinberg rgrinberg added the mdx label Feb 14, 2023
@emillon emillon self-assigned this Feb 15, 2023
@emillon
Copy link
Collaborator

emillon commented Feb 15, 2023

Confirmed from a quick look at the source code. I'll prepare a PR.

@emillon emillon added the bug label Feb 15, 2023
talex5 added a commit to talex5/eio that referenced this issue Feb 15, 2023
emillon added a commit to emillon/dune that referenced this issue Feb 17, 2023
When mdx is used in program-generation mode (version >= 0.2), the paths
used as preludes are recorded in the executable, but the contents of
files are only read when the program is executed. This adds the missing
dependencies.

Fixes ocaml#7077

Signed-off-by: Etienne Millon <[email protected]>
emillon added a commit to emillon/dune that referenced this issue Feb 20, 2023
When mdx is used in program-generation mode (version >= 0.2), the paths
used as preludes are recorded in the executable, but the contents of
files are only read when the program is executed. This adds the missing
dependencies.

Fixes ocaml#7077

Signed-off-by: Etienne Millon <[email protected]>
emillon added a commit that referenced this issue Feb 20, 2023
When mdx is used in program-generation mode (version >= 0.2), the paths
used as preludes are recorded in the executable, but the contents of
files are only read when the program is executed. This adds the missing
dependencies.

Fixes #7077

Signed-off-by: Etienne Millon <[email protected]>
emillon added a commit to emillon/dune that referenced this issue Mar 30, 2023
When mdx is used in program-generation mode (version >= 0.2), the paths
used as preludes are recorded in the executable, but the contents of
files are only read when the program is executed. This adds the missing
dependencies.

Fixes ocaml#7077

Signed-off-by: Etienne Millon <[email protected]>
emillon added a commit to emillon/dune that referenced this issue Mar 31, 2023
When mdx is used in program-generation mode (version >= 0.2), the paths
used as preludes are recorded in the executable, but the contents of
files are only read when the program is executed. This adds the missing
dependencies.

Fixes ocaml#7077

Signed-off-by: Etienne Millon <[email protected]>
emillon added a commit that referenced this issue Apr 3, 2023
When mdx is used in program-generation mode (version >= 0.2), the paths
used as preludes are recorded in the executable, but the contents of
files are only read when the program is executed. This adds the missing
dependencies.

Fixes #7077

Signed-off-by: Etienne Millon <[email protected]>
moyodiallo pushed a commit to moyodiallo/dune that referenced this issue Apr 3, 2023
When mdx is used in program-generation mode (version >= 0.2), the paths
used as preludes are recorded in the executable, but the contents of
files are only read when the program is executed. This adds the missing
dependencies.

Fixes ocaml#7077

Signed-off-by: Etienne Millon <[email protected]>
emillon added a commit to emillon/opam-repository that referenced this issue Apr 4, 2023
…, dune-rpc, dune-rpc-lwt, dune-private-libs, dune-glob, dune-configurator, dune-build-info, dune-action-plugin and chrome-trace (3.7.1)

CHANGES:

- Fix segfault on MacOS when dune was being shutdown while in watch mode.
  (ocaml/dune#7312, fixes ocaml/dune#6151, @gridbugs, @emillon)

- Fix preludes not being recorded as dependencies in the `(mdx)` stanza (ocaml/dune#7109,
  fixes ocaml/dune#7077, @emillon).

- Pass correct flags when compiling `stdlib.ml`. (ocaml/dune#7241, @emillon)

- Handle "Too many links" errors when using Dune cache on Windows.  The fix in
  3.7.0 for this same issue was not effective due to a typo. (ocaml/dune#7472, @nojb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment