Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Ignore tempoary pyc.NNN files in wheels #1266

Merged
merged 1 commit into from
Jun 13, 2023

Conversation

rickeylev
Copy link
Contributor

We ignore pyc files most everywhere (because they aren't deterministic), but part of the pyc creation process involves creating temporary files named *.pyc.NNN. Though these are supposed to be temporary files nobody sees, they seem to get picked up by a glob somewhere, somehow. I'm unable to figure out how that is happening, but ignoring them in the glob expressions should also suffice.

Fixes #1261

We ignore pyc files most everywhere (because they aren't
deterministic), but part of the pyc creation process involves creating
temporary files named `*.pyc.NNN`. Though these are supposed to be
temporary files nobody sees, they seem to get picked up by a glob
somewhere, somehow. I'm unable to figure out how that is happening, but
ignoring them in the glob expressions should also suffice.

Fixes bazelbuild#1261
Copy link
Collaborator

@chrislovecnm chrislovecnm left a comment

Choose a reason for hiding this comment

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

LGTM

@chrislovecnm chrislovecnm added this pull request to the merge queue Jun 13, 2023
Merged via the queue into bazelbuild:main with commit 68db955 Jun 13, 2023
@rickeylev rickeylev deleted the fix.ignore.pycn.files branch June 21, 2023 06:20
rickeylev added a commit to rickeylev/rules_python that referenced this pull request Nov 6, 2023
Part of the pyc compilation process is to create a temporary file named
`<name>.pyc.NNNN`, where `NNNN` is a timestamp. Once the pyc is entirely
written, this file is renamed to the regular pyc file name. These files
only exist for brief periods of time, but its possible for different
threads/processes to see the temporary files when computing the glob()
values. Later, since the file is gone, an error is raised about the file
missing.

PR bazelbuild#1266 mostly fixed this issue, except that the glob exclude for an
interpreter runtime's files was behind the `ignore_root_user_error`
flag, which meant it wasn't always applied. This changes it to always be
applied, which should eliminate the failures.

Fixes bazelbuild#1261

Work towards bazelbuild#1520
github-merge-queue bot pushed a commit that referenced this pull request Nov 7, 2023
…1541)

Part of the pyc compilation process is to create a temporary file named
`<name>.pyc.NNNN`, where `NNNN` is a timestamp. Once the pyc is entirely
written, this file is renamed to the regular pyc file name. These files
only exist for brief periods of time, but its possible for different
threads/processes to see the temporary files when computing the glob()
values. Later, since the file is gone, an error is raised about the file
missing.

PR #1266 mostly fixed this issue, except that the exclude for the
`.pyc.NNNN` files for an
interpreter runtime's files was behind the `ignore_root_user_error`
flag, which meant it
wasn't always applied. This changes it to always be applied, which
should eliminate the
failures due to the missing NNNN files.

Fixes #1261

Work towards #1520
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

flaky test: bzlmod integration test on MacOS
2 participants