Uh oh!
There was an error while loading. Please reload this page.
gh-131876: extract _hashlib helpers into a separate directory - #136995
Conversation
_hashlib helpers into a separate directory_hashlib helpers into a separate directory93fdbd3 to
59b0cdaComparebedevere-bot
commented
Jul 22, 2025
🤖 New build scheduled with the buildbot fleet by @picnixz for commit 59b0cda 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F136995%2Fmerge If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again. |
I'll first merge the fortication PR, then merge this one where the macros are rewritten are pure functions when possible. I actually wanted to check whether using an exported function vs a static inline function could change a lot the performance (if possible I don't want to make the code significantly slower because I used non-static inline functions). |
gpshead
commented
Jul 28, 2025
for these code paths I doubt inline even matters. in general these days I assume the compiler will figure that out for static things, at least in pgo and lto builds. |
Actually, I was also a bit worried about the exported symbol. I also try to see if I can just live with Otherwise, I'll use EDIT: everything works well with |
picnixz
commented
Jul 28, 2025
Hum. Windows. Ok I don't know how to correct the project so using |
picnixz
commented
Jul 28, 2025
!buildbot FIPS only |
bedevere-bot
commented
Jul 28, 2025
🤖 New build scheduled with the buildbot fleet by @picnixz for commit a0fa849 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F136995%2Fmerge The command will test the builders whose names match following regular expression: The builders matched are:
|
Uh oh!
There was an error while loading. Please reload this page.
picnixz
commented
Jul 28, 2025
I don't think I can backport this as I think it's an ABI change? |
freakboy3742
commented
Jul 31, 2025
Not sure why this hasn't flagged, but this seems to have caused a big problem for the Emscripten buildbot: https://buildbot.python.org/#/builders/1810/builds/234 |
hoodmane
commented
Jul 31, 2025
Problem is we pass libhashlib.a to the linker twice which wasm-ld doesn't like. |
zooba
commented
Jul 31, 2025
There shouldn't be any need for This seems like it should be a fully internal change, just refactoring sources? |
picnixz
commented
Aug 1, 2025
Oh so it did cause an issue. I actually tried using extern but the Windows build failed so I wasn't sure about it. |
I will take care of this by making everything static inline just to prevent polluting main for a moment. Or I'll directly try to see how I can correctly use extern (I think the problem lies with the MSVC projects where I get duplicated symbols) @zooba could you help me here setting up the projects? |
I tried something but I can only rely on the CI to test the build: #137301. I think the issue is that we have a hashlib project but we don't have HACL* projects. Is it sufficient for me to actually only specify the files to compile in the hashlib project (I don't know if it's possible to disable hashlib on Windows)? would they be picked up by the "parent" project correctly? EDIT: well apparently not. Let's discuss what I should do on the new PR. |
…irectory (python#136995)" This reverts commit 45138d3.
bedevere-bot
commented
Aug 1, 2025
|
…python#136995) The `Modules/hashlib.h` helper file is now removed and split into multiple files: * `Modules/_hashlib/hashlib_buffer.[ch]` -- Utilities for getting a buffer view and handling buffer inputs. * `Modules/_hashlib/hashlib_fetch.h` -- Utilities used when fetching a message digest from a digest-like identifier. Currently, this file only contains common error messages as the fetching API is not yet implemented. * `Modules/_hashlib/hashlib_mutex.h` -- Utilities for managing the lock on cryptographic hash objects.
…python#136995) The `Modules/hashlib.h` helper file is now removed and split into multiple files: * `Modules/_hashlib/hashlib_buffer.[ch]` -- Utilities for getting a buffer view and handling buffer inputs. * `Modules/_hashlib/hashlib_fetch.h` -- Utilities used when fetching a message digest from a digest-like identifier. Currently, this file only contains common error messages as the fetching API is not yet implemented. * `Modules/_hashlib/hashlib_mutex.h` -- Utilities for managing the lock on cryptographic hash objects.
…python#136995) The `Modules/hashlib.h` helper file is now removed and split into multiple files: * `Modules/_hashlib/hashlib_buffer.[ch]` -- Utilities for getting a buffer view and handling buffer inputs. * `Modules/_hashlib/hashlib_fetch.h` -- Utilities used when fetching a message digest from a digest-like identifier. Currently, this file only contains common error messages as the fetching API is not yet implemented. * `Modules/_hashlib/hashlib_mutex.h` -- Utilities for managing the lock on cryptographic hash objects.
…python#136995) The `Modules/hashlib.h` helper file is now removed and split into multiple files: * `Modules/_hashlib/hashlib_buffer.h` -- Utilities for getting a buffer view and handling buffer inputs. * `Modules/_hashlib/hashlib_fetch.h` -- Utilities used when fetching a message digest from a digest-like identifier. Currently, this file only contains common error messages as the fetching API is not yet implemented. * `Modules/_hashlib/hashlib_mutex.h` -- Utilities for managing the lock on cryptographic hash objects.
…python#136995) The `Modules/hashlib.h` helper file is now removed and split into multiple files: * `Modules/_hashlib/hashlib_buffer.[ch]` -- Utilities for getting a buffer view and handling buffer inputs. * `Modules/_hashlib/hashlib_fetch.h` -- Utilities used when fetching a message digest from a digest-like identifier. Currently, this file only contains common error messages as the fetching API is not yet implemented. * `Modules/_hashlib/hashlib_mutex.h` -- Utilities for managing the lock on cryptographic hash objects.
…into a separate directory (python#136995) (python#137307) Revert "pythongh-131876: extract `_hashlib` helpers into a separate directory (python#136995)" This reverts commit 45138d3.
This is a clean rewrite of #135341.
_hashliband_hmac#131876