Skip to content

Commit

Permalink
Merge pull request #3874 from nojb/alias_cli_handling
Browse files Browse the repository at this point in the history
Uniformize handling of alias targets
  • Loading branch information
rgrinberg authored Oct 21, 2020
2 parents 2371d7f + 6182ac2 commit ba716ed
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ Unreleased
directory unusable when `$ sudo dune install` modified permissions. (fix
#3857, @rgrinberg)

- Fix handling of aliases given on the command line (using the `@` and `@@`
syntax) so as to correctly handle relative paths. (#3874, fixes #3850, @nojb)

2.7.1 (2/09/2020)
-----------------

Expand Down
15 changes: 7 additions & 8 deletions bin/arg.ml
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,20 @@ module Dep = struct
else
(1, true)
in
let s = String.drop s pos in
let dir, alias =
let path = Stdune.Path.Local.of_string s in
Dune_engine.Alias.Name.parse_local_path (Loc.none, path)
in
Some (recursive, dir, alias)
let s = String_with_vars.make_text Loc.none (String.drop s pos) in
Some
( if recursive then
Dep_conf.Alias_rec s
else
Dep_conf.Alias s )

let dep_parser =
Dune_lang.Syntax.set Stanza.syntax (Active Stanza.latest_version)
Dep_conf.decode

let parser s =
match parse_alias s with
| Some (true, dir, name) -> `Ok (alias_rec ~dir name)
| Some (false, dir, name) -> `Ok (alias ~dir name)
| Some dep -> `Ok dep
| None -> (
match
Dune_lang.Decoder.parse dep_parser Univ_map.empty
Expand Down

0 comments on commit ba716ed

Please sign in to comment.