Community
Participate
Working Groups
Before the build command is inserted into the makefile a command of the form @echo myTool --option="C:\my files\temp.foo" is inserted. When this is printed the quotes are lost which is confusing. One option is to put single quotes around the buildCmd: @echo 'myTool --option="C:\my files\temp.foo"' however this would fail if buildCmd included a single quote A better solution would be to escape the string being passed to echo: @echo myTool --option=\"C:\\my files\\temp.foo\"
Created attachment 34495 [details] Patch against CDT 3.0.2 RC1 Simple patch - approx. 23 pertinent lines
Created attachment 34497 [details] Patch against CDT 3.0.2 RC1 removing duplicate code Patch that includes removal of 40 lines of duplicate code. Should be functionally equivalent to attachment 34495 [details]. Approx 80 pertinent lines
RC2? There was no 3.0.2 RC2.
Hi Neil, Doug can correct me if I'm wrong, but I believe that 3.0.2 is done, and we have no plans currently for another release on the 3.0 branch. If you could apply your change to Head and generate the patch, that would make my life easier... Thanks, Leo
Sorry - my mistake. Tag was CDT_3_0_2_RC1
That is the plan of record. ISVs are free to take this patch and apply it locally. And if something serious comes up we may still do a 3.0.3. We do need a patch for HEAD to get this into 3.1. Thanks Neil!
No problem - I'm working on it now. HEAD appears to require Eclipse > 3.1.1 - I'll try and get it finished today (UK time)
Hi Neil, Yes, Head requires Eclipse 3.2 M4. And, there is no rush. Thanks again, Leo
Created attachment 34506 [details] Patch against head
I've applied the changes in my workspace where I am making changes for the new dependency calculator interface. I'll check them in at the same time - hopefully this week.
I have committed the changes to Head.
This change has caused a problem - see #133981. The problem occurs with an "announcement" line, and not the echoing of a command line. I haven't thought about this in detail yet. Anyone have a suggestion?
I'm currently thinking that we should return the single quotes to the various "announcement" echos, but keep the new mechanism for command echos. A better solution might be to make the behavior "shell" specific, but we don't currently have any knowledge of the shell the user is using. Please speak up if you object.
Given both the announcement and command lines are being run through the same echo shell command, I don't see the advantage to treating them separately. I also know of tools that use parentheses on their command line. The best we can do (other than knowing which shell we're using or moving away from makefiles) is to produce a command that works with as many shells as possible. The best I can come up with is: - single quote entire string - no need to escape " \ / ( ) characters - replace ' with '"'"' This works correctly on redhat and cygwin. echo on DOS actually prints what you write, but I don't think we ever call that Incidentally - why do we echo the command, then issue it with an @ to suppress the echo? Couldn't we just issue the command without the @ and let it echo naturally?
Hi Neil, (In reply to comment #14) > This works correctly on redhat and cygwin. echo on DOS actually prints what > you write, but I don't think we ever call that We have to worry about Windows for people who want to intagrate a Windows tool-chain (e.g., Visual C++). > Incidentally - why do we echo the command, then issue it with an @ to suppress > the echo? Couldn't we just issue the command without the @ and let it echo > naturally? I don't know the answer to that. MBS has done that since before I got involved. Does anyone else know?
I don't know why either I'm afraid :-(
Hi Leo, With the above escaping scheme, Cygwin users would see the same as on RedHat. For example: Starting build using Microsoft's Compiler(R) MinGW users could well be using the Windows echo in which case they would see: 'Starting build using Microsoft'"'"'s Compiler(R)' This would be a problem with the echo only - the tool would behave correctly. The alternative is to have the build actually break on the other platforms
I asked Sean Evoy (the original MBS developer) about echoing the commands and then invoking them preceded by a '@'. His answer was: "Purely aesthetic on my part: I liked to see the commands as they were being executed. If it causes you problems, by all means get rid of it :-)". So, I'd be willing to try just executing build commands without an 'echo' and the '@'. Then we could go back to enclosing "build progress" echos in single quotes. What do others think?
(In reply to comment #18) Hi Leo, > So, I'd be willing to try just executing build commands without an 'echo' and > the '@'. Then we could go back to enclosing "build progress" echos in single > quotes. What do others think? I agree with you. Mikhail
I agree that seeing the commands being exectued is invaluable for debugging but these should be echoed automatically if we don't prepend the '@' Making this change and going back to single quotes both sound like good idea. Might still be worth replacing ' with '"'"' just in-case
I agree with Leo and Neil. I think the apostrophe issue is so uncommon that it will essentially never come up, but with Neil's fix at least the build will function if it does.
I have committed the change that we agreed to, including "escaping" the single quotes in an echoed string.