command-line syntax bikeshed time!

55 views
Skip to first unread message

Evan Martin

unread,
May 24, 2013, 10:49:53 PM5/24/13
to ninja-build
Hey ninja-build,

In https://github.com/martine/ninja/issues/580 qhuo reasonably points out that using caret for file outputs is annoying to the point of unusable on Windows.  Perhaps we could use some different syntax for it.  Do you have any advice?  It's easy enough to just pick another character or prefix to be magical, but maybe there's some additional functionality we ought to be planning for.

I think we chose the caret because git uses it for a similar graph traversal.

I'd normally be tempted to say you could combine two things (like, say "ninja $(ninja -t output foo.cc)") except that the whole point of changing the behavior is to make things better on Windows.

Nico Weber

unread,
May 24, 2013, 11:42:58 PM5/24/13
to Evan Martin, ninja-build
What does git do? They use foo^ on posix too, right?


--
You received this message because you are subscribed to the Google Groups "ninja-build" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ninja-build...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Evan Martin

unread,
May 25, 2013, 1:17:32 AM5/25/13
to Nico Weber, ninja-build
Git uses foo^ but it also has foo~1 (foo^^ is the same as foo~2, and so on).  I normally use the latter syntax when I occasionally need to on Windows because of the caret thing.

Evan Martin

unread,
May 25, 2013, 1:47:17 PM5/25/13
to ninja-build
Random thought: maybe because caret doesn't work on Windows, the appropriate Windows character would be something that didn't work on Linux (so it's disjunctive with the existing caret symbol).  Which implies: how about a trailing dollar sign?


On Fri, May 24, 2013 at 7:49 PM, Evan Martin <mar...@danga.com> wrote:

Nicolas Desprès

unread,
May 27, 2013, 3:50:18 AM5/27/13
to Evan Martin, ninja-build
What about @? It is used by make in $@ to describe the file name of the target of the rule: http://www.gnu.org/software/make/manual/html_node/Automatic-Variables.html.
I have been told once that ninja inherits from make :-).


--
You received this message because you are subscribed to the Google Groups "ninja-build" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ninja-build...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Nicolas Desprès

Qingning Huo

unread,
May 28, 2013, 5:10:35 PM5/28/13
to Nicolas Desprès, ninja...@googlegroups.com, Evan Martin

I have another question/request regarding the caret functionality. It seems that the caret syntax always select the first build statement that depends on the given input file. This has two consequences for build statements that share the same input files. (a) which statement is chosen depends purely on their order in the ninja file, (b) there is no equivalent way to select the output files from the other build statement.

So if you are considering a new syntax for this, perhaps we can consider something like rulename: input, or input@rulename.

Thanks
Qingning

Reply all
Reply to author
Forward
0 new messages