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: make windows ignore pycs in runtime #1715

Merged
merged 2 commits into from
Jan 23, 2024

Conversation

rickeylev
Copy link
Contributor

The downloaded runtimes don't contain pyc files, which means Python tries to create them at runtime, and thus the set of files in the runtime changes. This normally just silently affects cache hits, but on Windows can result is errors. This is because Windows has stricter file access semantics (e.g. a file can't be deleted if its still opened) and the way Python programs are built involves a step to zip everything up (which then requires the pyc to exist to be put into the zip file).

To fix, always ignore pyc files for Windows hosts. This should prevent those files from being picked up by the glob and being considered part of the runtime.

The downloaded runtimes don't contain pyc files, which means Python
tries to create them at runtime, and thus the set of files in the
runtime changes. This normally just silently affects cache hits, but
on Windows can result is errors. This is because Windows has stricter
file access semantics (e.g. a file can't be deleted if its still opened)
and the way Python programs are built involves a step to zip everything
up (which then requires the pyc to exist to be put into the zip file).

To fix, always ignore pyc files for Windows hosts. This should prevent
those files from being picked up by the glob and being considered part
of the runtime.
@rickeylev rickeylev added this pull request to the merge queue Jan 23, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Jan 23, 2024
@rickeylev rickeylev added this pull request to the merge queue Jan 23, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Jan 23, 2024
@aignas aignas enabled auto-merge January 23, 2024 06:55
@aignas aignas added this pull request to the merge queue Jan 23, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 23, 2024
@aignas aignas added this pull request to the merge queue Jan 23, 2024
Merged via the queue into bazelbuild:main with commit a64e55b Jan 23, 2024
4 checks passed
@rickeylev rickeylev deleted the fix.windows.ignore.pyc branch January 24, 2024 21:24
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.

2 participants