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

[3.17] remove breaking change for alpha1 #11164

Merged
merged 2 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@
- Fix an issue where C stubs would be rebuilt whenever the stderr of Dune was
redirected. (#10883, fixes #10882, @nojb)

- Format long lists in s-expressions to fill the line instead of formatting
them in a vertical way (#10892, fixes #10860, @nojb)

- Fix the URL opened by the command `dune ocaml doc`. (#10897, @gridbugs)

- Fix the file referred to in the error/warning message displayed due to the
Expand Down
5 changes: 1 addition & 4 deletions src/dune_lang/format.ml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@ let print_wrapped_list ~version x =
let inner = Pp.concat_map ~sep:Pp.space ~f:pp_simple x in
if version < (2, 8)
then Pp.char '(' ++ Pp.hovbox ~indent:1 inner ++ Pp.char ')'
else
(if version < (3, 17) then Pp.hvbox else Pp.hovbox)
~indent:1
(Pp.char '(' ++ inner ++ Pp.char ')')
else Pp.hvbox ~indent:1 (Pp.char '(' ++ inner ++ Pp.char ')')
;;

let pp_comment_line l = Pp.char ';' ++ Pp.verbatim l
Expand Down
51 changes: 34 additions & 17 deletions test/blackbox-tests/test-cases/describe/describe-workspace-pp.t
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,20 @@ not stable across different setups.
(executables
((names (exe))
(requires
(c39d8e11db2363236e69af7750ce7b9a c9367091ddd9a70d99fc22ede348f17c
1f2b5eb300ea716920494385a31bb5fb 5014e215e204cf8da6c32644cda1b31e
249b2edaf3cc552a247667041bb5f015 ba85adfb1c97e7d7af3df35b16b2fc0d
2363fd46dac995a1c79679dfa1a9881b 43b7cbe1f93f4f502ec614971027cff9
e68a558facd1546b51c7abdbf6aed1cb 24f4eb12e3ff51b310dbf7443c6087be
449445be7a24ce51e119d57e9e255d3f 5ae836dcdead11d5c16815297c5a1ae6
2c61db8e94cb08e0fe642152aee8121a 6fb5d46437c55abca48c8b995f8afa51
(c39d8e11db2363236e69af7750ce7b9a
c9367091ddd9a70d99fc22ede348f17c
1f2b5eb300ea716920494385a31bb5fb
5014e215e204cf8da6c32644cda1b31e
249b2edaf3cc552a247667041bb5f015
ba85adfb1c97e7d7af3df35b16b2fc0d
2363fd46dac995a1c79679dfa1a9881b
43b7cbe1f93f4f502ec614971027cff9
e68a558facd1546b51c7abdbf6aed1cb
24f4eb12e3ff51b310dbf7443c6087be
449445be7a24ce51e119d57e9e255d3f
5ae836dcdead11d5c16815297c5a1ae6
2c61db8e94cb08e0fe642152aee8121a
6fb5d46437c55abca48c8b995f8afa51
f9851d3f8ae32391e7594cf97332a78c))
(modules
(((name Exe)
Expand Down Expand Up @@ -140,7 +147,8 @@ not stable across different setups.
(uid f9851d3f8ae32391e7594cf97332a78c)
(local true)
(requires
(ba85adfb1c97e7d7af3df35b16b2fc0d 2c61db8e94cb08e0fe642152aee8121a
(ba85adfb1c97e7d7af3df35b16b2fc0d
2c61db8e94cb08e0fe642152aee8121a
6fb5d46437c55abca48c8b995f8afa51))
(source_dir _build/default/dummy_ppx)
(modules
Expand Down Expand Up @@ -179,10 +187,14 @@ not stable across different setups.
(uid 2c61db8e94cb08e0fe642152aee8121a)
(local false)
(requires
(ba85adfb1c97e7d7af3df35b16b2fc0d 2363fd46dac995a1c79679dfa1a9881b
5014e215e204cf8da6c32644cda1b31e 43b7cbe1f93f4f502ec614971027cff9
e68a558facd1546b51c7abdbf6aed1cb 24f4eb12e3ff51b310dbf7443c6087be
5ae836dcdead11d5c16815297c5a1ae6 249b2edaf3cc552a247667041bb5f015
(ba85adfb1c97e7d7af3df35b16b2fc0d
2363fd46dac995a1c79679dfa1a9881b
5014e215e204cf8da6c32644cda1b31e
43b7cbe1f93f4f502ec614971027cff9
e68a558facd1546b51c7abdbf6aed1cb
24f4eb12e3ff51b310dbf7443c6087be
5ae836dcdead11d5c16815297c5a1ae6
249b2edaf3cc552a247667041bb5f015
449445be7a24ce51e119d57e9e255d3f))
(source_dir /FINDLIB/ppxlib)
(modules ())
Expand Down Expand Up @@ -284,7 +296,8 @@ not stable across different setups.
(uid f9851d3f8ae32391e7594cf97332a78c)
(local true)
(requires
(ba85adfb1c97e7d7af3df35b16b2fc0d 2c61db8e94cb08e0fe642152aee8121a
(ba85adfb1c97e7d7af3df35b16b2fc0d
2c61db8e94cb08e0fe642152aee8121a
6fb5d46437c55abca48c8b995f8afa51))
(source_dir _build/default/dummy_ppx)
(modules
Expand Down Expand Up @@ -336,10 +349,14 @@ not stable across different setups.
(uid 2c61db8e94cb08e0fe642152aee8121a)
(local false)
(requires
(ba85adfb1c97e7d7af3df35b16b2fc0d 2363fd46dac995a1c79679dfa1a9881b
5014e215e204cf8da6c32644cda1b31e 43b7cbe1f93f4f502ec614971027cff9
e68a558facd1546b51c7abdbf6aed1cb 24f4eb12e3ff51b310dbf7443c6087be
5ae836dcdead11d5c16815297c5a1ae6 249b2edaf3cc552a247667041bb5f015
(ba85adfb1c97e7d7af3df35b16b2fc0d
2363fd46dac995a1c79679dfa1a9881b
5014e215e204cf8da6c32644cda1b31e
43b7cbe1f93f4f502ec614971027cff9
e68a558facd1546b51c7abdbf6aed1cb
24f4eb12e3ff51b310dbf7443c6087be
5ae836dcdead11d5c16815297c5a1ae6
249b2edaf3cc552a247667041bb5f015
449445be7a24ce51e119d57e9e255d3f))
(source_dir /FINDLIB/ppxlib)
(modules ())
Expand Down
24 changes: 16 additions & 8 deletions test/blackbox-tests/test-cases/describe/describe.t
Original file line number Diff line number Diff line change
Expand Up @@ -546,10 +546,14 @@ not stable across different setups.
(uid 2c61db8e94cb08e0fe642152aee8121a)
(local false)
(requires
(ba85adfb1c97e7d7af3df35b16b2fc0d 2363fd46dac995a1c79679dfa1a9881b
5014e215e204cf8da6c32644cda1b31e 43b7cbe1f93f4f502ec614971027cff9
e68a558facd1546b51c7abdbf6aed1cb 24f4eb12e3ff51b310dbf7443c6087be
5ae836dcdead11d5c16815297c5a1ae6 249b2edaf3cc552a247667041bb5f015
(ba85adfb1c97e7d7af3df35b16b2fc0d
2363fd46dac995a1c79679dfa1a9881b
5014e215e204cf8da6c32644cda1b31e
43b7cbe1f93f4f502ec614971027cff9
e68a558facd1546b51c7abdbf6aed1cb
24f4eb12e3ff51b310dbf7443c6087be
5ae836dcdead11d5c16815297c5a1ae6
249b2edaf3cc552a247667041bb5f015
449445be7a24ce51e119d57e9e255d3f))
(source_dir /FINDLIB/ppxlib)
(modules ())
Expand Down Expand Up @@ -1116,10 +1120,14 @@ not stable across different setups.
(uid 2c61db8e94cb08e0fe642152aee8121a)
(local false)
(requires
(ba85adfb1c97e7d7af3df35b16b2fc0d 2363fd46dac995a1c79679dfa1a9881b
5014e215e204cf8da6c32644cda1b31e 43b7cbe1f93f4f502ec614971027cff9
e68a558facd1546b51c7abdbf6aed1cb 24f4eb12e3ff51b310dbf7443c6087be
5ae836dcdead11d5c16815297c5a1ae6 249b2edaf3cc552a247667041bb5f015
(ba85adfb1c97e7d7af3df35b16b2fc0d
2363fd46dac995a1c79679dfa1a9881b
5014e215e204cf8da6c32644cda1b31e
43b7cbe1f93f4f502ec614971027cff9
e68a558facd1546b51c7abdbf6aed1cb
24f4eb12e3ff51b310dbf7443c6087be
5ae836dcdead11d5c16815297c5a1ae6
249b2edaf3cc552a247667041bb5f015
449445be7a24ce51e119d57e9e255d3f))
(source_dir /FINDLIB/ppxlib)
(modules ())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ When a list is indented, there is no extra space at the end.
When there is a long list of atoms, quoted strings, templates and singletons,
it gets wrapped.

$ echo '(library (name dune) (libraries unix stdune fiber xdg dune_re threads opam_file_format dune_lang ocaml_config which_program) (synopsis "Internal Dune library, do not use!") (preprocess (action (run %{project_root}/src/let-syntax/pp.exe %{input-file}))))' | dune format-dune-file --dune-version 3.16
$ echo '(library (name dune) (libraries unix stdune fiber xdg dune_re threads opam_file_format dune_lang ocaml_config which_program) (synopsis "Internal Dune library, do not use!") (preprocess (action (run %{project_root}/src/let-syntax/pp.exe %{input-file}))))' | dune format-dune-file
(library
(name dune)
(libraries
Expand All @@ -68,18 +68,6 @@ it gets wrapped.
(action
(run %{project_root}/src/let-syntax/pp.exe %{input-file}))))

The same file, but in the current version:

$ echo '(library (name dune) (libraries unix stdune fiber xdg dune_re threads opam_file_format dune_lang ocaml_config which_program) (synopsis "Internal Dune library, do not use!") (preprocess (action (run %{project_root}/src/let-syntax/pp.exe %{input-file}))))' | dune format-dune-file
(library
(name dune)
(libraries unix stdune fiber xdg dune_re threads opam_file_format dune_lang
ocaml_config which_program)
(synopsis "Internal Dune library, do not use!")
(preprocess
(action
(run %{project_root}/src/let-syntax/pp.exe %{input-file}))))

In multi-line strings, newlines are escaped, but their syntax is not preserved.

$ dune format-dune-file <<EOF
Expand Down
40 changes: 30 additions & 10 deletions test/blackbox-tests/test-cases/github7034.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@ It builds on its own (with a warning) when lang dune is 3.2 or below:
$ dune printenv --root=inner --field flags
Entering directory 'inner'
(flags
(-w @[email protected]@30..39@[email protected]@[email protected] -strict-sequence
-strict-formats -short-paths -keep-locs))
(-w
@[email protected]@30..39@[email protected]@[email protected]
-strict-sequence
-strict-formats
-short-paths
-keep-locs))
Leaving directory 'inner'
$ dune build --root=inner
Entering directory 'inner'
Expand All @@ -37,8 +41,12 @@ Note that in versions of lang dune above 3.2 this warning becomes an error:
$ dune printenv --root=inner --field flags
Entering directory 'inner'
(flags
(-w @[email protected]@30..39@[email protected]@[email protected]@67@69-40 -strict-sequence
-strict-formats -short-paths -keep-locs))
(-w
@[email protected]@30..39@[email protected]@[email protected]@67@69-40
-strict-sequence
-strict-formats
-short-paths
-keep-locs))
Leaving directory 'inner'
$ dune build --root=inner
Entering directory 'inner'
Expand All @@ -60,8 +68,12 @@ Building the outer project works when lang dune is 3.2 or below:
$ dune printenv --root=outer --field flags
Entering directory 'outer'
(flags
(-w @[email protected]@30..39@[email protected]@[email protected] -strict-sequence
-strict-formats -short-paths -keep-locs))
(-w
@[email protected]@30..39@[email protected]@[email protected]
-strict-sequence
-strict-formats
-short-paths
-keep-locs))
Leaving directory 'outer'

$ dune build --root=outer
Expand All @@ -77,14 +89,22 @@ But when lang dune is 3.3 or higher the warning becomes an error:
$ dune printenv --root=outer --field flags
Entering directory 'outer'
(flags
(-w @[email protected]@30..39@[email protected]@[email protected]@67@69-40 -strict-sequence
-strict-formats -short-paths -keep-locs))
(-w
@[email protected]@30..39@[email protected]@[email protected]@67@69-40
-strict-sequence
-strict-formats
-short-paths
-keep-locs))
Leaving directory 'outer'
$ dune printenv outer/vendored/inner --root=outer --field flags
Entering directory 'outer'
(flags
(-w @[email protected]@30..39@[email protected]@[email protected]@67@69-40 -strict-sequence
-strict-formats -short-paths -keep-locs))
(-w
@[email protected]@30..39@[email protected]@[email protected]@67@69-40
-strict-sequence
-strict-formats
-short-paths
-keep-locs))
Leaving directory 'outer'

$ dune build --root=outer
Expand Down
Loading