mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 10:44:36 +08:00
* Align compiler and AST behavior with CPython
Update the compiler pipeline, AST module support, and related VM compile/eval paths toward CPython 3.14 behavior.
Use upstream Ruff parser crates directly and keep RustPython-specific syntax preflight handling in the compile path.
Refresh opcode metadata, snapshots, and targeted tests for the aligned bytecode and AST behavior.
* fix
* Fix PR 8138 CI failures
* Fix match mapping wildcard scan complexity
* fixes
* Use Ruff runtime AST fields
* Minimize residual patch diff
* refactor error handling
* Remove _ast conversion context wrappers
* Clean up _ast conversion glue and compiler warning escalation
Rename the Node conversion parameter `ctx` to `vm` throughout the _ast
module.
Remove the unused compile_program, compile_program_single,
compile_block_expression, and compile_expression forwarders; compile_top
stays as the entry point.
Stash an escalated compiler SyntaxWarning so a non-SyntaxWarning category
propagates unchanged instead of being rewritten to SyntaxError, matching
PyErr_ExceptionMatches(SyntaxWarning) in compiler_warn. Drop the now-unused
CompileWarningError::into_codegen_error.
Replace the PositionalArguments two-variant enum with a struct holding a
shared range and a PositionalArgumentsKind enum.
Assisted-by: Claude
* Represent compiler flags as a CompilerFlags bitflags
Replace the loose PY_CF_*/CO_* i32 constants in compile_mode with a
CompilerFlags bitflags covering the PyCF_* flags and __future__
CO_FUTURE_* bits. The Python-visible ast.PyCF_* attribute values are
derived from it via bits(); parser input modes stay plain consts.
builtins::compile and the compile_string flag handling test flags
through CompilerFlags::contains instead of raw bit math.
Assisted-by: Claude
* Fix PR 8138 test regressions
* Fix PR 8138 CI failures
* Avoid shell interpolation in Linux deps action
* Fix review findings in compiler/AST changes
- frame.rs: compute the MATCH_CLASS class name lazily so a successful
match no longer takes the type name lock or allocates; the
__match_args__-not-a-tuple branch reuses it instead of recomputing.
- _ast/constant.rs: add the missing leading space to the with_recursion
label ("maximum recursion depth exceeded during compilation").
- sys.set_int_max_str_digits: restore the "maxdigits must be 0 or larger
than {n}" error text.
- codegen: set CO_MAXBLOCKS to 20 in both ir.rs and compile.rs.
- _ast/exception.rs: extract the duplicated excepthandler node guard
into ensure_excepthandler_node.
- codegen: correct the validate_keywords doc comment.
- Drop redundant "CPython" qualifiers from comments added in this branch.
Assisted-by: Claude
75 lines
2.4 KiB
YAML
75 lines
2.4 KiB
YAML
# This action installs a few dependencies necessary to build RustPython on Linux.
|
|
# It can be configured depending on which libraries are needed:
|
|
#
|
|
# ```
|
|
# - uses: ./.github/actions/install-linux-deps
|
|
# with:
|
|
# gcc-multilib: true
|
|
# musl-tools: false
|
|
# ```
|
|
#
|
|
# See the `inputs` section for all options and their defaults. Note that you must checkout the
|
|
# repository before you can use this action.
|
|
#
|
|
# This action will only install dependencies when the current operating system is Linux. It will do
|
|
# nothing on any other OS (macOS, Windows).
|
|
|
|
name: Install Linux dependencies
|
|
description: Installs the dependencies necessary to build RustPython on Linux.
|
|
inputs:
|
|
gcc-multilib:
|
|
description: Install gcc-multilib (gcc-multilib)
|
|
required: false
|
|
default: "false"
|
|
musl-tools:
|
|
description: Install musl-tools (musl-tools)
|
|
required: false
|
|
default: "false"
|
|
gcc-aarch64-linux-gnu:
|
|
description: Install gcc-aarch64-linux-gnu (gcc-aarch64-linux-gnu)
|
|
required: false
|
|
default: "false"
|
|
clang:
|
|
description: Install clang (clang)
|
|
required: false
|
|
default: "false"
|
|
runs:
|
|
using: composite
|
|
steps:
|
|
- name: Install Linux dependencies
|
|
shell: bash
|
|
if: ${{ runner.os == 'Linux' }}
|
|
env:
|
|
GCC_MULTILIB: ${{ inputs.gcc-multilib }}
|
|
MUSL_TOOLS: ${{ inputs.musl-tools }}
|
|
CLANG: ${{ inputs.clang }}
|
|
GCC_AARCH64_LINUX_GNU: ${{ inputs.gcc-aarch64-linux-gnu }}
|
|
run: |
|
|
if ! sudo apt-get update; then
|
|
echo "::warning::apt-get update failed; disabling nonessential Microsoft apt sources and retrying"
|
|
for source in /etc/apt/sources.list.d/*microsoft* /etc/apt/sources.list.d/*azure-cli*; do
|
|
if [ -e "$source" ]; then
|
|
sudo mv "$source" "$source.disabled"
|
|
fi
|
|
done
|
|
sudo apt-get update
|
|
fi
|
|
|
|
packages=()
|
|
if [[ "$GCC_MULTILIB" == "true" ]]; then
|
|
packages+=(gcc-multilib)
|
|
fi
|
|
if [[ "$MUSL_TOOLS" == "true" ]]; then
|
|
packages+=(musl-tools)
|
|
fi
|
|
if [[ "$CLANG" == "true" ]]; then
|
|
packages+=(clang)
|
|
fi
|
|
if [[ "$GCC_AARCH64_LINUX_GNU" == "true" ]]; then
|
|
packages+=(gcc-aarch64-linux-gnu linux-libc-dev-arm64-cross libc6-dev-arm64-cross)
|
|
fi
|
|
|
|
if ((${#packages[@]})); then
|
|
sudo apt-get install --no-install-recommends "${packages[@]}"
|
|
fi
|