Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uniformize handling of alias targets #3874

Merged
merged 2 commits into from
Oct 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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