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

ocamlPackages.hacl-star-raw: Fix darwin stdenv #230069

Conversation

ulrikstrid
Copy link
Member

@ulrikstrid ulrikstrid commented May 5, 2023

Description of changes

Use a newer apple sdk.

@wegank is there a cleaner way of doing this?

related: #229896 (comment)

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.05 Release Notes (or backporting 22.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

@wegank
Copy link
Member

wegank commented May 5, 2023

@wegank is there a cleaner way of doing this?

Probably pkgs.darwin.apple_sdk_11_0.callPackage?

@ofborg ofborg bot added the 6.topic: darwin Running or building packages on Darwin label May 5, 2023
@wegank
Copy link
Member

wegank commented May 5, 2023

@ofborg build ligo

@ulrikstrid
Copy link
Member Author

Does the failure mean we should also use the same for ligo?

@wegank
Copy link
Member

wegank commented May 5, 2023

I guess we have to add a patch for ocamlPackages.hacl-star-raw instead...

diff --git a/hacl-star-raw/karamel/include/krml/internal/target.h b/hacl-star-raw/karamel/include/krml/internal/target.h
index 695873a..c0aed18 100644
--- a/hacl-star-raw/karamel/include/krml/internal/target.h
+++ b/hacl-star-raw/karamel/include/krml/internal/target.h
@@ -82,6 +82,9 @@
 #  endif
 #  if (defined(_MSC_VER) || (defined(__MINGW32__) && defined(__MINGW64_VERSION_MAJOR)))
 #    define KRML_ALIGNED_MALLOC(X, Y) _aligned_malloc(Y, X)
+#  elif defined(__APPLE__)
+#    include <mm_malloc.h>
+#    define KRML_ALIGNED_MALLOC(X, Y) _mm_malloc(Y, X)
 #  else
 #    define KRML_ALIGNED_MALLOC(X, Y) aligned_alloc(X, Y)
 #  endif

@ulrikstrid
Copy link
Member Author

Closing since #230114 seems to be a better solution

@ulrikstrid ulrikstrid closed this May 5, 2023
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.

2 participants