Skip to content

gh-116043: Simplify HACL* build #119320

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

Closed
wants to merge 2 commits into from
Closed

Conversation

msprotz
Copy link
Contributor

@msprotz msprotz commented May 21, 2024

Per #116043, the usage of a static library causes concerns in some legacy scenarios. Now that that HACL* SHA2 file is properly packaged as a single C file, there isn't much incentive to have a static archive being built, so let's get rid of that if it helps.

@msprotz msprotz force-pushed the protz_hacl_build_fix branch from 3861ca3 to a1d027a Compare May 21, 2024 16:15
@msprotz
Copy link
Contributor Author

msprotz commented Jun 19, 2024

@chris21k can you comment as to whether this solves your issue?

@chris21k
Copy link

@msprotz Thanks for looking into it and fixing it.
Unfortunately it is somehow hard to test it for me, or could you give me some hints? Currently I am using Ubuntu 24.04 standard python 3.12 installation...

However, I can give you detailed but easy instructions to test it on your fixed python installation (you just have to apdapt your path to the python installation containing the PR):

First we create a simple python program. Using hashlib or not I think plays no role. However, we take the following one:

import hashlib

print("Hello, World!")

m = hashlib.sha256()
m.update(b"nobody inspects")
print(m.hexdigest())

Then we do the follwing steps:

$ ls
helloworld.py
$ /usr/bin/python3 helloworld.py
Hello, World!
5880e257e70b83842737244b412a2f282e0f230953027a22104efc615d90d3f9
$ /usr/share/doc/python3.12/examples/freeze/freeze.py -o frozen helloworld.py
$ cd frozen
$ #mkdir -p Modules/_hacl; touch Modules/_hacl/libHacl_Hash_SHA2.a # should not be necessary any more
$ make
$ ./helloworld
Hello, World!
5880e257e70b83842737244b412a2f282e0f230953027a22104efc615d90d3f9

If make runs through without errors and creates the helloworld binary then everthing should be all right.

Sorry for the late reply.

@luis605
Copy link

luis605 commented Mar 17, 2025

Given that this pull request has been open for several months, I kindly request the maintainers consideration in reviewing and merging it. Implementing these changes would be beneficial for developers who rely on a simplified and robust build process.

Thank you for your attention.

@msprotz
Copy link
Contributor Author

msprotz commented Mar 17, 2025

My issue here is that I am not familiar with freeze.py, and since the time I submitted this PR, the build system of Python gained another .a file (for Hacl's Blake2), so it sounds like we should fix freeze.py rather than undo the changes to the build system and no longer rely on .a files.

Maybe @picnixz or @chris-eibl know about freeze.py? Also pinging @gpshead FYI

@chris-eibl
Copy link
Member

Sorry, I am not familiar with freeze.py

@picnixz
Copy link
Member

picnixz commented Mar 17, 2025

And me neither :( maybe @vstinner?

@picnixz
Copy link
Member

picnixz commented Apr 12, 2025

I'm closing this one in favor of #132438 (since this one also has conflicts). Thanks for the initial work though!

@picnixz picnixz closed this Apr 12, 2025
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.

5 participants