Commit f4c6e138 authored by Jeroen Dhollander's avatar Jeroen Dhollander Committed by Commit Bot

Use Python3 for generate_device_policy_remover.py

I tried compiling ChromeOS on a fresh installed gLinux and it failed:

  ACTION //chrome/browser/chromeos:device_policy_remover_generate(//build/toolchain/linux:clang_x64)
  FAILED: gen/chrome/browser/chromeos/device_policy_remover.cc
  python ../../chrome/browser/chromeos/policy/tools/generate_device_policy_remover.py gen/chrome/browser/chromeos/device_policy_remover.cc ../../third_party/protobuf/python pyproto pyproto/components/policy/proto
  Traceback (most recent call last):
    File "../../chrome/browser/chromeos/policy/tools/generate_device_policy_remover.py", line 63, in <module>
      sys.exit(main())
    File "../../chrome/browser/chromeos/policy/tools/generate_device_policy_remover.py", line 31, in main
      from chrome_device_policy_pb2 import ChromeDeviceSettingsProto
    File "pyproto/components/policy/proto/chrome_device_policy_pb2.py", line 7, in <module>
      from google.protobuf import descriptor as _descriptor
    File "../../third_party/protobuf/python/google/protobuf/descriptor.py", line 38, in <module>
      import six
  ImportError: No module named six

This is not easy to work around as it requires pip for Python2 which is
no longer available in apt, so I tried running the script in Python3 and
that seemed to work.

Bug: crbug.com/1112471
Test: compiled
Change-Id: I777c7a1c4562eec500ea487f48f0337b51735010
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2542063Reviewed-by: default avatarDirk Pranke <dpranke@google.com>
Commit-Queue: Jeroen Dhollander <jeroendh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#828013}
parent dc5ffb12
......@@ -4086,8 +4086,7 @@ proto_library("print_job_info_proto") {
device_policy_remover_path = "$target_gen_dir/device_policy_remover.cc"
# TODO(crbug.com/1112471): Get this to run cleanly under Python 3.
python2_action("device_policy_remover_generate") {
action("device_policy_remover_generate") {
script = "policy/tools/generate_device_policy_remover.py"
descriptor_pool_path = "//third_party/protobuf/python"
symbol_database_path = "$root_out_dir/pyproto"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment