Skip to content
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

mach update deletes necessary file #391

Closed
pnmadelaine opened this issue Mar 30, 2023 · 5 comments
Closed

mach update deletes necessary file #391

pnmadelaine opened this issue Mar 30, 2023 · 5 comments

Comments

@pnmadelaine
Copy link
Collaborator

Running mach update deletes ocaml/lib/Lib_RandomBuffer_System_bindings.ml which is necessary to build the OCaml bindings.

@pnmadelaine
Copy link
Collaborator Author

@victor-dumitrescu
Copy link
Collaborator

The file is needed to bind to Lib_RandomBuffer_System. I haven't seen that randombytes is now deprecated, it seems that we should switch over to crypto_random in the OCaml bindings. In any case, the .ml file would still be required.

AFAIK this file is handwritten (since the C file it provides the bindings for is not generated by karamel. Maybe that's why it gets deleted?

@franziskuskiefer
Copy link
Member

Yeah, I think we need change the HACL makefile. @protz had some ideas but I never got around to trying them.
Let's get this fixed before merging #410.

@msprotz
Copy link
Collaborator

msprotz commented May 24, 2023

  • Several functions still rely on randombytes, so we can't exactly get rid of this file.
  • The bindings for this file are not auto-generated by krml like the others, they are hand-written and live in hacl-star/lib/ml/
  • A version of this file used to exist in dist/gcc-compatible/lib
  • It was removed in commit d0c3db3538c32f2f8033bc9db8396abc9b9630e2 (by @pnmadelaine)
  • The logic that copied the file from lib/ml to dist/gcc-compatible was also removed by @pnmadelaine in 7789f9bd858d9028364a8637a5306b5a3159f126

Excerpt of the logic removed by 7789f9bd858d9028364a8637a5306b5a3159f126:jjjkj

-dist/gcc-compatible/Makefile.basic: HAND_WRITTEN_ML_BINDINGS += \
-  $(wildcard lib/ml/*_bindings.ml)

-       [ x"$(HAND_WRITTEN_ML_BINDINGS)" != x ] && mkdir -p $(dir $@)/lib && cp $(HAND_WRITTEN_ML_BINDINGS) $(dir $@)lib/ || true

If these rules are not replicated by mach, then they should. That is, mach should pull that file from lib/ml and move it to the corresponding folder.

@franziskuskiefer
Copy link
Member

fixed in #411

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

4 participants