-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
freeze cannot find Modules/_hacl/libHacl_Hash_SHA2.a #116043
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
Comments
As far as I can see, building libHacl_Hash_SHA1.a is not necessary. Simply generate directories and emtpy file Modules/_hacl/libHacl_Hash_SHA1.a in the frozen directory, i.e., where make is called. I conjecture that libHacl_Hash_SHA1.a is during python build itself statically linked to _hashlib.cpython-312-x86_64-linux-gnu.so which is dynamically bound to the feeze result executable. Thus, even its hash functions can be used with this trick applied. If this is correct, imho the generated Makefile by freeze should not include libHacl_Hash_SHA1.a in any way, which should be fixed. Maybe an easy solution is to not link a binary .a file but the single .o files of the compiled .c files to the .so as done with other hash functions different to sha2. This would probably not fool freeze, then. The former, linking .a looks to me like some hacky proceeding. Thx, |
@gpshead I think you added the support for the .a file in an early version where sha2 was scattered across multiple C files, but I have not resorted to that mechanism for the other hash algorithms -- if that helps, I can submit a PR that gets rid of the .a in favor of a single .o? |
We fixed this for 3.14+ only as 3.12 is security-only. See also 131298. |
Bug report
Bug description:
Dear maintainers,
I am using Ubuntu Noble 24.04 development. I know there are some alternatives to freeze, but I have to maintain a larger project as CGI script which is (for me) not so easy to transform and I use it up to 20 years now.
The linker does not find the library
Modules/_hacl/libHacl_Hash_SHA2.a
. As far I can see, Ubuntu does not deliverModules/_hacl/libHacl_Hash_SHA2.a
as a binary anywhere in the system or as another deb-package.The only option I see so far is to compile the python sources myself and copy/link the static Modules folder to the current directory. The following Dockerfile shows that (after removing
RUN
and changingWORKDIR
tocd
it should be also runable as shell script). However, this is very unhandy and runs > 1h on my machine.Why is the Hacl library statically linked? Is linking to it necessary at all? Would it be an option to have it as .so as I am used e.g. from psycopg? If needed, in any case it should be provided as binary by the distro. Further, the by freeze generated
frozen/Makefile
(see Makefile.txt) is full of$(sourcedir)
referencing the python source directory (after a build), e.g.,LIBHACL_SHA2_A=Modules/_hacl/libHacl_Hash_SHA2.a
. freeze should generate paths as (then) the lib is located by the linux distro.With Python 3.11.x everythings works like a charm. Should Ubuntu deliver the Module _hacl as binary, or which form? I cannot find any hint in the system and in the package repo. If desired, I could open a respective issue in Ubuntu Lauchpad bugtracker.
Many thanks for looking into it,
Chris
CPython versions tested on:
3.12
Operating systems tested on:
Linux
Linked PRs
The text was updated successfully, but these errors were encountered: