Skip to content

Commit

Permalink
Merge pull request #3649 from rgrinberg/fix-3624
Browse files Browse the repository at this point in the history
Fix #3624
  • Loading branch information
rgrinberg authored Jul 27, 2020
2 parents e161637 + 6293082 commit 2f25e48
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ next
- Use `{dev}` rather than `{pinned}` in the generated `.opam` file. (#3647,
@kit-ty-kate)

- Insert correct extension name when editing `dune-project` files. Previously,
dune would just insert the stanza name. (#3649, fixes #3624, @rgrinberg)

2.6.1 (02/07/2020)
------------------

Expand Down
3 changes: 2 additions & 1 deletion src/dune/dune_project.ml
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,8 @@ module Extension = struct
( Project_file_edit.append project_file
(List
[ Dune_lang.atom "using"
; Dune_lang.atom name
; Dune_lang.atom
(Dune_lang.Syntax.name e.syntax)
; Dune_lang.atom
(Dune_lang.Syntax.Version.to_string
version)
Expand Down
13 changes: 13 additions & 0 deletions test/blackbox-tests/dune.inc
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,17 @@
test-cases/coq/extract.t
(progn (run dune-cram run run.t) (diff? run.t run.t.corrected)))))

(rule
(alias coq-github3624)
(deps
(package dune)
(source_tree test-cases/coq/github3624.t)
(alias test-deps))
(action
(chdir
test-cases/coq/github3624.t
(progn (run dune-cram run run.t) (diff? run.t run.t.corrected)))))

(rule
(alias coq-main)
(deps (package dune) (source_tree test-cases/coq/main.t) (alias test-deps))
Expand Down Expand Up @@ -3197,6 +3208,7 @@
(alias contents-depends-on-glob)
(alias copy-files-non-sub-dir-error)
(alias copy_files)
(alias coq-github3624)
(alias corrections)
(alias cross-compilation)
(alias custom-build-dir)
Expand Down Expand Up @@ -3504,6 +3516,7 @@
(alias contents-depends-on-glob)
(alias copy-files-non-sub-dir-error)
(alias copy_files)
(alias coq-github3624)
(alias corrections)
(alias custom-build-dir)
(alias custom-cross-compilation)
Expand Down
8 changes: 8 additions & 0 deletions test/blackbox-tests/test-cases/coq/github3624.t/run.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
In github #3624, dune created a dune-project with an incorrect using line.

$ cat >dune <<EOF
> (coq.theory
> (name foo))
> EOF
$ dune build 2>&1 | grep using
Info: Appending this line to dune-project: (using coq 0.2)

0 comments on commit 2f25e48

Please sign in to comment.