wyzssw / protobuf-dt

Automatically exported from code.google.com/p/protobuf-dt
0 stars 0 forks source link

Compilation fails with spaces in proto path #220

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Enable protoc integration (on save)
2. Edit a file with a space in the path (e.g. "c:\Documents and 
Settings\...\MyProto.proto")
3. Save

What is the expected output? What do you see instead?
The proto file should be compiled, however the path is passed without being 
quoted or escaped, resulting in incorrect parsing of the arguments by protoc.

What version of the product are you using? On what operating system?
protoc: 2.4.1

Please provide any additional information below.
A simple fix may be to pass the file names encased in quotes.

Original issue reported on code.google.com by m...@thzhang.co.uk on 22 May 2012 at 2:39

GoogleCodeExporter commented 9 years ago
This is a known issue with the protocol buffer compiler, protoc. It is not a 
bug in the Eclipse plug-in. Unfortunately, there is no workaround we can 
provide.

Original comment by alr...@google.com on 23 May 2012 at 11:27

GoogleCodeExporter commented 9 years ago
A quick test shows that protoc *can* compile proto files with spaces in the 
path, if quotes are placed around the parameters. Compare the two examples here:

C:\Temp>"H:\workspace\libraries\Protocol buffers 
2.4.1\protoc-2.4.1-win32\protoc.exe" --proto_path=C:\Temp\Path with spaces\src 
--java_out=C:\Temp\Path with spaces\src-gen C:\Temp\Path with 
spaces\src\protobuf\messages.proto
C:\Temp\Path: warning: directory does not exist.
with: No such file or directory

C:\Temp>"H:\workspace\libraries\Protocol buffers 
2.4.1\protoc-2.4.1-win32\protoc.exe" "--proto_path=C:\Temp\Path with 
spaces\src" "--java_out=C:\Temp\Path with spaces\src-gen" "C:\Temp\Path with 
spaces\src\protobuf\messages.proto"
(nothing printed on stdout or stderr, but Messages.java is created and looks 
correct)

Using protoc 2.4.1 on Windows XP.

Original comment by Thomas.M...@telsis.com on 23 Oct 2012 at 9:19

GoogleCodeExporter commented 9 years ago
Issue 233 has been merged into this issue.

Original comment by alr...@google.com on 13 Dec 2012 at 3:39

GoogleCodeExporter commented 9 years ago
Can you elaborate more why a fix is not feasible? On first glance it kind of 
does look like a problem with the Eclipse plug-in :)

Looks like simply changing the logic here to properly escape command line 
arguments should do the trick:
https://code.google.com/p/protobuf-dt/source/browse/com.google.eclipse.protobuf.
ui/src/com/google/eclipse/protobuf/ui/protoc/command/ProtocCommand.java

Thanks

Original comment by ovel...@google.com on 10 Mar 2013 at 2:43

GoogleCodeExporter commented 9 years ago
I say this IS a bug. Eclipse supports paths with spaces - so should this plugin.

Original comment by dam...@aeromac.com on 25 Mar 2014 at 9:14