RESOLVED FIXED Bug 35213
[chromium] hardcoded gcc path breaks solaris build
https://bugs.webkit.org/show_bug.cgi?id=35213
Summary [chromium] hardcoded gcc path breaks solaris build
electricmonopole
Reported 2010-02-21 11:01:10 PST
Created attachment 49152 [details] patches to fix path on solaris http://codereview.chromium.org/650016 There is no /usr/bin/gcc in Solaris and SXCE (Opensolaris has a symlink). Referring here. These patches fix the issue, but a long-term solution is to fix the preprocessor FIXME, as commented in the code.
Attachments
patches to fix path on solaris (2.97 KB, patch)
2010-02-21 11:01 PST, electricmonopole
no flags
revised patch (3.52 KB, patch)
2010-02-21 11:53 PST, electricmonopole
no flags
revised patch with reedited ChangeLog (1.62 KB, patch)
2010-02-21 12:04 PST, electricmonopole
evan: review-
reuploading patch (3.58 KB, patch)
2010-02-22 05:38 PST, electricmonopole
no flags
fix formatting (3.59 KB, application/octet-stream)
2010-02-22 05:47 PST, electricmonopole
no flags
formatting fix again (3.59 KB, patch)
2010-02-22 05:49 PST, electricmonopole
no flags
fix changelog formatting, again (3.59 KB, patch)
2010-02-22 18:51 PST, electricmonopole
levin: review-
seperate into new variable, reformatting again (3.58 KB, patch)
2010-02-24 11:34 PST, electricmonopole
levin: review-
levin: commit-queue-
even more formatting edits (3.56 KB, patch)
2010-02-25 08:11 PST, electricmonopole
levin: review+
levin: commit-queue-
electricmonopole
Comment 1 2010-02-21 11:53:55 PST
Created attachment 49158 [details] revised patch patch made with svn-create-patch script
electricmonopole
Comment 2 2010-02-21 12:04:31 PST
Created attachment 49162 [details] revised patch with reedited ChangeLog fixed and edited flags
Darin Adler
Comment 3 2010-02-21 13:02:20 PST
Comment on attachment 49162 [details] revised patch with reedited ChangeLog Can't land this because there are tabs in the change log. This bug title says "hardcoded gcc path breaks solaris build", but tis patch has nothing to do with that.
Evan Martin
Comment 4 2010-02-22 00:02:36 PST
Comment on attachment 49162 [details] revised patch with reedited ChangeLog r- based on Darin's comments. It looks like patch #3 has different changes than patch #2. - open FILE, "-|", "/usr/bin/gcc", "-E", "-P", "-x", "objective-c", - (map { "-D$_" } split(/ +/, $defines)), "-DOBJC_CODE_GENERATION", $fileName or die "Could not open $fileName"; + if (($Config::Config{'osname'})=~/solaris/i){ + open FILE, "-|", "/usr/sfw/bin/gcc", "-E", "-P", "-x", "objective-c", + (map { "-D$_" } split(/ +/, $defines)), "-DOBJC_CODE_GENERATION", $fileName or die "Could not open $fileName"; + } else { + open FILE, "-|", "/usr/bin/gcc", "-E", "-P", "-x", "objective-c", + (map { "-D$_" } split(/ +/, $defines)), "-DOBJC_CODE_GENERATION", $fileName or die "Could not open $fileName"; + } Rather than duplicate code, why not factor out the gcc path into a variable?
electricmonopole
Comment 5 2010-02-22 05:38:24 PST
Created attachment 49206 [details] reuploading patch For some reason the wrong patch was uploaded. Just great,
electricmonopole
Comment 6 2010-02-22 05:44:25 PST
The previous patch was actually https://bugs.webkit.org/show_bug.cgi?id=35214 which made its way onto here for some reason. @Evan There was a FIXME describing that exact thing. Based on the fact that it's from 2007 and nobody has done it, I figured there was some complicated reason why, hence why I'm leaving it someone more familiar with WebKit, instead of risking something breaking. (I don't have access to a linux machine where I can build WebKit).
electricmonopole
Comment 7 2010-02-22 05:47:29 PST
Created attachment 49208 [details] fix formatting fix formatting in ChangeLog
electricmonopole
Comment 8 2010-02-22 05:49:35 PST
Created attachment 49209 [details] formatting fix again clicked the checkbox with "patch" written inside. Great. Is there a command line alternative to the web interface? My browser is being exciting.
Eric Seidel (no email)
Comment 9 2010-02-22 14:38:43 PST
This patch fails to apply (as you can see by the purple bubbles below the patch). Click on any one of the bubbles to see why.
electricmonopole
Comment 10 2010-02-22 18:51:36 PST
Created attachment 49255 [details] fix changelog formatting, again Previous patch to changelog was against my local copy, which had other changes I've made but haven't been committed. Updated to newest svn, triple checked the patch content again. Hope it works this time...
electricmonopole
Comment 11 2010-02-24 09:59:22 PST
anyone?
David Levin
Comment 12 2010-02-24 11:04:54 PST
Comment on attachment 49255 [details] fix changelog formatting, again > Index: ChangeLog > +2010-02-22 James Choi <jchoi42@pha.jhu.edu> > + > + Change hardcoded gcc paths to be Solaris friendly > + https://bugs.webkit.org/show_bug.cgi?id=35214 > + > + * WebCore/bindings/scripts/CodeGeneratorObjC.pm, WebCore/bindings/scripts/IDLParser.pm, WebCore/css/make-css-file-arrays.pl, WebCore/dom/make_names.pl Each file typically has its own line with a * before it. I imaging that is how prepare-ChangeLog generated it but this looks odd to me. > Index: WebCore/bindings/scripts/CodeGeneratorObjC.pm In each of these changes, the line containing gcc has been duplicated completely. It would be better if the change was only about the gcc location. For example, my $gccLocation = ""; if (($Config::Config{'osname'}) =~ /solaris/i) { $gccLocation = "/usr/sfw/bin/gcc"; } else { $gccLocation = "/usr/sfw/bin/gcc"; } open FILE, "-|", $gccLocation, "-E", "-P", "-x", "objective-c", (map { "-D$_" } split(/ +/, $defines)), "-DOBJC_CODE_GENERATION", $fileName or die "Could not open $fileName"; Also please note the spaces around the =~ and before the {.
David Levin
Comment 13 2010-02-24 11:07:27 PST
(In reply to comment #4) > Rather than duplicate code, why not factor out the gcc path into a variable? I should have just said (again) r- for what Mr. Martin said. :)
electricmonopole
Comment 14 2010-02-24 11:34:29 PST
Created attachment 49416 [details] seperate into new variable, reformatting again
David Levin
Comment 15 2010-02-24 11:59:40 PST
Comment on attachment 49416 [details] seperate into new variable, reformatting again > Index: WebCore/bindings/scripts/CodeGeneratorObjC.pm > =================================================================== > --- WebCore/bindings/scripts/CodeGeneratorObjC.pm (revision 55194) > +++ WebCore/bindings/scripts/CodeGeneratorObjC.pm (working copy) > @@ -222,7 +222,13 @@ sub ReadPublicInterfaces > %publicInterfaces = (); > > my $fileName = "WebCore/bindings/objc/PublicDOMInterfaces.h"; > - open FILE, "-|", "/usr/bin/gcc", "-E", "-P", "-x", "objective-c", > + my $gcclocation Should be gccLocation (since it is two separate words). This should be done throughout the change. Also add = ""; so it should look like this: my $gccLocation = ""; > + if (($Config::Config{'osname'})=~/solaris/i){ You need a space before the { This should be done in several other places too. > + $gcclocation = "/usr/sfw/bin/gcc"; 4 space indent. > + } else { > + $gcclocation = "/usr/bin/gcc"; 4 space indent. > =================================================================== > --- WebCore/bindings/scripts/IDLParser.pm (revision 55194) > +++ WebCore/bindings/scripts/IDLParser.pm (working copy) > @@ -64,7 +64,15 @@ sub Parse > $parentsOnly = shift; > > if (!$preprocessor) { > - $preprocessor = "/usr/bin/gcc -E -P -x c++"; > + # Detect OS. If Solaris, use /usr/sfw/bin/gcc. > + require Config; > + my $gccLocation = ""; > + if (($Config::Config{'osname'})=~/solaris/i){ > + $gcclocation = "/usr/sfw/bin/gcc"; $gccLocation (throughout) > + } else { > + $gcclocation = "/usr/bin/gcc"; > + } > + $preprocessor = $gcclocation . " -E -P -x c++"; > } > > if (!$defines) { > Index: WebCore/css/make-css-file-arrays.pl > =================================================================== > --- WebCore/css/make-css-file-arrays.pl (revision 55194) > +++ WebCore/css/make-css-file-arrays.pl (working copy) > @@ -28,7 +28,15 @@ my $preprocessor; > GetOptions('preprocessor=s' => \$preprocessor); > > if (!$preprocessor) { > - $preprocessor = "/usr/bin/gcc -E -P -x c++"; > + # Detect OS. If Solaris, use /usr/sfw/bin/gcc. > + require Config; > + my $gccLocation = ""; > + if (($Config::Config{'osname'})=~/solaris/i){ > + $gcclocation = "/usr/sfw/bin/gcc"; > + } else { > + $gcclocation = "/usr/bin/gcc"; > + } > + $preprocessor = $gcclocation . " -E -P -x c++"; > } > > my $header = $ARGV[0]; > Index: WebCore/dom/make_names.pl > =================================================================== > --- WebCore/dom/make_names.pl (revision 55194) > +++ WebCore/dom/make_names.pl (working copy) > @@ -47,7 +47,16 @@ my %tags = (); > my %attrs = (); > my %parameters = (); > my $extraDefines = 0; > -my $preprocessor = "/usr/bin/gcc -E -P -x c++"; > +my $preprocessor = ""; Get rid of this line and make the line where you initialize $preprocessor do the "my". > +# Detect OS. If Solaris, use /usr/sfw/bin/gcc. > +require Config; > +my $gccLocation = ""; > +if (($Config::Config{'osname'})=~/solaris/i){ > + $gcclocation = "/usr/sfw/bin/gcc"; > +} else { > + $gcclocation = "/usr/bin/gcc"; > +} > +$preprocessor = $gcclocation . " -E -P -x c++"; > > GetOptions( > 'tags=s' => \$tagsFile,
electricmonopole
Comment 16 2010-02-25 08:11:38 PST
Created attachment 49488 [details] even more formatting edits More formatting things. > Get rid of this line and make the line where you initialize $preprocessor do the "my". Could you explain? :)
David Levin
Comment 17 2010-02-25 08:34:39 PST
Comment on attachment 49488 [details] even more formatting edits I'll do these fixes and land it. There should be spaces around the ~= as noted previously but I missed this in the last review :(. > Index: WebCore/dom/make_names.pl This could be slightly simpler my moving where preprocessor is declared. > +require Config; > +my $gccLocation = ""; > +if (($Config::Config{'osname'})=~/solaris/i) { > + $gccLocation = "/usr/sfw/bin/gcc"; > +} else { > + $gccLocation = "/usr/bin/gcc"; > +} > +my $preprocessor = $gcclocation . " -E -P -x c++"; Something I didn't mention before: I think the comment "Detect OS. ..." is redundant with the code (-- It is a translation of the code into English so it doesn't seem useful), so it should be removed.
WebKit Review Bot
Comment 18 2010-02-25 08:39:02 PST
David Levin
Comment 19 2010-02-25 08:44:50 PST
Two more things I noticed. 1. gccLocation wasn't done consistently which resulted in the busted build noted above. (It is gcclocation in places still.) 2. The ChangeLog entry was in ./ChangeLog instead of WebCore/ChangeLog which is rather odd. In the future use prepare-ChangeLog to create this and it will do the right thing (I just tried it to verify that). I'll fix both of these while landing too.
electricmonopole
Comment 20 2010-02-25 08:57:50 PST
All good points. Thank you for your help :)
David Levin
Comment 21 2010-02-25 09:21:16 PST
Note You need to log in before you can comment on or make changes to this bug.