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

The caret character is a special in cmd.exe on Windows #580

Open
qhuo opened this issue May 22, 2013 · 5 comments
Open

The caret character is a special in cmd.exe on Windows #580

qhuo opened this issue May 22, 2013 · 5 comments
Labels

Comments

@qhuo
Copy link
Contributor

qhuo commented May 22, 2013

The caret character (^) is a great feature of ninja, which allows one to build the object file specifying only the source file. However, as it is a special character in cmd.exe, it is very awkward to use on Windows. One has to 2 carets when invoking ninja on Windows cmd windows. And the number of carets have to be doubled or redoubled depending on how many levels of system() call (or cmd.exe invocation) are involved. In our case, we have a wrapper program, which runs ninja either locally or through the Incredibuild engine, so we have to use 4 or 8 carets characters.

It would be great if another character can be chose for this feature, or better yet, create a command line option for this.

@evmar
Copy link
Collaborator

evmar commented May 23, 2013

The reason I didn't use a command-line option in the first place is because (in theory) you could do something like
ninja foo.o bar.cc^
and control it on a per-argument basis. That is pretty weak, though.

Is there a different character on Windows that will make it through, but that doesn't often exist in filenames?

@evmar
Copy link
Collaborator

evmar commented May 23, 2013

Maybe some prefix would work, like "output:foo.cc"

@qhuo
Copy link
Contributor Author

qhuo commented May 24, 2013

@martine, personally I don't mind losing the ability of mixing normal target and the output(^) on the same command line.

But if you are looking for a new special charater, cmd's help doc says the following special characters require quotes, &()[]{}^=;!'+,`~ and . Perhaps we can use "@"? This is a valid char for file names on both windows and linux, but I suppose it's not often used.

@ddevienne
Copy link

@file is often used for "response file" though, to put long command line switches into a file, and thus work-around CLI limitations of some shells.

@qhuo
Copy link
Contributor Author

qhuo commented May 24, 2013

@ddevienne, yes, but this should not prevent ninja taking path/to/foo.cpp@ as a command line argument. As far as I know, ninja does not pass foo.cpp@ to any of the build actions.

@jhasse jhasse added the windows label May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants