This commit is contained in:
Jeremie Dimino 2018-05-09 16:49:17 +01:00 committed by Jérémie Dimino
parent ba78e05d95
commit ef7a5519aa
3 changed files with 13 additions and 22 deletions

View File

@ -34,6 +34,9 @@ next
- Restore promoted files when they are deleted or changed in the
source tree (#760, fix #759, @diml)
- Fix a crash when using an invalid alias name (#762, fixes #761,
@diml)
1.0+beta20 (10/04/2018)
-----------------------

View File

@ -1159,9 +1159,16 @@ module Alias_conf = struct
; package : Package.t option
}
let alias_name sexp =
let s = string sexp in
if Filename.basename s <> s then
of_sexp_errorf sexp "%S is not a valid alias name" s
else
s
let v1 pkgs =
record
(field "name" string >>= fun name ->
(field "name" alias_name >>= fun name ->
field "deps" (list Dep_conf.t) ~default:[] >>= fun deps ->
field_o "package" (Scope_info.package pkgs) >>= fun package ->
field_o "action" (located Action.Unexpanded.t) >>= fun action ->

View File

@ -1,23 +1,4 @@
$ jbuilder build @bar
Internal error, please report upstream including the contents of _build/log.
Description:
("Alias0.make: Invalid alias" (name foo/bar) (dir _build/default))
Backtrace:
Raised at file "src/stdune/exn.ml", line 32, characters 5-10
Called from file "src/build_system.ml", line 228, characters 8-146
Called from file "src/gen_rules.ml", line 914, characters 16-49
Called from file "src/gen_rules.ml", line 964, characters 8-37
Called from file "src/stdune/list.ml", line 13, characters 10-13
Called from file "src/gen_rules.ml", line 955, characters 4-777
Called from file "src/gen_rules.ml", line 994, characters 19-30
Called from file "src/build_system.ml", line 889, characters 6-62
Called from file "src/build_system.ml", line 865, characters 6-59
Re-raised at file "src/build_system.ml", line 876, characters 6-17
Called from file "src/build_system.ml" (inlined), line 833, characters 32-63
Called from file "src/build_system.ml", line 843, characters 4-24
Called from file "src/build_interpret.ml", line 101, characters 24-40
Called from file "src/build_interpret.ml", line 60, characters 31-43
Called from file "src/build_interpret.ml", line 60, characters 31-43
Called from file "src/build_system.ml", line 1215, characters 10-108
Called from file "src/fiber/fiber.ml", line 359, characters 6-13
File "dune", line 2, characters 8-15:
Error: "foo/bar" is not a valid alias name
[1]