Go Back   ZeroC Forums > Bug Reports

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 08-13-2004
Wayetender Wayetender is offline
Registered User
 
 
Join Date: Aug 2004
Posts: 28
Pre-Build needs no spaces!

I noticed that if i did a prebuild in a directory like C:\Documents and Settings it would fail because it thaught you were doing another argument.. a possible way to fix this would be like:
Code:
generate.exe --solutionDir=C:\Documents and settings--ProjectDir=C:\Documents and Settings\project--ProjectName=project
Reply With Quote
  #2 (permalink)  
Old 08-14-2004
michi's Avatar
michi michi is offline
ZeroC Staff
 
Name: Michi Henning
Organization: ZeroC
Project: Ice
 
Join Date: Feb 2003
Location: Brisbane, Australia
Posts: 896
Ah, thanks for the bug report. Most likely, the solution is to put double quotes around the arguments used in the pre-build step in each project. (Your suggestion won't work because, by the time the arguments are passed to generate.cs, they are broken into separate tokens where the spaces are already.) I'll try this on Monday morning when I get to the office.

Bloody spaces in file names -- they've never been a good idea and confuse all sorts of tools...

Cheers,

Michi.
Reply With Quote
  #3 (permalink)  
Old 08-14-2004
Wayetender Wayetender is offline
Registered User
 
 
Join Date: Aug 2004
Posts: 28
Quote:
Originally posted by michi

Bloody spaces in file names -- they've never been a good idea and confuse all sorts of tools...
Yeah, I totally agree with you. I'll try the spaces and see what happens.
Reply With Quote
  #4 (permalink)  
Old 08-16-2004
michi's Avatar
michi michi is offline
ZeroC Staff
 
Name: Michi Henning
Organization: ZeroC
Project: Ice
 
Join Date: Feb 2003
Location: Brisbane, Australia
Posts: 896
I tried various quoting tricks to allow the code to be built if the source tree is installed somewhere where a directory name contains a space, but to no avail. The problem isn't with generate.cs, but with the way Visual C# parses command-line arguments for the pre-build step. While it correctly invokes the generate.exe program if I put double quotes around the executable path in the pre-build step, it incorrectly breaks the executable name into to separate arguments where the space is, so generate.exe (correctly) concludes that it has been given invalid arguments.

For example, if you rename the root directory (icecs) to (ice cs) and try to build, you get a pre-build failure because generate.exe is not found. If you then put double quotes around the command in the pre-build step, generate.exe is executed, but the command-line argument then are:

[0] @"C:\cygwin\home\michi\src\ice"
[1] @"cs\"
[2] @"C:\cygwin\home\michi\src\ice"
[3] @"cs\src\Ice\"
[4] "Ice"

Note that Visual C# splits the first argument into two arguments, which is simply wrong.

This is a bug in Visual C#, and I don't believe there is a fix. My only suggestion is not to build in a directory hierarchy where a directory name contains a space.

Cheers,

Michi.
Reply With Quote
  #5 (permalink)  
Old 08-16-2004
Wayetender Wayetender is offline
Registered User
 
 
Join Date: Aug 2004
Posts: 28
I have an idea, this is what i did with a similar "echo" command for one of my control panels. I would rebuild the string array. Like so.. (assume args is the argument array)
Code:
string text = "";
foreach(string arg in args)
{
	if(text == "")
	{
		text += arg;
	}
	else
	{
		text += " " + arg;
	}
}
Sort of a hack job but it did the trick for me.

**edit again**

I'll add the processing code too. Then assume that each argument would be prepended with a ":" (not allowed in folder names).
Code:
string[] arguments = text.Split(char.Parse(":"));
solution_dir = arguments[0];
project_dir = arguments[1];
project_name = arguments[2];
arguments = arguments[3];
**end of edit**

Last edited by Wayetender : 08-16-2004 at 08:38 PM.
Reply With Quote
  #6 (permalink)  
Old 08-17-2004
michi's Avatar
michi michi is offline
ZeroC Staff
 
Name: Michi Henning
Organization: ZeroC
Project: Ice
 
Join Date: Feb 2003
Location: Brisbane, Australia
Posts: 896
Well, maybe some sort of hack along those lines would work. But, to be honest, I'd rather just say "don't build Ice in a directory that has a space in its name". That's a lot easier and doesn't require writing any code

Cheers,

Michi.
Reply With Quote
  #7 (permalink)  
Old 08-17-2004
Wayetender Wayetender is offline
Registered User
 
 
Join Date: Aug 2004
Posts: 28
Alright, I was just letting you know.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Use spaces instead of tabs Edward Bishop Comments 5 01-24-2007 05:42 PM
Patch #8 for Ice 3.1.0: support for paths with spaces in -I option benoit Patches 2 01-05-2007 04:50 AM
Patch to handle spaces in filenames for slice compilers acbell Patches 1 04-26-2005 05:04 PM
Unable to build demoj using supplied build.xml files vsonnathi Bug Reports 1 10-21-2004 12:34 PM
Pre-Build Failure Wayetender Help Center 8 08-07-2004 07:06 PM


All times are GMT -4. The time now is 08:09 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.