Skip to content

add configure option to control the groups of .pyc files to install #88263

Open

Description

@pxinwr
mannequin
BPO 44097
Nosy @gpshead, @tiran, @pxinwr
PRs
  • bpo-44097: add --enable-pyc-build option to the configure script #23920
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = None
    created_at = <Date 2021-05-10.07:42:30.095>
    labels = ['type-feature', 'build', '3.11']
    title = 'add configure option to control the groups of .pyc files to install'
    updated_at = <Date 2021-05-10.08:11:29.783>
    user = 'https://github.com/pxinwr'

    bugs.python.org fields:

    activity = <Date 2021-05-10.08:11:29.783>
    actor = 'christian.heimes'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Build']
    creation = <Date 2021-05-10.07:42:30.095>
    creator = 'pxinwr'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 44097
    keywords = []
    message_count = 3.0
    messages = ['393356', '393363', '393365']
    nosy_count = 3.0
    nosy_names = ['gregory.p.smith', 'christian.heimes', 'pxinwr']
    pr_nums = ['23920']
    priority = 'normal'
    resolution = None
    stage = None
    status = 'open'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue44097'
    versions = ['Python 3.11']

    Activity

    1. pxinwr commented on May 10, 2021

      pxinwrmannequin
      MannequinAuthor

      Currently when building and installing Python out of source, unoptimized .pyc files and 2 types of optimized .pyc files(*.opt-1.pyc and *.opt-2.pyc) are all compiled out and installed. So to reduce package size and build and installation time, we should provide an option in configure to control the groups of .pyc files to install. For distribution case, normally only one type of .pyc files even none is needed.

    2. added
      3.11only security fixes
      buildThe build process and cross-build
      type-featureA feature request or enhancement
      on May 10, 2021
    3. pxinwr commented on May 10, 2021

      pxinwrmannequin
      MannequinAuthor

      For the configure option name used in PR# 23930, change it to "--enable-pyc-groups" is better? What is your advice?

    4. tiran commented on May 10, 2021

      @tiran
      Member

      Please hold off with PR until we have agreed if we want this feature request makes sense at all. Linux distributions typically provide all pyc variants. There are also better ways to shrink code size, e.g. deduplication or compression.

    5. transferred this issue fromon Apr 10, 2022
    6. encukou commented on Mar 28, 2024

      @encukou
      Member

      Nowadays, compileall has the multiple-use -O option:

        -o OPT_LEVELS         Optimization levels to run compilation with. Default is -1 which uses the optimization level
                              of the Python interpreter itself (see -O).
      

      And the Makefile hardcodes -o 0 -o 1 -o 2. The fix would be to replace that with a new Makefile variable, like COMPILEALL_OPTLEVELS="-o 0 -o 1 -o 2". I don't think it needs to be a configure-time option.

      Note that the Makefile can also pass options via the COMPILEALL_OPTS variable. This needs to be left alone; people who override it expect that it doesn't contain the -o options .

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

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.11only security fixesbuildThe build process and cross-buildtype-featureA feature request or enhancement

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions