⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 283329 in webkit


Ignore:
Timestamp:
Sep 30, 2021, 1:13:18 PM (5 years ago)
Author:
Fujii Hironori
Message:

Python 3 fails to run run-builtins-generator-tests : ModuleNotFoundError: No module named 'builtins_model'
https://bugs.webkit.org/show_bug.cgi?id=230870

Reviewed by Jonathan Bedard.

Source/JavaScriptCore:

BaseException.message has been deprecated as of Python 2.6. Use
str(e) instead.

Implicit relative imports have been deprecated in Python 3.
Basically, relative imports should be used. However, the scripts
in wkbuiltins directory are flattened when they are copied to
WebKitBuild directory. So, relative imports can't be used.

So, append wkbuiltins directory to sys.path as a workaround.

  • Scripts/generate-js-builtins.py:

Tools:

After r282424 (Bug 229879) switched to python3 for running
run-builtins-generator-tests on Buildbot, only WinCairo buildbot
was failing run-builtins-generator-tests.

run-builtins-generator-tests was invoking generate-js-builtins.py
explictly with 'python'. This is Python 2 on other bots.

Use sys.executable instead of 'python' to invoke
generate-js-builtins.py.

  • Scripts/webkitpy/codegen/main.py:

(BuiltinsGeneratorTests.generate_from_js_builtins):

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r283300 r283329  
     12021-09-30  Fujii Hironori  <Hironori.Fujii@sony.com>
     2
     3        Python 3 fails to run run-builtins-generator-tests : ModuleNotFoundError: No module named 'builtins_model'
     4        https://bugs.webkit.org/show_bug.cgi?id=230870
     5
     6        Reviewed by Jonathan Bedard.
     7
     8        BaseException.message has been deprecated as of Python 2.6. Use
     9        str(e) instead.
     10
     11        Implicit relative imports have been deprecated in Python 3.
     12        Basically, relative imports should be used. However, the scripts
     13        in wkbuiltins directory are flattened when they are copied to
     14        WebKitBuild directory. So, relative imports can't be used.
     15
     16        So, append wkbuiltins directory to sys.path as a workaround.
     17
     18        * Scripts/generate-js-builtins.py:
     19
    1202021-09-29  Mark Lam  <mark.lam@apple.com>
    221
  • trunk/Source/JavaScriptCore/Scripts/generate-js-builtins.py

    r255186 r283329  
    3333import os
    3434import sys
     35
     36sys.path.append(os.path.join(os.path.dirname(__file__), 'wkbuiltins'))
    3537
    3638logging.basicConfig(format='%(levelname)s: %(message)s', level=logging.ERROR)
     
    179181    except ParseException as e:
    180182        if arg_options.test:
    181             log.error(e.message)
     183            log.error(str(e))
    182184        else:
    183185            raise  # Force the build to fail.
  • trunk/Tools/ChangeLog

    r283316 r283329  
     12021-09-30  Fujii Hironori  <Hironori.Fujii@sony.com>
     2
     3        Python 3 fails to run run-builtins-generator-tests : ModuleNotFoundError: No module named 'builtins_model'
     4        https://bugs.webkit.org/show_bug.cgi?id=230870
     5
     6        Reviewed by Jonathan Bedard.
     7
     8        After r282424 (Bug 229879) switched to python3 for running
     9        run-builtins-generator-tests on Buildbot, only WinCairo buildbot
     10        was failing run-builtins-generator-tests.
     11
     12        run-builtins-generator-tests was invoking generate-js-builtins.py
     13        explictly with 'python'. This is Python 2 on other bots.
     14
     15        Use sys.executable instead of 'python' to invoke
     16        generate-js-builtins.py.
     17
     18        * Scripts/webkitpy/codegen/main.py:
     19        (BuiltinsGeneratorTests.generate_from_js_builtins):
     20
    1212021-09-30  John Wilander  <wilander@apple.com>
    222
  • trunk/Tools/Scripts/webkitpy/codegen/main.py

    r271173 r283329  
    2727import os.path
    2828import shutil
     29import sys
    2930import tempfile
    3031from webkitpy.common.checkout.scm.detection import detect_scm_system
     
    3940
    4041    def generate_from_js_builtins(self, builtins_files, output_directory, framework_name="", combined_outputs=False, generate_wrappers=False):
    41         cmd = ['python',
     42        cmd = [sys.executable,
    4243               'JavaScriptCore/Scripts/generate-js-builtins.py',
    4344               '--output-directory', output_directory,
Note: See TracChangeset for help on using the changeset viewer.