Skip to content

Fix stubtest issues - #5360

Merged
Akuli merged 6 commits into
python:masterfrom
hatal175:stubtest14
May 7, 2021
Merged

Akuli merged 6 commits into
python:masterfrom
hatal175:stubtest14

Conversation

@hatal175

@hatal175 hatal175 commented May 7, 2021

Copy link
Copy Markdown
Contributor

No description provided.

@github-actions

github-actions Bot commented May 7, 2021

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

Comment thread tests/stubtest_whitelists/linux.txt Outdated
grp.struct_group._asdict
grp.struct_group._make
grp.struct_group._replace
mmap.MADV_SOFT_OFFLINE # Not defined in some linuxes

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is this needed for CI or for running stubtest on your computer? I think .github/workflows/stubtest-unused-whitelist.yml will delete this automatically if the CI doesn't need it.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Also, MADV_SOFT_OFFLINE is new on Linux 2.6.33 (see madvise(2) manual page), so unless something hasn't been updated for the past 15 years, this shouldn't be a problem.

@hatal175

hatal175 commented May 7, 2021 via email

Copy link
Copy Markdown
Contributor Author

@Akuli

Akuli commented May 7, 2021

Copy link
Copy Markdown
Collaborator

This turned out to be a bug in glibc. I compiled my own Python 3.9 and edited Modules/mmapmodule.c like this:

@@ -1623,6 +1624,8 @@ PyInit_mmap(void)
 #endif
 #ifdef MADV_SOFT_OFFLINE
     setint(dict, "MADV_SOFT_OFFLINE", MADV_SOFT_OFFLINE);
+#else
+   #error its missing lol
 #endif
 #ifdef MADV_HUGEPAGE
     setint(dict, "MADV_HUGEPAGE", MADV_HUGEPAGE);

Then it didn't compile anymore. The problem is that it's not in any of the includes that #include <sys/mman.h> brings along, unlike other MADV constants which are mostly in bits/mman-linux.h.

Nobody has reported this bug yet. I was going to report this by clicking "File a bug" here, but they they want an email address and they have a warning about receiving spam to it.

I think we should delete MADV_SOFT_OFFLINE from the stub and add a comment mentioning how broken it is.

@github-actions

github-actions Bot commented May 7, 2021

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

collections.abc.ItemsView.__reversed__
collections.abc.KeysView.__reversed__
collections.abc.ValuesView.__reversed__
concurrent.futures.ProcessPoolExecutor.map

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I wonder why this wasn't deleted last Saturday when stubtest-unused-whitelist.yml ran

@Akuli
Akuli merged commit 2dc02ae into python:master May 7, 2021
@Akuli Akuli mentioned this pull request Jan 4, 2022
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