RESOLVED FIXED 35551
Hardcoding of /usr/bin/gcc in perl build scripts
https://bugs.webkit.org/show_bug.cgi?id=35551
Summary Hardcoding of /usr/bin/gcc in perl build scripts
Fred Ollinger
Reported Monday, March 1, 2010 11:39:01 PM UTC
Created attachment 49760 [details] Patch to change /usr/bin/gcc to $ENV{CC} in perl build scripts. Recently when trying to cross the nightly build: r55354, I noticed that several Perl scripts hardcoded the path to /usr/bin/gcc. Obviously, this completely breaks a cross compile as a cross compiler should not be installed in /usr/bin/gcc; that's where the native compiler is NOT the cross compiler. There are four perl build scripts that hard code /usr/bin/gcc as the default compiler. This is true even if one has chosen to cross-compile. This should effectively break cross-compiling as there is no way to tell ./configure that gcc is located in an alternate location. This bug will also break use of another compiler other than gcc. It will also break using a different version of gcc if it is not installed in the default location of /usr/bin/gcc. To fix this, I first isolated the areas where /usr/bin/gcc was called from Perl. Then I changed references from "/usr/bin/gcc" to $ENV{CC} which will allow a user to use any version of gcc that they wish. Patch is attached. 1. bindings/scripts/CodeGeneratorObjC.pm 2. bindings/scripts/IDLParser.pm 3. css/make-css-file-arrays.pl 4. dom/make_names.pl Fred Ollinger Embedded Software Engineer Seektech, Incorporated http://www.seektechinc.com/ fred_ollinger@seektech.com
Attachments
Patch to change /usr/bin/gcc to $ENV{CC} in perl build scripts. (2.40 KB, patch)
2010-03-01 15:39 PST, Fred Ollinger
commit-queue: review-
commit-queue: commit-queue-
remove hardcoded refs to gcc's path (2.32 KB, patch)
2010-05-26 19:19 PDT, Lucas De Marchi
darin: review-
darin: commit-queue-
remove hardcoded refs to gcc's path (3.06 KB, patch)
2010-05-26 23:24 PDT, Lucas De Marchi
no flags
Patch (2.77 KB, patch)
2010-05-29 06:29 PDT, Lucas De Marchi
no flags
WebKit Commit Bot
Comment 1 Monday, March 1, 2010 11:49:31 PM UTC
Comment on attachment 49760 [details] Patch to change /usr/bin/gcc to $ENV{CC} in perl build scripts. Rejecting patch 49760 from review queue. Fred_Ollinger@seektech.com does not have reviewer permissions according to http://trac.webkit.org/browser/trunk/WebKitTools/Scripts/webkitpy/committers.py. - If you do not have reviewer rights please read http://webkit.org/coding/contributing.html for instructions on how to use bugzilla flags. - If you have reviewer rights please correct the error in WebKitTools/Scripts/webkitpy/committers.py by adding yourself to the file (no review needed). Due to bug 30084 the commit-queue will require a restart after your change. Please contact eseidel@chromium.org to request a commit-queue restart. After restart the commit-queue will correctly respect your reviewer rights.
WebKit Commit Bot
Comment 2 Tuesday, March 2, 2010 12:05:58 AM UTC
Comment on attachment 49760 [details] Patch to change /usr/bin/gcc to $ENV{CC} in perl build scripts. Rejecting patch 49760 from commit-queue. Fred_Ollinger@seektech.com does not have committer permissions according to http://trac.webkit.org/browser/trunk/WebKitTools/Scripts/webkitpy/committers.py. - If you do not have committer rights please read http://webkit.org/coding/contributing.html for instructions on how to use bugzilla flags. - If you have committer rights please correct the error in WebKitTools/Scripts/webkitpy/committers.py by adding yourself to the file (no review needed). Due to bug 30084 the commit-queue will require a restart after your change. Please contact eseidel@chromium.org to request a commit-queue restart. After restart the commit-queue will correctly respect your committer rights.
Eric Seidel (no email)
Comment 3 Tuesday, March 2, 2010 1:33:54 AM UTC
I assume you may have meant to set these r? Please see http://webkit.org/coding/contributing.html
Lucas De Marchi
Comment 4 Thursday, May 27, 2010 3:19:52 AM UTC
Created attachment 57186 [details] remove hardcoded refs to gcc's path Updated version of this old patch, fulfilling requirements for patches sent to WebKit.
WebKit Review Bot
Comment 5 Thursday, May 27, 2010 4:34:10 AM UTC
Darin Adler
Comment 6 Thursday, May 27, 2010 4:39:50 AM UTC
Comment on attachment 57186 [details] remove hardcoded refs to gcc's path This will not work on my computers, for example. I don't think that most OS X users have an environment variable named "CC" set in their environment. Perhaps you could use the environment variable if it exists, and otherwise use the hardcoded path.
WebKit Review Bot
Comment 7 Thursday, May 27, 2010 5:07:16 AM UTC
Lucas De Marchi
Comment 8 Thursday, May 27, 2010 6:23:06 AM UTC
(In reply to comment #6) > (From update of attachment 57186 [details]) > This will not work on my computers, for example. I don't think that most OS X users have an environment variable named "CC" set in their environment. Perhaps you could use the environment variable if it exists, and otherwise use the hardcoded path. Why are we hard-coding the path? Isn't it better to use the CC environment var and fall-back to the default path?
Lucas De Marchi
Comment 9 Thursday, May 27, 2010 7:24:30 AM UTC
Created attachment 57197 [details] remove hardcoded refs to gcc's path Is this good for MacOS?
David Levin
Comment 10 Thursday, May 27, 2010 8:55:02 PM UTC
Comment on attachment 57197 [details] remove hardcoded refs to gcc's path This patch doesn't do this "Perhaps you could use the environment variable if it exists, and otherwise use the hardcoded path" as suggested in the comments. Also, the variable name change is superfluous (and without that change, less lines of code are changed).
Lucas De Marchi
Comment 11 Friday, May 28, 2010 1:20:59 AM UTC
(In reply to comment #10) > (From update of attachment 57197 [details]) > This patch doesn't do this "Perhaps you could use the environment variable if it exists, and otherwise use the hardcoded path" as suggested in the comments. > I know. Did you see my comment above? What's the point in using the complete path when the PATH environment variable can help? > Also, the variable name change is superfluous (and without that change, less lines of code are changed). More lines of code are changed, but the variable name will make sense since with this patch it will not necessarily contain the path. I could do what was suggested, but I'm still convinced it's not the right thing to do.
Lucas De Marchi
Comment 12 Saturday, May 29, 2010 2:29:24 PM UTC
Created attachment 57409 [details] Patch Here is the patch as suggested Darin. I'd rather take the previous patch I sent since it seems to be a better idea. But, anyway, here is the other patch.
Darin Adler
Comment 13 Sunday, May 30, 2010 4:25:31 AM UTC
We definitely don't want to do anything that relies on PATH, so I do not think the previous patch was a better idea.
WebKit Commit Bot
Comment 14 Sunday, May 30, 2010 4:49:23 AM UTC
Comment on attachment 57409 [details] Patch Clearing flags on attachment: 57409 Committed r60413: <http://trac.webkit.org/changeset/60413>
WebKit Commit Bot
Comment 15 Sunday, May 30, 2010 4:49:30 AM UTC
All reviewed patches have been landed. Closing bug.
Lucas De Marchi
Comment 16 Thursday, June 3, 2010 1:21:11 AM UTC
*** Bug 24454 has been marked as a duplicate of this bug. ***
Note You need to log in before you can comment on or make changes to this bug.