Make sure all_lib_deps_by_context doesn't report invalid contexts (#723)

This commit is contained in:
Jérémie Dimino 2018-04-25 15:04:57 +01:00 committed by GitHub
parent 239ff0054e
commit 2af69cb303
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -15,6 +15,9 @@ next
compiler might read `.cm*` files recursively (#666, fixes #660,
@emillon)
- Fix a bug causing `jbuilder external-lib-deps` to crash (#723,
@diml)
1.0+beta20 (10/04/2018)
-----------------------

View File

@ -1285,6 +1285,7 @@ let all_lib_deps_by_context t ~request =
| None -> acc
| Some (context, _) -> (context, deps) :: acc)
|> String.Map.of_list_multi
|> String.Map.filteri ~f:(fun ctx _ -> String.Map.mem t.contexts ctx)
|> String.Map.map ~f:(function
| [] -> String.Map.empty
| x :: l -> List.fold_left l ~init:x ~f:Build.merge_lib_deps)