New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 666161 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Feb 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

make_css_property_names et al fail mysteriously if gperf unavailable

Project Member Reported by djd@chromium.org, Nov 17 2016

Issue description

OS: Linux

What steps will reproduce the problem?
(1) fresh checkout of chromium (no previously installed build tools)
(2) ninja -C etc. webkit_layout_tests

What is the expected result?

Build succeeds
  OR
When build fails, it prints a useful error which describes the error (in this case, I need to install gperf with build/install-build-deps.sh )


What happens instead?

Unhelpful stacktrace from python with no mention of missing gperf:

[48/17064] ACTION //third_party/WebKit/Source/core:make_core_generated_css_property_names(//build/toolchain/linux:clang_x64)
FAILED: gen/blink/core/CSSPropertyNames.cpp gen/blink/core/CSSPropertyNames.h
python ../../third_party/WebKit/Source/build/scripts/make_css_property_names.py ../../third_party/WebKit/Source/core/css/CSSProperties.in --output_dir gen/blink/core --gperf gperf
Traceback (most recent call last):
  File "../../third_party/WebKit/Source/build/scripts/make_css_property_names.py", line 238, in <module>
    in_generator.Maker(CSSPropertyNamesWriter).main(sys.argv)
  File "/usr/local/google/home/djd/chromium/src/third_party/WebKit/Source/build/scripts/in_generator.py", line 108, in main
    writer.write_files(options.output_dir)
  File "/usr/local/google/home/djd/chromium/src/third_party/WebKit/Source/build/scripts/in_generator.py", line 60, in write_files
    self._write_file_if_changed(output_dir, generator(), file_name)
  File "../../third_party/WebKit/Source/build/scripts/make_css_property_names.py", line 233, in generate_implementation
    gperf = subprocess.Popen(gperf_args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, universal_newlines=True)
  File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
[79/17064] CXX obj/third_party/angle/libANGLE/Caps.o
 
Cc: tkent@chromium.org eseidel@chromium.org brat...@opera.com scottmg@chromium.org
Components: Blink>CSS
It looks like the CSS team owns this script, I'm assigning component Blink>CSS.

Also adding to CC a couple of people who seem to have touched the gperf related lines in third_party/WebKit/Source/build/scripts/make_css_property_names.py

Comment 2 by samli@chromium.org, Nov 20 2016

Labels: -Pri-3 Pri-2
Status: Available (was: Untriaged)

Comment 3 by samli@chromium.org, Nov 21 2016

Labels: Hotlist-CodeHealth

Comment 4 by timloh@chromium.org, Nov 21 2016

Is this something we actually care about? Chrome uses a non-standard build process (i.e. not ./configure && make) so to get into this state I think you'd have to follow the build steps but skip some steps, which seems like user error to me. I'd expect there are lots more non-obvious errors by having varying sets of build dependencies missing.
Yes. 

You don't have to actually do anything useful, but you should atleast report a useful error message.

One solution is to just add "shell=True" to that command line. I assume you don't want to do this because you want it to work well on Windows. Hence you can use this patch -> https://codereview.chromium.org/2521893002/
Status: WontFix (was: Available)
build/install-build-deps.sh is part of setting up a build environment.
Status: Available (was: WontFix)
gperf being installed via build/install-build-deps.sh doesn't excuse you from returning useful error messages.

How did I know that I have to run build/install-build-deps.sh after you CL added gperf as a required dependency?

What if I accidently uninstalled gperf, how do I know that this is a missing dependency error?

The current error message is "OSError: [Errno 2] No such file or directory" which normally means a missing file - not a missing executable. It took two people ~15 minutes of wasted time because this error message is so poor.
I even created a fix for you (which took ~5 minutes) -> https://codereview.chromium.org/2521893002/
gperf has been required at least since Blink was WebKit, and probably long before that.

The error's coming from subprocess.Popen(), so it seems pretty clear to me what's not found. But /shrug.
Project Member

Comment 10 by bugdroid1@chromium.org, Jan 31 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7eb63c7a0993f13b444e4a2fda274d0d7df9a576

commit 7eb63c7a0993f13b444e4a2fda274d0d7df9a576
Author: tansell <tansell@chromium.org>
Date: Tue Jan 31 17:28:33 2017

webkit: Catch OSError for when gperf isn't avaliable.

Previously the error output would look like this;
----
[48/17064] ACTION //third_party/WebKit/Source/core:make_core_generated_css_property_names(//build/toolchain/linux:clang_x64)
FAILED: gen/blink/core/CSSPropertyNames.cpp gen/blink/core/CSSPropertyNames.h
python ../../third_party/WebKit/Source/build/scripts/make_css_property_names.py ../../third_party/WebKit/Source/core/css/CSSProperties.in --output_dir gen/blink/core --gperf gperf
Traceback (most recent call last):
  File "../../third_party/WebKit/Source/build/scripts/make_css_property_names.py", line 238, in <module>
    in_generator.Maker(CSSPropertyNamesWriter).main(sys.argv)
  File "/usr/local/google/home/djd/chromium/src/third_party/WebKit/Source/build/scripts/in_generator.py", line 108, in main
    writer.write_files(options.output_dir)
  File "/usr/local/google/home/djd/chromium/src/third_party/WebKit/Source/build/scripts/in_generator.py", line 60, in write_files
    self._write_file_if_changed(output_dir, generator(), file_name)
  File "../../third_party/WebKit/Source/build/scripts/make_css_property_names.py", line 233, in generate_implementation
    gperf = subprocess.Popen(gperf_args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, universal_newlines=True)
  File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
[79/17064] CXX obj/third_party/angle/libANGLE/Caps.o
----
ninja: Entering directory `out/Release'
[2/3] ACTION //third_party/WebKit/Source/core:make_core_generated_css_property_names(//build/toolchain/linux:clang_x64)
FAILED: python ../../third_party/WebKit/Source/build/scripts/make_css_property_names.py ../../third_party/WebKit/Source/core/css/CSSProperties.in --output_dir gen/blink/core --gperf gperf
--key-positions=*: gperf: command not found
Traceback (most recent call last):
  File "../../third_party/WebKit/Source/build/scripts/make_css_property_names.py", line 238, in <module>
    in_generator.Maker(CSSPropertyNamesWriter).main(sys.argv)
  File "/fast/chrome/src/third_party/WebKit/Source/build/scripts/in_generator.py", line 108, in main
    writer.write_files(options.output_dir)
  File "/fast/chrome/src/third_party/WebKit/Source/build/scripts/in_generator.py", line 60, in write_files
    self._write_file_if_changed(output_dir, generator(), file_name)
  File "../../third_party/WebKit/Source/build/scripts/make_css_property_names.py", line 234, in generate_implementation
    return subprocess.check_output(gperf_args, universal_newlines=True, shell=True)
  File "/usr/lib/python2.7/subprocess.py", line 573, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['gperf', '--key-positions=*', '-P', '-n', '-m', '50', '-D']' returned non-zero exit status 127
----

BUG= 666161 

Review-Url: https://codereview.chromium.org/2521893002
Cr-Commit-Position: refs/heads/master@{#447256}

[modify] https://crrev.com/7eb63c7a0993f13b444e4a2fda274d0d7df9a576/third_party/WebKit/Source/build/scripts/make_css_property_names.py

Labels: Update-Monthly
tansell - Is this now fixed? If not, what remains?

I ran into this the other day and was confused because I thought my change had landed. Turned out I also needed to make the same change in third_party/WebKit/Source/build/scripts/make_css_value_keywords.py

See https://codereview.chromium.org/2521893002

Once that lands, this can be marked as fixed.
Sorry that should have been https://codereview.chromium.org/2521893002
Project Member

Comment 14 by bugdroid1@chromium.org, Feb 13 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9eb78b78bdc41b99596e1b03c40e8eabfa6fe957

commit 9eb78b78bdc41b99596e1b03c40e8eabfa6fe957
Author: tansell <tansell@chromium.org>
Date: Mon Feb 13 22:08:21 2017

webkit: Catch OSError for when gperf isn't avaliable.

This was fixed for make_css_property_names.py in
https://crrev.com/2521893002 but I missed make_css_value_keywords.py
which also needed the change.

Previously the error output would look like this;
----
[48/17064] ACTION //third_party/WebKit/Source/core:make_core_generated_css_property_names(//build/toolchain/linux:clang_x64)
FAILED: gen/blink/core/CSSPropertyNames.cpp gen/blink/core/CSSPropertyNames.h
python ../../third_party/WebKit/Source/build/scripts/make_css_property_names.py ../../third_party/WebKit/Source/core/css/CSSProperties.in --output_dir gen/blink/core --gperf gperf
Traceback (most recent call last):
  File "../../third_party/WebKit/Source/build/scripts/make_css_property_names.py", line 238, in <module>
    in_generator.Maker(CSSPropertyNamesWriter).main(sys.argv)
  File "/usr/local/google/home/djd/chromium/src/third_party/WebKit/Source/build/scripts/in_generator.py", line 108, in main
    writer.write_files(options.output_dir)
  File "/usr/local/google/home/djd/chromium/src/third_party/WebKit/Source/build/scripts/in_generator.py", line 60, in write_files
    self._write_file_if_changed(output_dir, generator(), file_name)
  File "../../third_party/WebKit/Source/build/scripts/make_css_property_names.py", line 233, in generate_implementation
    gperf = subprocess.Popen(gperf_args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, universal_newlines=True)
  File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
[79/17064] CXX obj/third_party/angle/libANGLE/Caps.o
----
ninja: Entering directory `out/Release'
[2/3] ACTION //third_party/WebKit/Source/core:make_core_generated_css_property_names(//build/toolchain/linux:clang_x64)
FAILED: python ../../third_party/WebKit/Source/build/scripts/make_css_property_names.py ../../third_party/WebKit/Source/core/css/CSSProperties.in --output_dir gen/blink/core --gperf gperf
--key-positions=*: gperf: command not found
Traceback (most recent call last):
  File "../../third_party/WebKit/Source/build/scripts/make_css_property_names.py", line 238, in <module>
    in_generator.Maker(CSSPropertyNamesWriter).main(sys.argv)
  File "/fast/chrome/src/third_party/WebKit/Source/build/scripts/in_generator.py", line 108, in main
    writer.write_files(options.output_dir)
  File "/fast/chrome/src/third_party/WebKit/Source/build/scripts/in_generator.py", line 60, in write_files
    self._write_file_if_changed(output_dir, generator(), file_name)
  File "../../third_party/WebKit/Source/build/scripts/make_css_property_names.py", line 234, in generate_implementation
    return subprocess.check_output(gperf_args, universal_newlines=True, shell=True)
  File "../../third_party/WebKit/Source/build/scripts/make_css_property_names.py", line 242, in generate_implementation
    raise subprocess.CalledProcessError(127, gperf_args, output='Command not found.')
subprocess.CalledProcessError: Command '['gperf', '--key-positions=*', '-P', '-n', '-m', '50', '-D']' returned non-zero exit status 127
----

BUG= 666161 

Review-Url: https://codereview.chromium.org/2691083003
Cr-Commit-Position: refs/heads/master@{#450111}

[modify] https://crrev.com/9eb78b78bdc41b99596e1b03c40e8eabfa6fe957/third_party/WebKit/Source/build/scripts/make_css_value_keywords.py

Cc: -tansell@chromium.org
Owner: tansell@chromium.org
Status: Fixed (was: Available)

Sign in to add a comment