diff --git a/CHANGES.md b/CHANGES.md index 77ff99b078f..1431f0c2101 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,9 @@ Unreleased ---------- +- Allow spaces in the directory argument of the `subdir` stanza (#4943, fixes + #4907, @rgrinberg) + - Add a `%{toolchain}` expansion variable (#4899, fixes #3949, @rgrinberg) - Include dependencies of executables when creating toplevels (either `dune diff --git a/src/dune_engine/sub_dirs.ml b/src/dune_engine/sub_dirs.ml index 0cfdecf211f..ec9f9efde9b 100644 --- a/src/dune_engine/sub_dirs.ml +++ b/src/dune_engine/sub_dirs.ml @@ -313,7 +313,7 @@ let decode_includes ~context = let* loc = loc in let* name, path = plain_string (fun ~loc s -> - (Atom (loc, Dune_lang.Atom.of_string s), s :: path)) + (Dune_lang.Ast.atom_or_quoted_string loc s, s :: path)) in let+ nodes = fields (decode ~context ~path ~inside_include) in let required_version = (2, 7) in diff --git a/test/blackbox-tests/test-cases/subdir-stanza.t/run.t b/test/blackbox-tests/test-cases/subdir-stanza/basic.t similarity index 100% rename from test/blackbox-tests/test-cases/subdir-stanza.t/run.t rename to test/blackbox-tests/test-cases/subdir-stanza/basic.t diff --git a/test/blackbox-tests/test-cases/subdir-stanza/gh4907.t b/test/blackbox-tests/test-cases/subdir-stanza/gh4907.t new file mode 100644 index 00000000000..8b3618a882c --- /dev/null +++ b/test/blackbox-tests/test-cases/subdir-stanza/gh4907.t @@ -0,0 +1,8 @@ + + $ cat <dune-project + > (lang dune 3.0) + > EOF + $ cat <dune + > (subdir "foo bar" (rule (with-stdout-to foo (echo foo)))) + > EOF + $ dune build