--- third_party/WebKit/Source/bindings/core/v8/generated.gyp.orig 2014-08-19 10:15:53.874850750 +0000 +++ third_party/WebKit/Source/bindings/core/v8/generated.gyp 2014-08-19 10:16:04.163050746 +0000 @@ -80,7 +80,6 @@ # Update that regex if command line changes (other than changing flags) 'action': [ 'python', - '-S', # skip 'import site' to speed up startup '<(bindings_scripts_dir)/idl_compiler.py', '--cache-dir', '<(bindings_scripts_output_dir)', --- third_party/WebKit/Source/bindings/modules/v8/generated.gyp.orig 2014-08-19 10:17:07.340279760 +0000 +++ third_party/WebKit/Source/bindings/modules/v8/generated.gyp 2014-08-19 10:17:13.556400768 +0000 @@ -68,7 +68,6 @@ # Update that regex if command line changes (other than changing flags) 'action': [ 'python', - '-S', # skip 'import site' to speed up startup '<(bindings_scripts_dir)/idl_compiler.py', '--cache-dir', '<(bindings_scripts_output_dir)',
While I agree with Adam that supporting system python libraries for linux packaging is not a particular goal of Blink, and we shouldn't go out of our way to support that configuration, I'd actually support this particular change and would approve a CL to remove it.It looks like an unnecessary optimization to me, and frankly I didn't even know what the -S flag did, so it's not very common :). In addition it actually reduces the variety of ways we invoke Python (as Paweł says, these are the only two invocations that use -S). So the change seems to make sense on general code health grounds alone.Adam, does that make sense?
On Thu Aug 28 2014 at 10:12:38 AM Dirk Pranke <dpr...@chromium.org> wrote:
While I agree with Adam that supporting system python libraries for linux packaging is not a particular goal of Blink, and we shouldn't go out of our way to support that configuration, I'd actually support this particular change and would approve a CL to remove it.It looks like an unnecessary optimization to me, and frankly I didn't even know what the -S flag did, so it's not very common :). In addition it actually reduces the variety of ways we invoke Python (as Paweł says, these are the only two invocations that use -S). So the change seems to make sense on general code health grounds alone.Adam, does that make sense?If we're trying to achieve consistency, I would argue that we should add -S to all our invocations of Python instead.
Given the ways that site is used by Linux distros and the ways that packaging of python and add-on python modules differ between systems, my experience is that using -S means that instead of getting a user's random potentially weird/broken python installation, you get an arbitrary *subset* of the user's random potentially weird/broken python installation instead, which may well be considerably more broken than what you started with :)
(Since anything that is on the system's default sys.path will still be there, but things added dynamically by site will be gone)
If we actually wanted to deal with python install nonuniformity we should have a virtualenv or a completely hermetic python. I don't believe that -S actually helps anything other than giving you a potential startup time improvement if site.py happens to be slow on a given system.
We have a working hermetic python solution in the infra repository and should be using that approach in all of our chromium repositories.