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 — GH-115869: Make `jit_stencils.h` reproducible by brandtbucher · Pull Request #127166 · python/cpython

Conversation

@brandtbucher

@brandtbucher brandtbucher commented Nov 22, 2024 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

At the core dev sprint, we discussed the possibility of hosting pre-built jit_stencils.h files for common platforms and build configurations.

While there's a lot of work involved in making that happen (I'll post a rough plan shortly), this is the first logical step in that direction. This PR replaces absolute file paths in the generated code with relative ones, and processes stencils in sorted order.

  • Issue: Hosting jit_stencils.h #115869

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gpshead, savannahostrowski, and Eclips4 reacted with hooray emoji
All reactions
  • 🎉 3 reactions
brandtbucher and others added 6 commits November 22, 2024 08:32
@brandtbucher
Keep full paths from leaking into the generated file
0f07af3
@brandtbucher
Fix the order in which we process holes
379c22b
@brandtbucher
Fix empty padding
102ef64
@brandtbucher
Lint
a1b1e0d
@brandtbucher
Clean up the diff
6480466
@brandtbucher
blurb add
2ee6720
@brandtbucher brandtbucher added build The build process and cross-build 3.14 bugs and security fixes topic-JIT labels Nov 22, 2024
@brandtbucher brandtbucher self-assigned this Nov 22, 2024
@brandtbucher
brandtbucher requested a review from savannahostrowski as a code owner November 22, 2024 16:47
@bedevere-app bedevere-app Bot mentioned this pull request Nov 22, 2024
Hosting jit_stencils.h #115869
Open
@bedevere-app bedevere-app Bot added the awaiting core review label Nov 22, 2024
brandtbucher
brandtbucher commented Nov 22, 2024
View reviewed changes
Comment thread Tools/jit/_stencils.py
offset = len(self.body)
padding = -offset % alignment
self.disassembly.append(f"{offset:x}: {' '.join(['00'] * padding)}")
if padding:

@brandtbucher brandtbucher Nov 22, 2024

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an unrelated cleanup.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

savannahostrowski reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
mdboom
mdboom approved these changes Nov 23, 2024
View reviewed changes
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting core review labels Nov 23, 2024
savannahostrowski
savannahostrowski approved these changes Nov 24, 2024
View reviewed changes

@savannahostrowski savannahostrowski left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@brandtbucher
brandtbucher merged commit 17c16ae into python:main Nov 24, 2024
@bedevere-app bedevere-app Bot removed the awaiting merge label Nov 24, 2024
ebonnal pushed a commit to ebonnal/cpython that referenced this pull request Jan 12, 2025
@brandtbucher @ebonnal
pythonGH-115869: Make jit_stencils.h reproducible (pythonGH-127166)
5cb7590
bmwiedemann added a commit to bmwiedemann/cpython that referenced this pull request Jul 31, 2026
@bmwiedemann @brandtbucher
[3.13] pythonGH-115869: Keep the build tmpdir out of jit_stencils.h (p…
576df7c
…ythonGH-127166)

llvm-objdump prints the path of the object file it disassembles, and the
JIT builds every stencil in a fresh tempfile.TemporaryDirectory().  That
random path ended up verbatim in the disassembly comments of the
generated jit_stencils.h, so two builds of the same source never produced
the same header:

     // /tmp/tmp164olvmi/_BINARY_OP.o:  file format elf64-x86-64
    +// /tmp/tmpmufvewt2/_BINARY_OP.o:  file format elf64-x86-64

Replace the full path with the bare file name.

Only the _parse() hunk of that commit is taken here; the rest of it
depends on refactorings that are not in 3.13.

(cherry picked from commit 17c16ae)

Co-authored-by: Brandt Bucher <[email protected]>
bmwiedemann added a commit to bmwiedemann/cpython that referenced this pull request Jul 31, 2026
@bmwiedemann @brandtbucher
[3.13] pythonGH-115869: Make jit_stencils.h reproducible
636c732
Keep the build tmpdir out of jit_stencils.h (pythonGH-127166)

llvm-objdump prints the path of the object file it disassembles, and the
JIT builds every stencil in a fresh tempfile.TemporaryDirectory().  That
random path ended up verbatim in the disassembly comments of the
generated jit_stencils.h, so two builds of the same source never produced
the same header:

     // /tmp/tmp164olvmi/_BINARY_OP.o:  file format elf64-x86-64
    +// /tmp/tmpmufvewt2/_BINARY_OP.o:  file format elf64-x86-64

Replace the full path with the bare file name.

Only the _parse() hunk of that commit is taken here; the rest of it
depends on refactorings that are not in 3.13.

(cherry picked from commit 17c16ae)

Co-authored-by: Brandt Bucher <[email protected]>
bmwiedemann added a commit to bmwiedemann/cpython that referenced this pull request Jul 31, 2026
@bmwiedemann @brandtbucher
[3.13] pythonGH-115869: Make jit_stencils.h reproducible (pythonGH-12…
d943650
…7166)

Keep the build tmpdir out of jit_stencils.h

llvm-objdump prints the path of the object file it disassembles, and the
JIT builds every stencil in a fresh tempfile.TemporaryDirectory().  That
random path ended up verbatim in the disassembly comments of the
generated jit_stencils.h, so two builds of the same source never produced
the same header:

     // /tmp/tmp164olvmi/_BINARY_OP.o:  file format elf64-x86-64
    +// /tmp/tmpmufvewt2/_BINARY_OP.o:  file format elf64-x86-64

Replace the full path with the bare file name.

Only the _parse() hunk of that commit is taken here; the rest of it
depends on refactorings that are not in 3.13.

(cherry picked from commit 17c16ae)

Co-authored-by: Brandt Bucher <[email protected]>
@bedevere-app

bedevere-app Bot commented Jul 31, 2026

Copy link
Copy Markdown

GH-154988 is a backport of this pull request to the 3.13 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bmwiedemann added a commit to bmwiedemann/cpython that referenced this pull request Jul 31, 2026
@bmwiedemann @brandtbucher
[3.13] pythonGH-115869: Make jit_stencils.h reproducible (pythonGH-12…
a49dcfa
…7166)

Keep the build tmpdir out of jit_stencils.h

llvm-objdump prints the path of the object file it disassembles, and the
JIT builds every stencil in a fresh tempfile.TemporaryDirectory().  That
random path ended up verbatim in the disassembly comments of the
generated jit_stencils.h, so two builds of the same source never produced
the same header:

     // /tmp/tmp164olvmi/_BINARY_OP.o:  file format elf64-x86-64
    +// /tmp/tmpmufvewt2/_BINARY_OP.o:  file format elf64-x86-64

Replace the full path with the bare file name.

Only the _parse() hunk of that commit is taken here; the rest of it
depends on refactorings that are not in 3.13.

(cherry picked from commit 17c16ae)

Co-authored-by: Brandt Bucher <[email protected]>
bmwiedemann added a commit to bmwiedemann/cpython that referenced this pull request Jul 31, 2026
@bmwiedemann @brandtbucher
[3.13] pythonGH-115869: Make jit_stencils.h reproducible (pythonGH-12…
eb1d107
…7166)

Keep the build tmpdir out of jit_stencils.h

llvm-objdump prints the path of the object file it disassembles, and the
JIT builds every stencil in a fresh tempfile.TemporaryDirectory().  That
random path ended up verbatim in the disassembly comments of the
generated jit_stencils.h, so two builds of the same source never produced
the same header:

     // /tmp/tmp164olvmi/_BINARY_OP.o:  file format elf64-x86-64
    +// /tmp/tmpmufvewt2/_BINARY_OP.o:  file format elf64-x86-64

Replace the full path with the bare file name.

Only the _parse() hunk of that commit is taken here; the rest of it
depends on refactorings that are not in 3.13.

(cherry picked from commit 17c16ae)

Co-authored-by: Brandt Bucher <[email protected]>
Yhg1s pushed a commit that referenced this pull request Aug 4, 2026
@bmwiedemann @brandtbucher
[3.13] GH-115869: Make jit_stencils.h reproducible (GH-127166) (#154988)
9b67007
Keep the build tmpdir out of jit_stencils.h

llvm-objdump prints the path of the object file it disassembles, and the
JIT builds every stencil in a fresh tempfile.TemporaryDirectory().  That
random path ended up verbatim in the disassembly comments of the
generated jit_stencils.h, so two builds of the same source never produced
the same header:

     // /tmp/tmp164olvmi/_BINARY_OP.o:  file format elf64-x86-64
    +// /tmp/tmpmufvewt2/_BINARY_OP.o:  file format elf64-x86-64

Replace the full path with the bare file name.

Only the _parse() hunk of that commit is taken here; the rest of it
depends on refactorings that are not in 3.13.

(cherry picked from commit 17c16ae)

Co-authored-by: Brandt Bucher <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@mdboom mdboom mdboom approved these changes
@savannahostrowski savannahostrowski savannahostrowski approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@brandtbucher brandtbucher

Labels

3.14 bugs and security fixes build The build process and cross-build topic-JIT

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@brandtbucher @mdboom @savannahostrowski
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.