Skip to content

feat: %{cmt} and %{cmti} artifact variables#12634

Merged
rgrinberg merged 4 commits intoocaml:mainfrom
Alizter:push-rwwzopnovoqy
Nov 15, 2025
Merged

feat: %{cmt} and %{cmti} artifact variables#12634
rgrinberg merged 4 commits intoocaml:mainfrom
Alizter:push-rwwzopnovoqy

Conversation

@Alizter
Copy link
Copy Markdown
Collaborator

@Alizter Alizter commented Oct 27, 2025

@trefis
Copy link
Copy Markdown
Collaborator

trefis commented Nov 4, 2025

I'm allowing myself a ping before this PR becomes lost in the abyss :)

@Alizter
Copy link
Copy Markdown
Collaborator Author

Alizter commented Nov 4, 2025

The main issue with this PR is that cmt files are a byproduct of our rules, so if a user write %{cmt:} there is no guarantee that they will be generated. Presumably we could find a way to detect when they won't be generated and give a better error than no rule found.

@rgrinberg
Copy link
Copy Markdown
Member

I don't think that's an important issue. Even if we stop generating cmt's as part of the regular bytecode targets, we'd still be able to move them to be standalone targets.

@Alizter Alizter marked this pull request as ready for review November 5, 2025 12:42
@Alizter Alizter requested review from art-w and rgrinberg November 5, 2025 12:42
@Alizter
Copy link
Copy Markdown
Collaborator Author

Alizter commented Nov 5, 2025

I guess another issue with this PR would be the fact that cmt files are not reproducible. This can cause problems if cached and/or shared. BUILD_PATH_PREFIX_MAP probably won't be easy to use here since this is binary data that needs to be decoded and recompiled.

@rgrinberg
Copy link
Copy Markdown
Member

We already produce these files so there's no real difference for reproducibility.

The compiler already understands BUILD_MAP_PREFIX_MAP

@Alizter
Copy link
Copy Markdown
Collaborator Author

Alizter commented Nov 5, 2025

We already produce these files so there's no real difference for reproducibility.

The compiler already understands BUILD_MAP_PREFIX_MAP

I inspected the files manually and I saw absolute paths all over the place. The compiler might understand it, but is there anything we can do about it?

@rgrinberg
Copy link
Copy Markdown
Member

You should make a bug report in the ocaml repo then.

@Alizter
Copy link
Copy Markdown
Collaborator Author

Alizter commented Nov 5, 2025

I think the workspace prefix is working fine.

Details
  00000000: 4361 6d6c 3139 3939 5430 3335 8495 a6be  Caml1999T035....
  00000010: 0000 0a0c 0000 01bf 0000 0773 0000 06fa  ...........s....
  00000020: 0800 0043 0025 4d79 6c69 6291 b0a0 b0a1  ...C.%Mylib.....
  00000030: 40a0 d0e0 b0a0 2568 656c 6c6f 0101 0ea0  @.....%hello....
  00000040: 0402 b0c0 286d 796c 6962 2e6d 6c41 4044  ....(mylib.mlA@D
  00000050: c004 0241 4049 40b1 0412 4041 b004 0504  ...A@I@...@A....
  00000060: 0340 40c0 96c0 b390 a326 7374 7269 6e67  .@@......&string
  00000070: 5140 9040 0205 f5e1 0040 0105 9e41 4001  Q@.@.....@...A@.
  00000080: 059d 0800 0033 00a0 4040 0401 0401 0401  .....3..@@......
  00000090: 0401 0401 0401 0401 40a7 b2b2 b2b2 b2b2  ........@.......
  000000a0: b2b2 b2b2 b2b2 b2b1 b1b1 b1b1 b1b1 b1b1  ................
  000000b0: b1b1 b1b1 b1b1 b1b1 b1b1 40a3 2561 7272  ..........@.%arr
  000000c0: 6179 4a08 0000 3b00 a0c0 9040 0205 f5e1  ayJ...;....@....
  000000d0: 0040 4d40 4190 4041 40a0 7f40 a040 4040  .@M@A.@A@..@.@@@
  000000e0: 40b0 c026 5f6e 6f6e 655f 4040 00ff 0402  @..&_none_@@....
  000000f0: 4140 4040 9204 0ca3 2462 6f6f 6c45 0800  A@@@....$boolE..
  00000100: 003b 0040 40a2 a0e0 a325 6661 6c73 6561  .;.@@....%falsea
  00000110: 9040 4004 0d40 9204 03a0 e0a3 2474 7275  .@@..@......$tru
  00000120: 6562 9040 4004 1340 9204 0340 4041 4040  eb.@@..@...@@A@@
  00000130: 4040 4004 1440 4140 9204 10a3 2463 6861  @@@..@A@....$cha
  00000140: 7242 0800 003b 0040 4004 1b41 4040 4040  rB...;.@@..A@@@@
  00000150: 4004 1840 4140 9204 03a3 2365 786e 4708  @..@A@....#exnG.
  00000160: 0000 3b00 4040 4041 4040 4040 4004 1c40  ..;.@@@A@@@@@..@
  00000170: 4040 9204 03a3 2365 6666 4808 0000 3b00  @@....#effH...;.
  00000180: a0c0 9040 0205 f5e1 0040 4f40 4140 4140  ...@.....@O@A@A@
  00000190: a07f 40a0 4040 4040 0425 4040 4092 0408  ..@.@@@@.%@@@...
  000001a0: a32c 636f 6e74 696e 7561 7469 6f6e 4908  .,continuationI.
  000001b0: 0000 3b00 a0c0 9040 0205 f5e1 0040 50a0  ..;....@.....@P.
  000001c0: c090 4002 05f5 e100 4051 4042 0432 4140  ..@.....@Q@B.2A@
  000001d0: a06e a059 40a0 42a0 4240 4040 0433 4040  .n.Y@.B.B@@@.3@@
  000001e0: 4092 040d a335 6578 7465 6e73 696f 6e5f  @....5extension_
  000001f0: 636f 6e73 7472 7563 746f 7252 0800 003b  constructorR...;
  00000200: 0040 4004 3a41 4040 4040 4004 3740 4040  .@@.:A@@@@@.7@@@
  00000210: 9204 03a3 2566 6c6f 6174 4408 0000 3b00  ....%floatD...;.
  00000220: 4040 043e 4140 4040 4040 043b 4040 4092  @@.>A@@@@@.;@@@.
  00000230: 0403 a32a 666c 6f61 7461 7272 6179 5308  ...*floatarrayS.
  00000240: 0000 3b00 4040 0442 4140 4040 4040 043f  ..;.@@.BA@@@@@.?
  00000250: 4040 4092 0403 a323 696e 7441 0800 003b  @@@....#intA...;
  00000260: 0040 4004 4641 4040 4040 4004 4340 4140  .@@.FA@@@@@.C@A@
  00000270: 9204 03a3 2569 6e74 3332 4e08 0000 3b00  ....%int32N...;.
  00000280: 4040 044a 4140 4040 4040 0447 4040 4092  @@.JA@@@@@.G@@@.
  00000290: 0403 a325 696e 7436 344f 0800 003b 0040  ...%int64O...;.@
  000002a0: 4004 4e41 4040 4040 4004 4b40 4040 9204  @.NA@@@@@.K@@@..
  000002b0: 03a3 266c 617a 795f 7450 0800 003b 00a0  ..&lazy_tP...;..
  000002c0: c090 4002 05f5 e100 4052 4041 0455 4140  ..@.....@R@A.UA@
  000002d0: a059 40a0 4040 4040 0454 4040 4092 0408  .Y@.@@@@.T@@@...
  000002e0: a324 6c69 7374 4b08 0000 3b00 a0c0 9040  .$listK...;....@
  000002f0: 0205 f5e1 0040 5340 41a2 a0e0 a322 5b5d  .....@S@A...."[]
  00000300: 6490 4040 0461 4092 0403 a0e0 a322 3a3a  d.@@.a@......"::
  00000310: 6590 a004 0fa0 c0b3 9004 17a0 0414 4090  e.............@.
  00000320: 4002 05f5 e100 4054 4040 046e 4092 040a  @.....@T@@.n@...
  00000330: 4040 4140 a059 40a0 4040 4040 0471 4040  @@A@.Y@.@@@@.q@@
  00000340: 4092 041c a329 6e61 7469 7665 696e 744d  @....)nativeintM
  00000350: 0800 003b 0040 4004 7841 4040 4040 4004  ...;.@@.xA@@@@@.
  00000360: 7540 4040 9204 03a3 266f 7074 696f 6e4c  u@@@....&optionL
  00000370: 0800 003b 00a0 c090 4002 05f5 e100 4056  ...;....@.....@V
  00000380: 4041 a2a0 e0a3 244e 6f6e 6566 9040 4004  @A....$Nonef.@@.
  00000390: 8240 9204 03a0 e0a3 2453 6f6d 6567 90a0  .@......$Someg..
  000003a0: 040f 4040 0489 4092 0404 4040 4140 a059  ..@@..@...@@A@.Y
  000003b0: 40a0 4040 4040 048c 4040 4092 0416 04bc  @.@@@@..@@@.....
  000003c0: 0800 003b 0040 4004 9141 4040 4040 4004  ...;.@@..A@@@@@.
  000003d0: 8e40 4040 9204 bda3 2562 7974 6573 4308  .@@@....%bytesC.
  000003e0: 0000 3b00 4040 0495 4140 4040 4040 0492  ..;.@@..A@@@@@..
  000003f0: 4040 4092 0403 a324 756e 6974 4608 0000  @@@....$unitF...
  00000400: 3b00 4040 a2a0 e0a3 2228 2963 9040 4004  ;.@@...."()c.@@.
  00000410: 9c40 9204 0340 4041 4040 4040 4004 9d40  .@...@@A@@@@@..@
  00000420: 4140 9204 0aa3 2e41 7373 6572 745f 6661  A@.....Assert_fa
  00000430: 696c 7572 655e 0800 0023 0090 0489 4090  ilure^...#....@.
  00000440: a0c0 92a0 c0b3 04d9 4090 4002 05f5 e100  ........@.@.....
  00000450: 404a a0c0 b390 046e 4090 4002 05f5 e100  @J.....n@.@.....
  00000460: 4040 a004 0540 0205 f5e1 0040 5940 4041  @@...@.....@Y@@A
  00000470: 04b0 a0b0 a03d 6f63 616d 6c2e 7761 726e  .....=ocaml.warn
  00000480: 5f6f 6e5f 6c69 7465 7261 6c5f 7061 7474  _on_literal_patt
  00000490: 6572 6e04 b404 b704 b440 9204 16a3 3044  ern......@....0D
  000004a0: 6976 6973 696f 6e5f 6279 5f7a 6572 6f5b  ivision_by_zero[
  000004b0: 0800 0023 0004 1740 9040 4041 04b9 a0b0  ...#...@.@@A....
  000004c0: a004 0904 bc04 bf04 bc40 9204 07a3 2b45  .........@....+E
  000004d0: 6e64 5f6f 665f 6669 6c65 5a08 0000 2300  nd_of_fileZ...#.
  000004e0: 041f 4090 4040 4104 c1a0 b0a0 0411 04c4  ..@.@@A.........
  000004f0: 04c7 04c4 4092 0407 a327 4661 696c 7572  ....@....'Failur
  00000500: 6557 0800 0023 0004 2740 90a0 0423 4040  eW...#..'@...#@@
  00000510: 4104 caa0 b0a0 041a 04cd 04d0 04cd 4092  A.............@.
  00000520: 0408 a330 496e 7661 6c69 645f 6172 6775  ...0Invalid_argu
  00000530: 6d65 6e74 5608 0000 2300 0430 4090 a004  mentV...#..0@...
  00000540: 2c40 4041 04d3 a0b0 a004 2304 d604 d904  ,@@A......#.....
  00000550: d640 9204 08a3 2d4d 6174 6368 5f66 6169  .@....-Match_fai
  00000560: 6c75 7265 5408 0000 2300 0439 4090 a0c0  lureT...#..9@...
  00000570: 92a0 0438 a004 35a0 0436 4002 05f5 e100  ...8..5..6@.....
  00000580: 405f 4040 4104 e1a0 b0a0 0431 04e4 04e7  @_@@A......1....
  00000590: 04e4 4092 040d a329 4e6f 745f 666f 756e  ..@....)Not_foun
  000005a0: 6458 0800 0023 0004 4740 9040 4041 04e9  dX...#..G@.@@A..
  000005b0: a0b0 a004 3904 ec04 ef04 ec40 9204 07a3  ....9......@....
  000005c0: 2d4f 7574 5f6f 665f 6d65 6d6f 7279 5508  -Out_of_memoryU.
  000005d0: 0000 2300 044f 4090 4040 4104 f1a0 b0a0  ..#..O@.@@A.....
  000005e0: 0441 04f4 04f7 04f4 4092 0407 a32e 5374  .A......@.....St
  000005f0: 6163 6b5f 6f76 6572 666c 6f77 5c08 0000  ack_overflow\...
  00000600: 2300 0457 4090 4040 4104 f9a0 b0a0 0449  #..W@.@@A......I
  00000610: 04fc 04ff 04fc 4092 0407 a32e 5379 735f  ......@.....Sys_
  00000620: 626c 6f63 6b65 645f 696f 5d08 0000 2300  blocked_io]...#.
  00000630: 045f 4090 4040 4105 0101 a0b0 a004 5105  ._@.@@A.......Q.
  00000640: 0104 0501 0705 0104 4092 0407 a329 5379  ........@....)Sy
  00000650: 735f 6572 726f 7259 0800 0023 0004 6740  s_errorY...#..g@
  00000660: 90a0 0463 4040 4105 010a a0b0 a004 5a05  ...c@@A.......Z.
  00000670: 010d 0501 1005 010d 4092 0408 a33a 556e  ........@....:Un
  00000680: 6465 6669 6e65 645f 7265 6375 7273 6976  defined_recursiv
  00000690: 655f 6d6f 6475 6c65 5f08 0000 2300 0470  e_module_...#..p
  000006a0: 4090 a0c0 92a0 046f a004 6ca0 046d 4002  @......o..l..m@.
  000006b0: 05f5 e100 4066 4040 4105 0118 a0b0 a004  ....@f@@A.......
  000006c0: 6805 011b 0501 1e05 011b 4092 040d a33a  h.........@....:
  000006d0: 436f 6e74 696e 7561 7469 6f6e 5f61 6c72  Continuation_alr
  000006e0: 6561 6479 5f74 616b 656e 6008 0000 2300  eady_taken`...#.
  000006f0: 047e 4090 4040 4105 0120 a0b0 a004 7005  .~@.@@A.. ....p.
  00000700: 0123 0501 2605 0123 4092 0407 9092 2653  .#..&..#@.....&S
  00000710: 7464 6c69 6240 4040 e091 b225 776f 726c  tdlib@@@...%worl
  00000720: 64b0 c005 0165 4140 4dc0 0501 6641 4052  d....eA@M...fA@R
  00000730: 4040 b0c0 0501 6841 404c c005 0169 4140  @@....hA@L...iA@
  00000740: 5340 4005 0163 0501 5d40 4140 b0c0 0501  S@@..c..]@A@....
  00000750: 6b41 4040 0403 4040 b004 0204 0440 0501  kA@@..@@.....@..
  00000760: 6040 a0b0 0501 73d0 0501 6b40 0501 6c40  `@....s...k@..l@
  00000770: 0501 6d40 4008 0000 3300 0501 6305 0163  ..m@@...3...c..c
  00000780: 0501 6305 0163 0501 6305 0163 0501 6305  ..c..c..c..c..c.
  00000790: 0163 40b0 0501 6305 0176 0403 4040 a0b0  .c@...c..v..@@..
  000007a0: 4005 0171 b125 4d79 6c69 6240 4040 4008  @..q.%Mylib@@@@.
  000007b0: 0000 5700 094e 2f6e 6978 2f73 746f 7265  ..W..N/nix/store
  000007c0: 2f73 6336 7633 696a 6d69 7868 6163 796c  /sc6v3ijmixhacyl
  000007d0: 6178 776e 3030 6e62 7673 7977 3471 7869  axwn00nbvsyw4qxi
  000007e0: 332d 6f63 616d 6c2b 666c 616d 6264 612d  3-ocaml+flambda-
  000007f0: 352e 332e 302f 6269 6e2f 6f63 616d 6c63  5.3.0/bin/ocamlc
  00000800: 2e6f 7074 222d 7709 3340 312e 2e33 4035  .opt"-w.3@1..3@5
  00000810: 2e2e 3238 4033 312e 2e33 3940 3433 4034  ..28@31..39@43@4
  00000820: 362e 2e34 3740 3439 2e2e 3537 4036 312e  6..47@49..57@61.
  00000830: 2e36 3240 3637 4036 392d 3430 302d 7374  .62@67@69-400-st
  00000840: 7269 6374 2d73 6571 7565 6e63 652f 2d73  rict-sequence/-s
  00000850: 7472 6963 742d 666f 726d 6174 732c 2d73  trict-formats,-s
  00000860: 686f 7274 2d70 6174 6873 2a2d 6b65 6570  hort-paths*-keep
  00000870: 2d6c 6f63 7322 2d67 2a2d 6269 6e2d 616e  -locs"-g*-bin-an
  00000880: 6e6f 7436 2d62 696e 2d61 6e6e 6f74 2d6f  not6-bin-annot-o
  00000890: 6363 7572 7265 6e63 6573 222d 4930 2e6d  ccurrences"-I0.m
  000008a0: 796c 6962 2e6f 626a 732f 6279 7465 292d  ylib.objs/byte)-
  000008b0: 636d 692d 6669 6c65 3a2e 6d79 6c69 622e  cmi-file:.mylib.
  000008c0: 6f62 6a73 2f62 7974 652f 6d79 6c69 622e  objs/byte/mylib.
  000008d0: 636d 692e 2d6e 6f2d 616c 6961 732d 6465  cmi.-no-alias-de
  000008e0: 7073 272d 6f70 6171 7565 222d 6f3a 2e6d  ps'-opaque"-o:.m
  000008f0: 796c 6962 2e6f 626a 732f 6279 7465 2f6d  ylib.objs/byte/m
  00000900: 796c 6962 2e63 6d6f 222d 6325 2d69 6d70  ylib.cmo"-c%-imp
  00000910: 6c05 018a 9005 018b 2f2f 776f 726b 7370  l.......//worksp
  00000920: 6163 655f 726f 6f74 a0a0 20a0 040f a009  ace_root.. .....
  00000930: 492f 6e69 782f 7374 6f72 652f 7363 3676  I/nix/store/sc6v
  00000940: 3369 6a6d 6978 6861 6379 6c61 7877 6e30  3ijmixhacylaxwn0
  00000950: 306e 6276 7379 7734 7178 6933 2d6f 6361  0nbvsyw4qxi3-oca
  00000960: 6d6c 2b66 6c61 6d62 6461 2d35 2e33 2e30  ml+flambda-5.3.0
  00000970: 2f6c 6962 2f6f 6361 6d6c 4040 9030 ed8d  /lib/ocaml@@.0..
  00000980: df6a 084e 6522 12ab 2994 9837 47a1 0501  .j.Ne"..)..7G...
  00000990: 88a0 a038 4361 6d6c 696e 7465 726e 616c  ...8Camlinternal
  000009a0: 466f 726d 6174 4261 7369 6373 9030 863a  FormatBasics.0.:
  000009b0: 7f52 8859 9b18 1f04 6f0f 5527 7b0f a0a0  .R.Y....o.U'{...
  000009c0: 254d 796c 6962 9030 f16c d14f cd05 364f  %Mylib.0.l.O..6O
  000009d0: 51b6 3db7 c98d 2672 a0a0 0442 9030 b772  Q.=...&r...B.0.r
  000009e0: 6274 865f fd07 290e f113 51fb 84fe 4040  bt._..)...Q...@@
  000009f0: 41c0 4108 0000 4300 40b0 0501 a391 0501  A.A...C.@.......
  00000a00: ae40 4040 4040 4040 4040 4040 4040 4040  .@@@@@@@@@@@@@@@
  00000a10: 4050 90b0 9090 0501 b993 d040 a005 01b1  @P.........@....
  00000a20: 40b0 9005 01ad 4040 4041 4040            @.....@@@A@@

The absolute directories I was observing were coming from the OCaml bin locations. I'm assuming we digest the ocaml binary, but I am unsure about the location. Since OCaml is not relocatable, then the location is probably included in the digest.

@Alizter Alizter force-pushed the push-rwwzopnovoqy branch 2 times, most recently from 258c8a7 to b311a9f Compare November 6, 2025 11:33
Signed-off-by: Ali Caglayan <alizter@gmail.com>
@Alizter Alizter requested a review from rgrinberg November 7, 2025 09:15
| Cmi -> t.cmi
| Cmo -> t.cmo
| Cmx -> t.cmx
| (Cmt | Cmti) as cm_kind ->
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think this is the right approach. The underlying issue is that your change to Cm_kind.Dict.t makes the type useless for the purposes that it is serving today. I think you should either reconsider your change to Cm_kind.t, or remove Cm_kind.Dict.t altogether and just specialize it to what is needed by its current users.

@Alizter Alizter marked this pull request as draft November 10, 2025 23:15
@Alizter
Copy link
Copy Markdown
Collaborator Author

Alizter commented Nov 10, 2025

I've pushed some changes I am not happy with. I will come back to this at a later point.

Signed-off-by: Ali Caglayan <alizter@gmail.com>
@rgrinberg
Copy link
Copy Markdown
Member

In the interest of moving this along, I simplified this PR to the bare minimum required to implement this feature. You're still invited to do the refactoring of course.

I've also tweaked the behavior of %{cmti} to match dune's own behavior of falling back to the cmt file. I think this is how merlin does it as well. For such ml only modules, the cmt is going to contain everything we need anyway.

@rgrinberg rgrinberg marked this pull request as ready for review November 12, 2025 22:52
This reverts commit 7604432.

Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
@rgrinberg rgrinberg dismissed their stale review November 15, 2025 23:17

Fixed the issues myself.

@rgrinberg rgrinberg merged commit ae776d3 into ocaml:main Nov 15, 2025
10 of 11 checks passed
Leonidas-from-XIV pushed a commit that referenced this pull request Dec 9, 2025
Before this change, it was producing the category subheadings at the
wrong level (level 2), instead of level 3.

An example of the corrected changelog produced:

```
3.21.0 (2025-12-08)
--------------------

### Fixed

- Fix `include_subdirs qualified` incorrectly picking the furthest module
  instead of the closest when resolving module name ambiguities. (#12587,
  @ElectreAAS and @Alizter)

- Fix: include the module alias in the transitive dependency closure with
  `(include_subdirs qualified)`. (#12299, @anmonteiro)

- Pass private modules with -H when this is available (#12666, @rgrinberg)

- Allow multiple modules in `(modules_flags ...)`, in `coq.theory` (#12733, @rlepigre)

- Improve error message for invalid version formats in both `(lang dune ...)` and
  `(using extension ...)` declarations. Changes "Atom of the form NNN.NNN expected"
  to "Invalid version. Version must be two numbers separated by a dot." (#12833, @benodiwal)

- Fix crash when running `dune build @check` on a library with virtual modules.
  (#12644, fixes #12636, @Alizter)

- Provide a more informative error message when `(pkg enabled)` is put in
  `dune-project` instead of `dune-workspace`. (#12802, fixes #12801,
  @benodiwal)

- Improve error message when invalid version strings are used in `dune-project`
  files. Non-ASCII characters and malformed versions now show a helpful hint
  with an example of the correct format. (#12794, fixes #12751, @benodiwal)

- Stop hiding the `root_module` from the include path (#12239, @rgrinberg)

- Allow `$ dune init` to work on absolute paths (#12601, fixes #7806,
  @rgrinberg)

- `(include_subdirs qualified)`: Add missing alias dependency to module group.
  (#12530, @anmonteiro)

- Add Melange compilation to the `@all` alias in libraries (#12628,
  @anmonteiro)

- melange support: don't emit empty JavaScript modules for generated module
  aliases. (#12464, @anmonteiro)

### Added

- (Experimental): Introduce the `library_parameter` stanza. It allows users to
  declare a parameter when using the OxCaml compiler.
  (#11963, implements #12084, @maiste) 


- Added the ability to scroll horizontally in TUI. (#12386, @Alizter)

- Feature: Include shell command that was executed when a cram test has
  occurred in the error message (#12307, @rgrinberg)

- Add support for `%{cmt:...}` and `%{cmti:...}` variables to reference
  compiled annotation files (.cmt and .cmti) containing typed abstract syntax
  trees with location and type information. (#12634, grants #12633, @Alizter)

- Add `$ dune describe tests` to describe the tests in the workspace
  (@Gromototo, #12545, fixes #12030)

- Allow `dune runtest` to properly run while a watch mode server is running.
  (#12473, grants #8114, @gridbugs and @ElectreAAS)

- Use copy-on-write (COW) when copying files on filesystems that support it
  (Btrfs, ZFS, XFS, etc), under Linux. (#12074, fixes #12071, @nojb)

- Add support for Tangled ATproto-based code repositories (#12197, @avsm)

- Add support for instantiating OxCaml parameterised libraries.
  (#12561, @art-w)
```

Note that the `Fixed` and `Added` headers are at level 3.

Compare with the previous, incorrect logic, produced initially in the
current release branch:
https://github.com/shonfeder/dune/blob/c5af78ff322225de3e839982600a1180caa951bf/CHANGES.md?plain=1

This incorrect formatting caused the documented release process to
produce release with no changelog (e.g.,
https://github.com/ocaml/dune/releases/tag/3.21.0_alpha0)

Signed-off-by: Shon Feder <shon.feder@gmail.com>
shonfeder added a commit to shonfeder/opam-repository that referenced this pull request Dec 15, 2025
CHANGES:

### Fixed

- Fix `include_subdirs qualified` incorrectly picking the furthest module
  instead of the closest when resolving module name ambiguities. (ocaml/dune#12587,
  @ElectreAAS and @Alizter)

- Fix: include the module alias in the transitive dependency closure with
  `(include_subdirs qualified)`. (ocaml/dune#12299, @anmonteiro)

- Improve error messages for invalid version formats containing non-ASCII
  characters. Previously, non-ASCII characters in version strings (e.g., `(lang
  dune è)` or `(using menhir π3.14)`) would fail with a generic "Invalid file"
  error. Now they display a clear message: "Invalid atom: contains non-ASCII
  character(s). Atoms must only contain ASCII characters." The fix is
  implemented at the lexer level, providing consistent error handling across all
  s-expression parsing. (ocaml/dune#12844, fixes ocaml/dune#12836, @benodiwal)

- Pass private modules with -H when this is available (ocaml/dune#12666, @rgrinberg)

- Allow multiple modules in `(modules_flags ...)`, in `coq.theory` (ocaml/dune#12733, @rlepigre)

- Improve error message for invalid version formats in both `(lang dune ...)` and
  `(using extension ...)` declarations. Changes "Atom of the form NNN.NNN expected"
  to "Invalid version. Version must be two numbers separated by a dot." (ocaml/dune#12833, @benodiwal)

- Fix crash when running `dune build @check` on a library with virtual modules.
  (ocaml/dune#12644, fixes ocaml/dune#12636, @Alizter)

- Provide a more informative error message when `(pkg enabled)` is put in
  `dune-project` instead of `dune-workspace`. (ocaml/dune#12802, fixes ocaml/dune#12801,
  @benodiwal)

- Improve error message when invalid version strings are used in `dune-project`
  files. Non-ASCII characters and malformed versions now show a helpful hint
  with an example of the correct format. (ocaml/dune#12794, fixes ocaml/dune#12751, @benodiwal)

- Stop hiding the `root_module` from the include path (ocaml/dune#12239, @rgrinberg)

- Allow `$ dune init` to work on absolute paths (ocaml/dune#12601, fixes ocaml/dune#7806,
  @rgrinberg)

- `(include_subdirs qualified)`: Add missing alias dependency to module group.
  (ocaml/dune#12530, @anmonteiro)

- Add Melange compilation to the `@all` alias in libraries (ocaml/dune#12628,
  @anmonteiro)

- Fix greedy version location in lang declarations. Previously, error locations for
  invalid lang versions would span multiple bytes for multi-byte UTF-8 characters,
  causing carets to appear misaligned and seemingly include the closing
  parenthesis. Now, error locations for ASCII strings show the full length (e.g.,
  "Ali" shows `^^^`), while non-ASCII strings show only the first byte (e.g., "è"
  shows `^`) to avoid multi-byte character display issues. (ocaml/dune#12869, fixes ocaml/dune#12806,
  @benodiwal)

- melange support: don't emit empty JavaScript modules for generated module
  aliases. (ocaml/dune#12464, @anmonteiro)

### Added

- (Experimental): Introduce the `library_parameter` stanza. It allows users to
  declare a parameter when using the OxCaml compiler.
  (ocaml/dune#11963, implements ocaml/dune#12084, @maiste)

- Added the ability to scroll horizontally in TUI. (ocaml/dune#12386, @Alizter)

- Feature: Include shell command that was executed when a cram test has
  occurred in the error message (ocaml/dune#12307, @rgrinberg)

-  support expanding variables in `(promote (into ..))` (ocaml/dune#12832, fixes ocaml/dune#12742,
   @anmonteiro)

- Add support for `%{cmt:...}` and `%{cmti:...}` variables to reference
  compiled annotation files (.cmt and .cmti) containing typed abstract syntax
  trees with location and type information. (ocaml/dune#12634, grants ocaml/dune#12633, @Alizter)

- Add `$ dune describe tests` to describe the tests in the workspace
  (@Gromototo, ocaml/dune#12545, fixes ocaml/dune#12030)

- Add `argv`, the process environment, and the dune version to the config event
  in the trace (ocaml/dune#12909, @rgrinberg)

- Allow `dune runtest` to properly run while a watch mode server is running.
  (ocaml/dune#12473, grants ocaml/dune#8114, @gridbugs and @ElectreAAS)

- Use copy-on-write (COW) when copying files on filesystems that support it
  (Btrfs, ZFS, XFS, etc), under Linux. (ocaml/dune#12074, fixes ocaml/dune#12071, @nojb)

- Add support for Tangled ATproto-based code repositories (ocaml/dune#12197, @avsm)

- Add support for instantiating OxCaml parameterised libraries.
  (ocaml/dune#12561, @art-w)

- Add a `(conflict_markers error|ignore)` option to the cram stanza. When
  `(conflict_markers error)` is set, the cram test will fail in the presence of
  conflict markers. Git, diff3 and jujutsu conflict markers are detected.
  (ocaml/dune#12538, ocaml/dune#12617, ocaml/dune#12655, fixes ocaml/dune#12512, @rgrinberg, @Alizter)

- Introduce a `%{ppx:lib1+..+libn}` stanza to make it possible to refer to ppx
  executables built by dune. This is useful for writing tests (ocaml/dune#12711,
  @rgrinberg)

- Introduce a `(dir ..)` field on packages defined in the `dune-project`. This
  field allows to associate a directory with a particular package. This makes
  dune automatically filter out all stanzas in this directory and its
  descendants with `--only-packages`. All users are recommended to switch to
  using this field. (ocaml/dune#12614, fixes ocaml/dune#3255, @rgrinberg)

- Add support for `DUNE_ROOT` environment variable, similar to the existing
  `--root` CLI parameter. (fixes ocaml/dune#12399 @sir4ur0n)

- Introduce an `unused-libs` alias to detect unused libraries.
  (ocaml/dune#12623, fixes ocaml/dune#650, @rgrinberg)

- Add `--files` flag to `dune describe opam-files` to print only the names of
  the opam files line by line. (ocaml/dune#9793, @reynir and @Alizter)

- `dune exec` now accepts absolute paths inside the workspace.
  (ocaml/dune#12094, @Alizter)

- Add `coqdoc_header` and `coqdoc_footer` fields to the `coq` field of the
  `env` stanza, and to the `coq.theory` stanza, allowing to configure a
  custom header or footer respectively in the HTML output of `coqdoc`.
  (ocaml/dune#11131, @rlepigre)

- Allow `dune fmt` to properly run while a watch mode server is running.
  Note that the `--preview` flag is not supported in this mode.
  (ocaml/dune#12064, @ElectreAAS)

- Support for generating `_CoqProject` files for `coq.theory` stanzas.
  (ocaml/dune#11752, @rlepigre)

- Added `(files)` stanza, similar to `(dirs)` to control which files are visible
  to Dune on a per-directory basis. (ocaml/dune#12879, @nojb)
- Add support for %{ocaml-config:ox} (ocaml/dune#12236, @jonludlam)

- Introduce `dune promotion show` command to display the contents of corrected
  files that are ready for promotion. This allows users to preview changes
  before running `dune promote`. The command accepts file arguments to show
  specific files, or displays all promotable files when called without
  arguments. (ocaml/dune#12669, fixes ocaml/dune#3883, @MixiMaxiMouse)
- New `(lang rocq)` build mode for Rocq 9.0 and later. This new mode
  is very similar to the existing `(lang coq)`, except that it doesn't
  need the `coq*` compatibility wrappers. As of today `(lang rocq)`
  doesn't support yet composed builds with Rocq itself, this will be
  added later.  `(lang coq)` is deprecated, development is frozen, and
  will be removed at some point in the future. (ocaml/dune#12035, @ejgallego,
  @Lysxia, fixes ocaml/dune#11572)

### Changed

- Don't run `ocamldep` to compute false dependencies on the `root_module`
  (ocaml/dune#12227, @rgrinberg)

- `dune format-dune-file` now uses the syntax version of the Dune project that
  contains the file being formatted (if any) instead of using the latest version
  available, which remains the default if there is no Dune project in scope.
  (ocaml/dune#11865, @nojb)

- Persistent DB and process events have been slightly modified. Persistent
  DB events have more concise names and job events always include full
  information. (ocaml/dune#12867, @rgrinberg)

- Removed the `--trace-extended` flag. Its functionality is always enabled when
  tracing is active (ocaml/dune#12908, @rgrinberg)

- The `test/dune` file generated by `dune init proj` now depends on the project library. (ocaml/dune#12791, @shonfeder)

- Starting with version 3.21 of the Dune language, Dune no longer changes the
  default set of compiler warnings. For users that would like to keep the old
  behaviour, the variable `%{dune-warnings}` can be used in an `(env)` stanza in
  a top-level Dune file: `(env (dev (flags :standard %{dune-warnings})))`.
  (ocaml/dune#12766, @nojb)
- Fix: stop generating `cmt` files for cinaps binaries (ocaml/dune#12530, @rgrinberg)
shonfeder added a commit to shonfeder/opam-repository that referenced this pull request Jan 5, 2026
CHANGES:

### Fixed

- Fix `include_subdirs qualified` incorrectly picking the furthest module
  instead of the closest when resolving module name ambiguities. (ocaml/dune#12587,
  @ElectreAAS and @Alizter)

- Fix: include the module alias in the transitive dependency closure with
  `(include_subdirs qualified)`. (ocaml/dune#12299, @anmonteiro)

- Improve error messages for invalid version formats containing non-ASCII
  characters. Previously, non-ASCII characters in version strings (e.g., `(lang
  dune è)` or `(using menhir π3.14)`) would fail with a generic "Invalid file"
  error. Now they display a clear message: "Invalid atom: contains non-ASCII
  character(s). Atoms must only contain ASCII characters." The fix is
  implemented at the lexer level, providing consistent error handling across all
  s-expression parsing. (ocaml/dune#12844, fixes ocaml/dune#12836, @benodiwal)

- Pass private modules with -H when this is available (ocaml/dune#12666, @rgrinberg)

- Allow multiple modules in `(modules_flags ...)`, in `coq.theory` (ocaml/dune#12733, @rlepigre)

- Improve error message for invalid version formats in both `(lang dune ...)` and
  `(using extension ...)` declarations. Changes "Atom of the form NNN.NNN expected"
  to "Invalid version. Version must be two numbers separated by a dot." (ocaml/dune#12833, @benodiwal)

- Fix crash when running `dune build @check` on a library with virtual modules.
  (ocaml/dune#12644, fixes ocaml/dune#12636, @Alizter)

- Provide a more informative error message when `(pkg enabled)` is put in
  `dune-project` instead of `dune-workspace`. (ocaml/dune#12802, fixes ocaml/dune#12801,
  @benodiwal)

- Improve error message when invalid version strings are used in `dune-project`
  files. Non-ASCII characters and malformed versions now show a helpful hint
  with an example of the correct format. (ocaml/dune#12794, fixes ocaml/dune#12751, @benodiwal)

- Stop hiding the `root_module` from the include path (ocaml/dune#12239, @rgrinberg)

- Allow `$ dune init` to work on absolute paths (ocaml/dune#12601, fixes ocaml/dune#7806,
  @rgrinberg)

- `(include_subdirs qualified)`: Add missing alias dependency to module group.
  (ocaml/dune#12530, @anmonteiro)

- Add Melange compilation to the `@all` alias in libraries (ocaml/dune#12628,
  @anmonteiro)

- Fix greedy version location in lang declarations. Previously, error locations for
  invalid lang versions would span multiple bytes for multi-byte UTF-8 characters,
  causing carets to appear misaligned and seemingly include the closing
  parenthesis. Now, error locations for ASCII strings show the full length (e.g.,
  "Ali" shows `^^^`), while non-ASCII strings show only the first byte (e.g., "è"
  shows `^`) to avoid multi-byte character display issues. (ocaml/dune#12869, fixes ocaml/dune#12806,
  @benodiwal)

- melange support: don't emit empty JavaScript modules for generated module
  aliases. (ocaml/dune#12464, @anmonteiro)

### Added

- (Experimental): Introduce the `library_parameter` stanza. It allows users to
  declare a parameter when using the OxCaml compiler.
  (ocaml/dune#11963, implements ocaml/dune#12084, @maiste)

- Added the ability to scroll horizontally in TUI. (ocaml/dune#12386, @Alizter)

- Feature: Include shell command that was executed when a cram test has
  occurred in the error message (ocaml/dune#12307, @rgrinberg)

-  support expanding variables in `(promote (into ..))` (ocaml/dune#12832, fixes ocaml/dune#12742,
   @anmonteiro)

- Add support for `%{cmt:...}` and `%{cmti:...}` variables to reference
  compiled annotation files (.cmt and .cmti) containing typed abstract syntax
  trees with location and type information. (ocaml/dune#12634, grants ocaml/dune#12633, @Alizter)

- Add `$ dune describe tests` to describe the tests in the workspace
  (@Gromototo, ocaml/dune#12545, fixes ocaml/dune#12030)

- Add `argv`, the process environment, and the dune version to the config event
  in the trace (ocaml/dune#12909, @rgrinberg)

- Allow `dune runtest` to properly run while a watch mode server is running.
  (ocaml/dune#12473, grants ocaml/dune#8114, @gridbugs and @ElectreAAS)

- Use copy-on-write (COW) when copying files on filesystems that support it
  (Btrfs, ZFS, XFS, etc), under Linux. (ocaml/dune#12074, fixes ocaml/dune#12071, @nojb)

- Add support for Tangled ATproto-based code repositories (ocaml/dune#12197, @avsm)

- Add support for instantiating OxCaml parameterised libraries.
  (ocaml/dune#12561, @art-w)

- Add a `(conflict_markers error|ignore)` option to the cram stanza. When
  `(conflict_markers error)` is set, the cram test will fail in the presence of
  conflict markers. Git, diff3 and jujutsu conflict markers are detected.
  (ocaml/dune#12538, ocaml/dune#12617, ocaml/dune#12655, fixes ocaml/dune#12512, @rgrinberg, @Alizter)

- Introduce a `%{ppx:lib1+..+libn}` stanza to make it possible to refer to ppx
  executables built by dune. This is useful for writing tests (ocaml/dune#12711,
  @rgrinberg)

- Introduce a `(dir ..)` field on packages defined in the `dune-project`. This
  field allows to associate a directory with a particular package. This makes
  dune automatically filter out all stanzas in this directory and its
  descendants with `--only-packages`. All users are recommended to switch to
  using this field. (ocaml/dune#12614, fixes ocaml/dune#3255, @rgrinberg)

- Add support for `DUNE_ROOT` environment variable, similar to the existing
  `--root` CLI parameter. (fixes ocaml/dune#12399 @sir4ur0n)

- Introduce an `unused-libs` alias to detect unused libraries.
  (ocaml/dune#12623, fixes ocaml/dune#650, @rgrinberg)

- Add `--files` flag to `dune describe opam-files` to print only the names of
  the opam files line by line. (ocaml/dune#9793, @reynir and @Alizter)

- `dune exec` now accepts absolute paths inside the workspace.
  (ocaml/dune#12094, @Alizter)

- Add `coqdoc_header` and `coqdoc_footer` fields to the `coq` field of the
  `env` stanza, and to the `coq.theory` stanza, allowing to configure a
  custom header or footer respectively in the HTML output of `coqdoc`.
  (ocaml/dune#11131, @rlepigre)

- Allow `dune fmt` to properly run while a watch mode server is running.
  Note that the `--preview` flag is not supported in this mode.
  (ocaml/dune#12064, @ElectreAAS)

- Support for generating `_CoqProject` files for `coq.theory` stanzas.
  (ocaml/dune#11752, @rlepigre)

- Added `(files)` stanza, similar to `(dirs)` to control which files are visible
  to Dune on a per-directory basis. (ocaml/dune#12879, @nojb)
- Add support for %{ocaml-config:ox} (ocaml/dune#12236, @jonludlam)

- Introduce `dune promotion show` command to display the contents of corrected
  files that are ready for promotion. This allows users to preview changes
  before running `dune promote`. The command accepts file arguments to show
  specific files, or displays all promotable files when called without
  arguments. (ocaml/dune#12669, fixes ocaml/dune#3883, @MixiMaxiMouse)
- New `(lang rocq)` build mode for Rocq 9.0 and later. This new mode
  is very similar to the existing `(lang coq)`, except that it doesn't
  need the `coq*` compatibility wrappers. As of today `(lang rocq)`
  doesn't support yet composed builds with Rocq itself, this will be
  added later.  `(lang coq)` is deprecated, development is frozen, and
  will be removed at some point in the future. (ocaml/dune#12035, @ejgallego,
  @Lysxia, fixes ocaml/dune#11572)

### Changed

- Don't run `ocamldep` to compute false dependencies on the `root_module`
  (ocaml/dune#12227, @rgrinberg)

- `dune format-dune-file` now uses the syntax version of the Dune project that
  contains the file being formatted (if any) instead of using the latest version
  available, which remains the default if there is no Dune project in scope.
  (ocaml/dune#11865, @nojb)

- Persistent DB and process events have been slightly modified. Persistent
  DB events have more concise names and job events always include full
  information. (ocaml/dune#12867, @rgrinberg)

- Removed the `--trace-extended` flag. Its functionality is always enabled when
  tracing is active (ocaml/dune#12908, @rgrinberg)

- The `test/dune` file generated by `dune init proj` now depends on the project library. (ocaml/dune#12791, @shonfeder)

- Starting with version 3.21 of the Dune language, Dune no longer changes the
  default set of compiler warnings. For users that would like to keep the old
  behaviour, the variable `%{dune-warnings}` can be used in an `(env)` stanza in
  a top-level Dune file: `(env (dev (flags :standard %{dune-warnings})))`.
  (ocaml/dune#12766, @nojb)
- Fix: stop generating `cmt` files for cinaps binaries (ocaml/dune#12530, @rgrinberg)
shonfeder added a commit to shonfeder/opam-repository that referenced this pull request Jan 12, 2026
CHANGES:

### Fixed

- Fix `include_subdirs qualified` incorrectly picking the furthest module
  instead of the closest when resolving module name ambiguities. (ocaml/dune#12587,
  @ElectreAAS and @Alizter)

- Fix: include the module alias in the transitive dependency closure with
  `(include_subdirs qualified)`. (ocaml/dune#12299, @anmonteiro)

- Improve error messages for invalid version formats containing non-ASCII
  characters. Previously, non-ASCII characters in version strings (e.g., `(lang
  dune è)` or `(using menhir π3.14)`) would fail with a generic "Invalid file"
  error. Now they display a clear message: "Invalid atom: contains non-ASCII
  character(s). Atoms must only contain ASCII characters." The fix is
  implemented at the lexer level, providing consistent error handling across all
  s-expression parsing. (ocaml/dune#12844, fixes ocaml/dune#12836, @benodiwal)

- Pass private modules with -H when this is available (ocaml/dune#12666, @rgrinberg)

- Allow multiple modules in `(modules_flags ...)`, in `coq.theory` (ocaml/dune#12733, @rlepigre)

- Improve error message for invalid version formats in both `(lang dune ...)` and
  `(using extension ...)` declarations. Changes "Atom of the form NNN.NNN expected"
  to "Invalid version. Version must be two numbers separated by a dot." (ocaml/dune#12833, @benodiwal)

- Fix crash when running `dune build @check` on a library with virtual modules.
  (ocaml/dune#12644, fixes ocaml/dune#12636, @Alizter)

- Provide a more informative error message when `(pkg enabled)` is put in
  `dune-project` instead of `dune-workspace`. (ocaml/dune#12802, fixes ocaml/dune#12801,
  @benodiwal)

- Improve error message when invalid version strings are used in `dune-project`
  files. Non-ASCII characters and malformed versions now show a helpful hint
  with an example of the correct format. (ocaml/dune#12794, fixes ocaml/dune#12751, @benodiwal)

- Stop hiding the `root_module` from the include path (ocaml/dune#12239, @rgrinberg)

- Allow `$ dune init` to work on absolute paths (ocaml/dune#12601, fixes ocaml/dune#7806,
  @rgrinberg)

- `(include_subdirs qualified)`: Add missing alias dependency to module group.
  (ocaml/dune#12530, @anmonteiro)

- Add Melange compilation to the `@all` alias in libraries (ocaml/dune#12628,
  @anmonteiro)

- Fix greedy version location in lang declarations. Previously, error locations for
  invalid lang versions would span multiple bytes for multi-byte UTF-8 characters,
  causing carets to appear misaligned and seemingly include the closing
  parenthesis. Now, error locations for ASCII strings show the full length (e.g.,
  "Ali" shows `^^^`), while non-ASCII strings show only the first byte (e.g., "è"
  shows `^`) to avoid multi-byte character display issues. (ocaml/dune#12869, fixes ocaml/dune#12806,
  @benodiwal)

- melange support: don't emit empty JavaScript modules for generated module
  aliases. (ocaml/dune#12464, @anmonteiro)

### Added

- (Experimental): Introduce the `library_parameter` stanza. It allows users to
  declare a parameter when using the OxCaml compiler.
  (ocaml/dune#11963, implements ocaml/dune#12084, @maiste)

- Added the ability to scroll horizontally in TUI. (ocaml/dune#12386, @Alizter)

- Feature: Include shell command that was executed when a cram test has
  occurred in the error message (ocaml/dune#12307, @rgrinberg)

-  support expanding variables in `(promote (into ..))` (ocaml/dune#12832, fixes ocaml/dune#12742,
   @anmonteiro)

- Add support for `%{cmt:...}` and `%{cmti:...}` variables to reference
  compiled annotation files (.cmt and .cmti) containing typed abstract syntax
  trees with location and type information. (ocaml/dune#12634, grants ocaml/dune#12633, @Alizter)

- Add `$ dune describe tests` to describe the tests in the workspace
  (@Gromototo, ocaml/dune#12545, fixes ocaml/dune#12030)

- Add `argv`, the process environment, and the dune version to the config event
  in the trace (ocaml/dune#12909, @rgrinberg)

- Allow `dune runtest` to properly run while a watch mode server is running.
  (ocaml/dune#12473, grants ocaml/dune#8114, @gridbugs and @ElectreAAS)

- Use copy-on-write (COW) when copying files on filesystems that support it
  (Btrfs, ZFS, XFS, etc), under Linux. (ocaml/dune#12074, fixes ocaml/dune#12071, @nojb)

- Add support for Tangled ATproto-based code repositories (ocaml/dune#12197, @avsm)

- Add support for instantiating OxCaml parameterised libraries.
  (ocaml/dune#12561, @art-w)

- Add a `(conflict_markers error|ignore)` option to the cram stanza. When
  `(conflict_markers error)` is set, the cram test will fail in the presence of
  conflict markers. Git, diff3 and jujutsu conflict markers are detected.
  (ocaml/dune#12538, ocaml/dune#12617, ocaml/dune#12655, fixes ocaml/dune#12512, @rgrinberg, @Alizter)

- Introduce a `%{ppx:lib1+..+libn}` stanza to make it possible to refer to ppx
  executables built by dune. This is useful for writing tests (ocaml/dune#12711,
  @rgrinberg)

- Introduce a `(dir ..)` field on packages defined in the `dune-project`. This
  field allows to associate a directory with a particular package. This makes
  dune automatically filter out all stanzas in this directory and its
  descendants with `--only-packages`. All users are recommended to switch to
  using this field. (ocaml/dune#12614, fixes ocaml/dune#3255, @rgrinberg)

- Add support for `DUNE_ROOT` environment variable, similar to the existing
  `--root` CLI parameter. (fixes ocaml/dune#12399 @sir4ur0n)

- Introduce an `unused-libs` alias to detect unused libraries.
  (ocaml/dune#12623, fixes ocaml/dune#650, @rgrinberg)

- Add `--files` flag to `dune describe opam-files` to print only the names of
  the opam files line by line. (ocaml/dune#9793, @reynir and @Alizter)

- `dune exec` now accepts absolute paths inside the workspace.
  (ocaml/dune#12094, @Alizter)

- Add `coqdoc_header` and `coqdoc_footer` fields to the `coq` field of the
  `env` stanza, and to the `coq.theory` stanza, allowing to configure a
  custom header or footer respectively in the HTML output of `coqdoc`.
  (ocaml/dune#11131, @rlepigre)

- Allow `dune fmt` to properly run while a watch mode server is running.
  Note that the `--preview` flag is not supported in this mode.
  (ocaml/dune#12064, @ElectreAAS)

- Support for generating `_CoqProject` files for `coq.theory` stanzas.
  (ocaml/dune#11752, @rlepigre)

- Added `(files)` stanza, similar to `(dirs)` to control which files are visible
  to Dune on a per-directory basis. (ocaml/dune#12879, @nojb)
- Add support for %{ocaml-config:ox} (ocaml/dune#12236, @jonludlam)

- Introduce `dune promotion show` command to display the contents of corrected
  files that are ready for promotion. This allows users to preview changes
  before running `dune promote`. The command accepts file arguments to show
  specific files, or displays all promotable files when called without
  arguments. (ocaml/dune#12669, fixes ocaml/dune#3883, @MixiMaxiMouse)
- New `(lang rocq)` build mode for Rocq 9.0 and later. This new mode
  is very similar to the existing `(lang coq)`, except that it doesn't
  need the `coq*` compatibility wrappers. As of today `(lang rocq)`
  doesn't support yet composed builds with Rocq itself, this will be
  added later.  `(lang coq)` is deprecated, development is frozen, and
  will be removed at some point in the future. (ocaml/dune#12035, @ejgallego,
  @Lysxia, fixes ocaml/dune#11572)

### Changed

- Don't run `ocamldep` to compute false dependencies on the `root_module`
  (ocaml/dune#12227, @rgrinberg)

- `dune format-dune-file` now uses the syntax version of the Dune project that
  contains the file being formatted (if any) instead of using the latest version
  available, which remains the default if there is no Dune project in scope.
  (ocaml/dune#11865, @nojb)

- Persistent DB and process events have been slightly modified. Persistent
  DB events have more concise names and job events always include full
  information. (ocaml/dune#12867, @rgrinberg)

- Removed the `--trace-extended` flag. Its functionality is always enabled when
  tracing is active (ocaml/dune#12908, @rgrinberg)

- The `test/dune` file generated by `dune init proj` now depends on the project library. (ocaml/dune#12791, @shonfeder)

- Starting with version 3.21 of the Dune language, Dune no longer changes the
  default set of compiler warnings. For users that would like to keep the old
  behaviour, the variable `%{dune-warnings}` can be used in an `(env)` stanza in
  a top-level Dune file: `(env (dev (flags :standard %{dune-warnings})))`.
  (ocaml/dune#12766, @nojb)
- Fix: stop generating `cmt` files for cinaps binaries (ocaml/dune#12530, @rgrinberg)
shonfeder added a commit to shonfeder/opam-repository that referenced this pull request Feb 11, 2026
CHANGES:

### Fixed

- Fix build issues on NetBSD and OpenBSD via update of vendored ocaml-lmdb
  (@Alizter, ocaml/dune#13074)

- Fix `melange.emit` not respecting the package mask via `-p <PKG>` (ocaml/dune#13522,
  @anmonteiro)

### Changed

- Stop starting RPC server with `$ dune promote` (ocaml/dune#13428, @rgrinberg)

  @ElectreAAS and @Alizter)

- Fix: include the module alias in the transitive dependency closure with
  `(include_subdirs qualified)`. (ocaml/dune#12299, @anmonteiro)

- Improve error messages for invalid version formats containing non-ASCII
  characters. Previously, non-ASCII characters in version strings (e.g., `(lang
  dune è)` or `(using menhir π3.14)`) would fail with a generic "Invalid file"
  error. Now they display a clear message: "Invalid atom: contains non-ASCII
  character(s). Atoms must only contain ASCII characters." The fix is
  implemented at the lexer level, providing consistent error handling across all
  s-expression parsing. (ocaml/dune#12844, fixes ocaml/dune#12836, @benodiwal)

- Pass private modules with -H when this is available (ocaml/dune#12666, @rgrinberg)

- Allow multiple modules in `(modules_flags ...)`, in `coq.theory` (ocaml/dune#12733, @rlepigre)

- Improve error message for invalid version formats in both `(lang dune ...)` and
  `(using extension ...)` declarations. Changes "Atom of the form NNN.NNN expected"
  to "Invalid version. Version must be two numbers separated by a dot." (ocaml/dune#12833, @benodiwal)

- Fix crash when running `dune build @check` on a library with virtual modules.
  (ocaml/dune#12644, fixes ocaml/dune#12636, @Alizter)

- Provide a more informative error message when `(pkg enabled)` is put in
  `dune-project` instead of `dune-workspace`. (ocaml/dune#12802, fixes ocaml/dune#12801,
  @benodiwal)

- Improve error message when invalid version strings are used in `dune-project`
  files. Non-ASCII characters and malformed versions now show a helpful hint
  with an example of the correct format. (ocaml/dune#12794, fixes ocaml/dune#12751, @benodiwal)

- Stop hiding the `root_module` from the include path (ocaml/dune#12239, @rgrinberg)

- Allow `$ dune init` to work on absolute paths (ocaml/dune#12601, fixes ocaml/dune#7806,
  @rgrinberg)

- `(include_subdirs qualified)`: Add missing alias dependency to module group.
  (ocaml/dune#12530, @anmonteiro)

- Add Melange compilation to the `@all` alias in libraries (ocaml/dune#12628,
  @anmonteiro)

- Fix greedy version location in lang declarations. Previously, error locations for
  invalid lang versions would span multiple bytes for multi-byte UTF-8 characters,
  causing carets to appear misaligned and seemingly include the closing
  parenthesis. Now, error locations for ASCII strings show the full length (e.g.,
  "Ali" shows `^^^`), while non-ASCII strings show only the first byte (e.g., "è"
  shows `^`) to avoid multi-byte character display issues. (ocaml/dune#12869, fixes ocaml/dune#12806,
  @benodiwal)

- melange support: don't emit empty JavaScript modules for generated module
  aliases. (ocaml/dune#12464, @anmonteiro)

### Added

- (Experimental): Introduce the `library_parameter` stanza. It allows users to
  declare a parameter when using the OxCaml compiler.
  (ocaml/dune#11963, implements ocaml/dune#12084, @maiste)

- Added the ability to scroll horizontally in TUI. (ocaml/dune#12386, @Alizter)

- Feature: Include shell command that was executed when a cram test has
  occurred in the error message (ocaml/dune#12307, @rgrinberg)

-  support expanding variables in `(promote (into ..))` (ocaml/dune#12832, fixes ocaml/dune#12742,
   @anmonteiro)

- Add support for `%{cmt:...}` and `%{cmti:...}` variables to reference
  compiled annotation files (.cmt and .cmti) containing typed abstract syntax
  trees with location and type information. (ocaml/dune#12634, grants ocaml/dune#12633, @Alizter)

- Add `$ dune describe tests` to describe the tests in the workspace
  (@Gromototo, ocaml/dune#12545, fixes ocaml/dune#12030)

- Add `argv`, the process environment, and the dune version to the config event
  in the trace (ocaml/dune#12909, @rgrinberg)

- Allow `dune runtest` to properly run while a watch mode server is running.
  (ocaml/dune#12473, grants ocaml/dune#8114, @gridbugs and @ElectreAAS)

- Use copy-on-write (COW) when copying files on filesystems that support it
  (Btrfs, ZFS, XFS, etc), under Linux. (ocaml/dune#12074, fixes ocaml/dune#12071, @nojb)

- Add support for Tangled ATproto-based code repositories (ocaml/dune#12197, @avsm)

- Add support for instantiating OxCaml parameterised libraries.
  (ocaml/dune#12561, @art-w)

- Add a `(conflict_markers error|ignore)` option to the cram stanza. When
  `(conflict_markers error)` is set, the cram test will fail in the presence of
  conflict markers. Git, diff3 and jujutsu conflict markers are detected.
  (ocaml/dune#12538, ocaml/dune#12617, ocaml/dune#12655, fixes ocaml/dune#12512, @rgrinberg, @Alizter)

- Introduce a `%{ppx:lib1+..+libn}` stanza to make it possible to refer to ppx
  executables built by dune. This is useful for writing tests (ocaml/dune#12711,
  @rgrinberg)

- Introduce a `(dir ..)` field on packages defined in the `dune-project`. This
  field allows to associate a directory with a particular package. This makes
  dune automatically filter out all stanzas in this directory and its
  descendants with `--only-packages`. All users are recommended to switch to
  using this field. (ocaml/dune#12614, fixes ocaml/dune#3255, @rgrinberg)

- Add support for `DUNE_ROOT` environment variable, similar to the existing
  `--root` CLI parameter. (fixes ocaml/dune#12399 @sir4ur0n)

- Introduce an `unused-libs` alias to detect unused libraries.
  (ocaml/dune#12623, fixes ocaml/dune#650, @rgrinberg)

- Add `--files` flag to `dune describe opam-files` to print only the names of
  the opam files line by line. (ocaml/dune#9793, @reynir and @Alizter)

- `dune exec` now accepts absolute paths inside the workspace.
  (ocaml/dune#12094, @Alizter)

- Add `coqdoc_header` and `coqdoc_footer` fields to the `coq` field of the
  `env` stanza, and to the `coq.theory` stanza, allowing to configure a
  custom header or footer respectively in the HTML output of `coqdoc`.
  (ocaml/dune#11131, @rlepigre)

- Allow `dune fmt` to properly run while a watch mode server is running.
  Note that the `--preview` flag is not supported in this mode.
  (ocaml/dune#12064, @ElectreAAS)

- Support for generating `_CoqProject` files for `coq.theory` stanzas.
  (ocaml/dune#11752, @rlepigre)

- Added `(files)` stanza, similar to `(dirs)` to control which files are visible
  to Dune on a per-directory basis. (ocaml/dune#12879, @nojb)
- Add support for %{ocaml-config:ox} (ocaml/dune#12236, @jonludlam)

- Introduce `dune promotion show` command to display the contents of corrected
  files that are ready for promotion. This allows users to preview changes
  before running `dune promote`. The command accepts file arguments to show
  specific files, or displays all promotable files when called without
  arguments. (ocaml/dune#12669, fixes ocaml/dune#3883, @MixiMaxiMouse)
- New `(lang rocq)` build mode for Rocq 9.0 and later. This new mode
  is very similar to the existing `(lang coq)`, except that it doesn't
  need the `coq*` compatibility wrappers. As of today `(lang rocq)`
  doesn't support yet composed builds with Rocq itself, this will be
  added later.  `(lang coq)` is deprecated, development is frozen, and
  will be removed at some point in the future. (ocaml/dune#12035, @ejgallego,
  @Lysxia, fixes ocaml/dune#11572)

### Changed

- Don't run `ocamldep` to compute false dependencies on the `root_module`
  (ocaml/dune#12227, @rgrinberg)

- `dune format-dune-file` now uses the syntax version of the Dune project that
  contains the file being formatted (if any) instead of using the latest version
  available, which remains the default if there is no Dune project in scope.
  (ocaml/dune#11865, @nojb)

- Persistent DB and process events have been slightly modified. Persistent
  DB events have more concise names and job events always include full
  information. (ocaml/dune#12867, @rgrinberg)

- Removed the `--trace-extended` flag. Its functionality is always enabled when
  tracing is active (ocaml/dune#12908, @rgrinberg)

- The `test/dune` file generated by `dune init proj` now depends on the project library. (ocaml/dune#12791, @shonfeder)

- Starting with version 3.21 of the Dune language, Dune no longer changes the
  default set of compiler warnings. For users that would like to keep the old
  behaviour, the variable `%{dune-warnings}` can be used in an `(env)` stanza in
  a top-level Dune file: `(env (dev (flags :standard %{dune-warnings})))`.
  (ocaml/dune#12766, @nojb)
- Fix: stop generating `cmt` files for cinaps binaries (ocaml/dune#12530, @rgrinberg)
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.

Add %{cmt} to "artifacts variables"

4 participants