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 — bpo-36876: Add a tool that identifies unsupported global C variables. by ericsnowcurrently · Pull Request #15877 · python/cpython

Conversation

@ericsnowcurrently

@ericsnowcurrently ericsnowcurrently commented Sep 10, 2019 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

This PR does 2 things:

  • make the globals checker tool more robust and maintainable
  • add a test that invokes the checker and fails if any unsupported globals have been added

For now the test is marked as a known failure. I'll be working to fix all of unsupported globals, at which point I'll unmark the test.

Note that this PR adds code to Tools/c-analyzer or adds new tests. The only existing code I touch is where I factor out an existing testing helper from tests for another tool.

https://bugs.python.org/issue36876

Sorry, something went wrong.

Uh oh!

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

All reactions
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Sep 10, 2019
@bedevere-bot bedevere-bot added the awaiting core review label Sep 10, 2019
@ericsnowcurrently ericsnowcurrently added the skip news label Sep 10, 2019
@vstinner

vstinner commented Sep 10, 2019

Copy link
Copy Markdown
Member

115 commits, 51 files changes, and wow, that's a huge PR.

All reactions

Sorry, something went wrong.

Uh oh!

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

@vstinner

vstinner commented Sep 10, 2019 •
edited by bedevere-bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

" bpo-36876: Make sure no new globals get added."

So far, the C API don't provide any solution for function "static PyObject *local_global_var = ...;" :-)

All reactions

Sorry, something went wrong.

Uh oh!

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

@ericsnowcurrently
ericsnowcurrently force-pushed the globals-checker branch from 23e9d06 to de1f50f Compare September 11, 2019 11:06
@ericsnowcurrently ericsnowcurrently changed the title bpo-36876: Make sure no new globals get added. bpo-36876: Add a tool that identifies unsupported global C variables. Sep 11, 2019
@ericsnowcurrently

ericsnowcurrently commented Sep 11, 2019

Copy link
Copy Markdown
Member Author

Yeah, it's a lot, but it's all under Tools/. :) Also, I've updated the title to be more clear.

All reactions

Sorry, something went wrong.

Uh oh!

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

@ericsnowcurrently
ericsnowcurrently force-pushed the globals-checker branch from de1f50f to 569c57e Compare September 11, 2019 12:19
@ericsnowcurrently

ericsnowcurrently commented Sep 11, 2019

Copy link
Copy Markdown
Member Author

FYI, all the failures are strictly with patchcheck, which is complaining about whitespace in some files. I cannot reproduce that locally.

All reactions

Sorry, something went wrong.

Uh oh!

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

@ericsnowcurrently
ericsnowcurrently merged commit ee536b2 into python:master Sep 11, 2019
@ericsnowcurrently
ericsnowcurrently deleted the globals-checker branch September 11, 2019 18:49
@bedevere-bot

bedevere-bot commented Sep 11, 2019

Copy link
Copy Markdown

@ericsnowcurrently: Please replace # with GH- in the commit message next time. Thanks!

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-bot bedevere-bot removed the awaiting core review label Sep 11, 2019
ericsnowcurrently added 16 commits September 11, 2019 22:12
@ericsnowcurrently
Bootstrap the "c-statics" script under the test suite.
9cdba01
@ericsnowcurrently
Stub out the "check" and "show" commands.
cfdf57f
@ericsnowcurrently
Add a README.
716b13d
@ericsnowcurrently
Fix a filename.
ff1b447
@ericsnowcurrently
Run the full check as part of the test suite.
7e7d52d
@ericsnowcurrently
Frame out the functional tests.
74d03d4
@ericsnowcurrently
Ignore the argparse output in tests.
34d2c7c
@ericsnowcurrently
Move relevant tests to test_cg/.
e8e2227
@ericsnowcurrently
Add StaticVar.
69541bf
@ericsnowcurrently
Add a fake find.statics().
cab1fc8
@ericsnowcurrently
Add show.basic().
4bf5299
@ericsnowcurrently
Implement cmd_show().
c74360f
@ericsnowcurrently
Add a note about the normalized vartype format.
b94833d
@ericsnowcurrently
Do not run tests for find.statics() yet.
6fecaad
@ericsnowcurrently
Implement cmd_check().
8a53e69
@ericsnowcurrently
Add scan.iter_statics().
98d3737
ericsnowcurrently added 27 commits September 11, 2019 22:13
@ericsnowcurrently
Distinguish "static" vars in output.
48b2460
@ericsnowcurrently
Special-case variables named "id".
c0a631b
@ericsnowcurrently
Fix a test.
3989a69
@ericsnowcurrently
Print totals.
8118454
@ericsnowcurrently
Fail if we couldn't find any of the symbols.
cae5e3a
@ericsnowcurrently
Factor out _check_results().
87ebe87
@ericsnowcurrently
Fill in gaps in known.tsv.
91e4fb1
@ericsnowcurrently
Mark _Py_IDENTIFIER() as unsupported.
21c4175
@ericsnowcurrently
Keep "static" in output.
a245849
@ericsnowcurrently
Fix a typo in __main__.py.
1437d56
@ericsnowcurrently
Honor provided dirnames.
7feea9d
@ericsnowcurrently
Fix tests.
ae23801
@ericsnowcurrently
Deal with default dirnames properly.
26aaccb
@ericsnowcurrently
Supporting hiding objects in output.
4aaad5f
@ericsnowcurrently
Recognize more object types.
3d36cfc
@ericsnowcurrently
Ignore known non-statics.
b7420d5
@ericsnowcurrently
Always support "static const" (non-object) variables.
da151a7
@ericsnowcurrently
"statics" -> "globals".
6470eb1
@ericsnowcurrently
Maybe limit the variables in known.tsv.
1233cf9
@ericsnowcurrently
Generate the ignored.tsv file.
fc6c97e
@ericsnowcurrently
Ignore variables with benign races.
6f8a223
@ericsnowcurrently
Mark more variables as PyObject.
6c1db44
@ericsnowcurrently
Consider private, non-static globals.
5888d48
@ericsnowcurrently
Update ignored global variables.
cdeb1d9
@ericsnowcurrently
Skip the check where "nm" isn't available.
569c57e
@ericsnowcurrently
Ignore REPL-related variables.
7b0745f
@ericsnowcurrently
Fix whitespace.
b5dd31b
DinoV pushed a commit to DinoV/cpython that referenced this pull request Sep 12, 2019
@ericsnowcurrently @DinoV
bpo-36876: Add a tool that identifies unsupported global C variables. (…
7654be1
…python#15877)
@ericsnowcurrently ericsnowcurrently mentioned this pull request Apr 10, 2022
[subinterpreters] Global C variables are a problem #81057
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

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

Assignees

No one assigned

Labels

skip news

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.

4 participants

@ericsnowcurrently @vstinner @bedevere-bot @the-knights-who-say-ni
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.