Skip to content

Check _boostrap_external.MAGIC_NUMBER has changed when bytecode compatibility was broken to before merging in CI #6814

@moreal

Description

@moreal

Summary

I think a GitHub Actions workflow to check _boostrap_external.MAGIC_NUMBER has changed when bytecode compatibility was broken, is needed to help contributors without blocking from bytecode cache(.pyc files), and let contributors who working on bytecode(compiler) know that the MAGIC_NUMBER should be updated.

NOTE: This issue is not about blaming any contributors, but about automatically preventing problems.

Workaround

Now, if you're blocked by the following errors, you can bypass it by removing all .pyc files. rm -r **/*.pyc

encodings initialization failed. Only utf-8 encoding will be supported.
Traceback (most recent call last):
  File "_frozen_importlib", line 1467, in __import__
  File "_frozen_importlib", line 1388, in _gcd_import
  File "_frozen_importlib", line 1361, in _find_and_load
  File "_frozen_importlib", line 1332, in _find_and_load_unlocked
  File "_frozen_importlib", line 936, in _load_unlocked
  File "_frozen_importlib_external", line 1019, in exec_module
  File "_frozen_importlib_external", line 1154, in get_code
  File "_frozen_importlib_external", line 781, in _compile_bytecode
ValueError: Couldn't deserialize python bytecode

The above exception was the direct cause of the following exception:

RuntimeError: RustPython could not import the encodings module. It usually means something went wrong. Please carefully read the following messages and follow the steps.
...

Details

I don't have a detail idea yet, but it can be automated if there is a rule to determine MAGIC_NUMBER.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions