From 6a9c32dcb4a2f0d28a48b67a138818188cbe20f3 Mon Sep 17 00:00:00 2001 From: Jeremie Dimino Date: Wed, 8 Aug 2018 15:23:36 +0100 Subject: [PATCH] Fix bug exposed by previous commit Signed-off-by: Jeremie Dimino --- CHANGES.md | 3 +++ src/workspace.ml | 2 +- test/blackbox-tests/test-cases/envs-and-contexts/run.t | 10 ++-------- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index a28e1a7c..952c61cf 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -12,6 +12,9 @@ next - Fix #1107. `-opaque` wasn't correctly being added to modules without an interface. (#1108, fix #1107, @rgrinberg) +- Fix a bug causing the toplevel `env` stanza in the workspace file to + be ignored when at least one context had `(merlin)` (#1114, @diml) + 1.1.0 (06/08/2018) ------------------ diff --git a/src/workspace.ml b/src/workspace.ml index 9a6cccd8..1723ae3a 100644 --- a/src/workspace.ml +++ b/src/workspace.ml @@ -186,7 +186,7 @@ let t ?x ?profile:cmdline_profile () = Loc.fail (Context.loc ctx) "you can only have one context for merlin" | Opam { merlin = true; _ }, None -> - { merlin_context = Some name; contexts = ctx :: t.contexts; env = None } + { t with contexts = ctx :: t.contexts; merlin_context = Some name } | _ -> { t with contexts = ctx :: t.contexts }) in diff --git a/test/blackbox-tests/test-cases/envs-and-contexts/run.t b/test/blackbox-tests/test-cases/envs-and-contexts/run.t index 7e1eb276..2584a89d 100644 --- a/test/blackbox-tests/test-cases/envs-and-contexts/run.t +++ b/test/blackbox-tests/test-cases/envs-and-contexts/run.t @@ -3,19 +3,13 @@ Regression test for https://github.com/ocaml/dune/issues/1016#issuecomment-41139 $ dune printenv Environment for context dev: ( - (flags - (-w - @a-4-29-40-41-42-44-45-48-58-59-60-40 - -strict-sequence - -strict-formats - -short-paths - -keep-locs)) + (flags (dev-flags)) (ocamlc_flags (-g)) (ocamlopt_flags (-g)) ) Environment for context release: ( - (flags (-w -40)) + (flags (release-flags)) (ocamlc_flags (-g)) (ocamlopt_flags (-g)) )