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 — No way to disable bytecode compilation when installing cpython · Issue #160835 · python/cpython

No way to disable bytecode compilation when installing cpython #160835

New issue
Copy link
New issue
Copy link
Open
Open
No way to disable bytecode compilation when installing cpython#160835
Copy link
Labels
buildThe build process and cross-buildThe build process and cross-buildtype-featureA feature request or enhancementA feature request or enhancement

Description

@rossburton
rossburton
opened on Oct 28, 2026
Issue body actions

Bug report

When building and installing cpython it can be preferable to have more control over when compileall is executed. It would be useful if there was a way to disable the compilation in the libinstall target for people who want to control the compilation without doing it twice.

(Happy to send a patch if this isn't rejected out of hand)

CPython versions tested on:

3.14

Operating systems tested on:

Linux

Activity

  1. rossburton
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on Oct 28, 2026
  2. picnixz
    added
    type-featureA feature request or enhancementA feature request or enhancement
    buildThe build process and cross-buildThe build process and cross-build
    and removed
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    on Oct 28, 2026
  3. picnixz commented on Oct 28, 2026

    @picnixz
    picnixz
    on Oct 28, 2026
    Member
    More actions

    What is the use case explicitly? is it a theoretical feature or is there a real need from redistributors?

  4. rossburton commented on Oct 28, 2026

    @rossburton
    rossburton
    on Oct 28, 2026
    ContributorAuthor
    More actions

    The specific use case is that we're packaging the standard library in more than one package so the easy way to handle this is to split the packaging up and then compile the py, because then the pyc goes into the right package without needing more work.

  5. picnixz commented on Oct 30, 2026

    @picnixz
    picnixz
    on Oct 30, 2026
    Member
    More actions

    I have no strong opinion here but not compiling bytecode may be relevant. cc @encukou

  6. encukou commented on Oct 30, 2026

    @encukou
    encukou
    on Oct 30, 2026
    Member
    More actions

    Maybe we can turn this into a compileall.py improvement?
    IMO, the invocation should be make install COMPILEALL_OPTS='--no-recursion --skip=.*', which would be possible with two patches:

    • allow multiple -x options, so Makefile's -x badsyntax doesn't overwrite COMPILEALL_OPTS
    • add long option aliases for readibility: --skip for -x, --[no-]recursion to -l; perhaps more.
  7. encukou
    marked make install: make compileall optional #81356 as a duplicate of this issue on Oct 30, 2026
  8. rossburton commented on Oct 30, 2026

    @rossburton
    rossburton
    on Oct 30, 2026
    ContributorAuthor
    More actions

    I have a patch to add long options for clarity.

    The public API such as compileall.compile_dir exposes a single rx regex, so this can't be just changed to a list.

    However, the argument parser could allow multiple skips and construct a new regex. So something like python3 -mcompileall -x foo -x bar ... would result in rx = r"foo|bar". If this is acceptable I can post it.

  9. encukou commented on Nov 2, 2026

    @encukou
    encukou
    on Nov 2, 2026
    Member
    More actions

    That sounds good. The CLI docs should mention that as an .. impl-detail:: -- multiple values are joined with | which means you can do -x '(a' -x b)c to get (a|b)c, but a future Python version could reject such partial regexes.

  10. rossburton commented on Nov 11, 2026

    @rossburton
    rossburton
    on Nov 11, 2026
    ContributorAuthor
    More actions

    Got distracted working on this improvement but also discovered that buildroot has solved this in a different way: https://github.com/buildroot/buildroot/blob/master/package/python3/0001-Make-the-build-of-pyc-files-conditional.patch.

    They patch in a --disable-pyc-build option that sets a variable and respect that in the makefile, which is certainly minimally invasive.

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

    buildThe build process and cross-buildThe build process and cross-buildtype-featureA feature request or enhancementA feature request or enhancement

    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.