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

bpo-45020: Drop the frozen .h files from the repo. #28375

Merged

Conversation

ericsnowcurrently
Copy link
Member

@ericsnowcurrently ericsnowcurrently commented Sep 15, 2021

The main advantage is that the files will no longer show up in diffs and PRs. That means, for a PR, the number of files / lines changed will more clearly reflect the actual change.

We can do this now that GH-28322 has landed. The "check_generated_files" CI job will still catch out-of-date frozen modules due to Python/frozen_modules/MANIFEST.

https://bugs.python.org/issue45020

.gitignore Outdated
Comment on lines 124 to 125
# Python/frozen_modules/MANIFEST is enough to tell if the generated
# files have changed. See Tools/scripts/freeze_modules.py.
Copy link
Member

Choose a reason for hiding this comment

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

I still feel we are having a disconnect over the check whether generated files have changed. Surely if they are not in the repo there's no need to check anything? Because everyone who builds Python will always first generate them. The best a check for MANIFEST can do is checking whether the user who submitted the PR actually ran freeze_modules.py. But why would we care? The changes to MANIFEST seem to just cause noise in PRs. I think the situation is very different from before, when not generating the .h files for importlib would silently break stuff (there's nothing that tells you those .h files are out of date in the old workflow other than the GitHub Action that tries to regenerate them and checks there are no differences).

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point. I don't mind dropping MANIFEST from the repo too.

Copy link
Member

Choose a reason for hiding this comment

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

Would you still generate it? Why exactly? Just to satisfy that GitHub action? I'd kill the action too (or remove this part from it, if it's checking for other things as well).

Copy link
Member Author

Choose a reason for hiding this comment

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

The GitHub action doesn't care about files that are not in the repo (and ignored). I want to keep generating the manifest because I find it helpful to have a flat, clean list of all the frozen modules. On several occasions that has been useful. However, it isn't a huge benefit. If you think it still isn't worth it then I'm okay with removing the generation code too.

@ericsnowcurrently ericsnowcurrently force-pushed the frozen-modules-drop-h-files branch from f60d112 to 5533204 Compare September 15, 2021 22:59
Copy link
Member

@gvanrossum gvanrossum left a comment

Choose a reason for hiding this comment

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

I still don't care about the MANIFEST file, but I am satisfied now that it's being ignored.

# If MODULES_DIR is changed then the .gitattributes file needs to be updated.
MODULES_DIR = os.path.join(ROOT_DIR, 'Python/frozen_modules')
# If MODULES_DIR is changed then the .gitattributes and .gitignore files
# needs to be updated.
Copy link
Member

Choose a reason for hiding this comment

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

"need"

@ericsnowcurrently ericsnowcurrently merged commit a9757bf into python:main Sep 16, 2021
@ericsnowcurrently ericsnowcurrently deleted the frozen-modules-drop-h-files branch September 16, 2021 01:15
ericsnowcurrently added a commit to ericsnowcurrently/cpython that referenced this pull request Sep 16, 2021
ericsnowcurrently added a commit that referenced this pull request Sep 16, 2021
gh-28375 broke one of the buildbots. Until I figure out why, I'm rolling the change back.

https://bugs.python.org/issue45020
ericsnowcurrently added a commit that referenced this pull request Sep 16, 2021
The main advantage is that the files will no longer show up in diffs and PRs. That means, for a PR, the number of files / lines changed will more clearly reflect the actual change.  (This is essentially an un-revert of gh-28375.)

https://bugs.python.org/issue45020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants