GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Deepfreeze using 3.10, not bootstrap interpreter. · Issue #93771 · python/cpython

Deepfreeze using 3.10, not bootstrap interpreter. #93771

New issue
Copy link
New issue
Copy link
Closed
Closed
Deepfreeze using 3.10, not bootstrap interpreter.#93771
Copy link
Assignees
gvanrossum
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@markshannon
markshannon
opened on Jun 13, 2022
Issue body actions

#93769 shows this error, for the Windows build.
py -3.10 "D:\a\cpython\cpython\Tools\scripts\deepfreeze.py

Yet, the deepfreeze script states that "The script is executed by _bootstrap_python interpreter."

I need deepfreeze to be able to scan the bytecode looking for a RESUME instruction, to avoid computing it at runtime.

Activity

  1. markshannon
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on Jun 13, 2022
  2. markshannon
    assigned
    gvanrossum
    on Jun 13, 2022
  3. gvanrossum commented on Jun 13, 2022

    @gvanrossum
    gvanrossum
    on Jun 13, 2022
    Member
    More actions

    We may need help from @zooba to fix the build files. (Do we even have a bootstrap interpreter on Windows?)

  4. zooba commented on Jun 13, 2022

    @zooba
    zooba
    on Jun 13, 2022
    Member
    More actions

    We have _freeze_module, which is just enough interpreter to do what Programs/_freeze_module.c implements (which can obviously be extended if necessary), but because we can't reuse object files it's a serious slowdown to rebuild the entire interpreter.

    If there's really no way to do it without a full interpreter, we'll want to split most of the runtime into a static library. That should let us compile almost everything, then build an exe to do what you need, then build the real one, and reuse most of the object files via the static lib. (I say "we" because, even though it'll probably be me, I don't want to block someone else from doing it.)

    Can you maybe parse the opcode value out of one of the other files for this? Or teach _freeze_module how to print out the value for you?

  5. gvanrossum commented on Jun 13, 2022

    @gvanrossum
    gvanrossum
    on Jun 13, 2022
    Member
    More actions

    Mark solved it by hardcoding RESUME.

    Reacted by Steve Dower
  6. markshannon commented on Jun 14, 2022

    @markshannon
    markshannon
    on Jun 14, 2022
    MemberAuthor
    More actions

    Would it make sense to just fix the comment? Something like "This script should be executable by any reasonably recent Python".

  7. zooba commented on Jun 14, 2022

    @zooba
    zooba
    on Jun 14, 2022
    Member
    More actions

    I think it's minimum 3.10 now because of a match statement, so we can be more concrete than "reasonably recent".

  8. kumaraditya303 commented on Jun 15, 2022

    @kumaraditya303
    kumaraditya303
    on Jun 15, 2022
    Contributor
    More actions

    Guido replaced the match statement with an if-else chain so that deepfreeze can run with older versions of Python in #29717

  9. gvanrossum commented on Jun 15, 2022

    @gvanrossum
    gvanrossum
    on Jun 15, 2022
    Member
    More actions

    The rules appear to be even more complicated.

    • By default on UNIX it uses _bootstrap_python
    • For cross-builds on UNIX it uses an external Python (determined by the configure script)
    • On Windows it uses an older Python version (one must exist)
  10. zooba commented on Jun 15, 2022

    @zooba
    zooba
    on Jun 15, 2022
    Member
    More actions

    Do cross-builds on UNIX require the external Python to be built from the exact same commit? If not, it's probably the same as the Windows rule (which just requires an external version, not necessarily an older version).

  11. gvanrossum commented on Jun 15, 2022

    @gvanrossum
    gvanrossum
    on Jun 15, 2022
    Member
    More actions

    I dunno without investigating the code in much detail. The reasoning around using bootstrap python has gone back and forth too many times. :-(

  12. gvanrossum commented on Jun 23, 2022

    @gvanrossum
    gvanrossum
    on Jun 23, 2022
    Member
    More actions

    @kumaraditya303 Do you recall why it has to be run with _bootstrap_python at all on UNIX?

  13. kumaraditya303 commented on Jun 23, 2022

    @kumaraditya303
    kumaraditya303
    on Jun 23, 2022
    Contributor
    More actions

    _bootstrap_python is used mainly because of cross compilation and was (re)introduced in #29859. You can read #90108 issue for rationale.

  14. gvanrossum
    added a commit that references this issue on Jun 23, 2022

    gh-93771: Clarify how deepfreeze.py is run (#94150)

    4e796f5
  15. miss-islington
    added 2 commits that reference this issue on Jun 23, 2022

    pythongh-93771: Clarify how deepfreeze.py is run (pythonGH-94150)

    e4a06d3

    gh-93771: Clarify how deepfreeze.py is run (GH-94150)

    ee82f0f
  16. gvanrossum commented on Jun 23, 2022

    @gvanrossum
    gvanrossum
    on Jun 23, 2022
    Member
    More actions

    Fixed by #94150 and #94179 (3.11 backport).

    The reason to use _bootstrap_python is that otherwise users would have to install Python 3.10 in order to build 3.11. (See #90108 (comment) where this is said.)

  17. gvanrossum
    closed this as completedon Jun 23, 2022
  18. serhiy-storchaka
    added a commit that references this issue on Jun 26, 2022

    Revert 30935 defer bpo45162 to 312 (#94285)

    1ffde3e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @gvanrossum
    gvanrossum

Labels

type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.