Skip to content

Commit 0676aa4

Browse files
committedMay 17, 2024
feat: enable aws-lc feature for elixir nifs
1 parent 3cd7446 commit 0676aa4

File tree

5 files changed

+10
-6
lines changed

5 files changed

+10
-6
lines changed
 

‎Cross.toml

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[build]
2-
pre-build = [ # additional commands to run prior to building the package
2+
# additional commands to run prior to building the package
3+
pre-build = [
34
"apt update",
45
# libclang-dev is required when building with `aws-lc` feature
5-
"apt -y --no-install-recommends install libclang-dev clang",
6+
"DEBIAN_FRONTEND=noninteractive apt -y --no-install-recommends install libclang-dev clang",
67
]

‎implementations/elixir/ockam/ockam_rust_elixir_nifs/lib/ockam_rust_elixir_nifs/native.ex

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ defmodule OckamRustElixirNifs.Native do
77
otp_app: :ockam_rust_elixir_nifs,
88
crate: "ockam_rust_elixir_nifs",
99
path: "../../../rust/ockam/ockam_rust_elixir_nifs",
10+
features: ["aws-lc"],
1011
force_build: System.get_env("OCKAM_DOWNLOAD_NIF") == nil,
1112
version: version,
1213
load_from: {:ockam_rust_elixir_nifs, "priv/native/libockam_rust_elixir_nifs"},

‎tools/nix/parts/all.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
inputsFrom = with config.devShells; [elixir rust tooling typescript];
1818

1919
inherit (config.devShells.elixir) ASDF_ELIXIR_VERSION ASDF_ERLANG_VERSION;
20-
inherit (config.devShells.rust) nativeBuildInputs CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER DYLD_FALLBACK_LIBRARY_PATH OCKAM_DISABLE_UPGRADE_CHECK RUSTFLAGS RUST_SRC_PATH CARGO_INCREMENTAL;
20+
inherit (config.devShells.rust) nativeBuildInputs CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER DYLD_FALLBACK_LIBRARY_PATH OCKAM_DISABLE_UPGRADE_CHECK RUSTFLAGS RUST_SRC_PATH CARGO_INCREMENTAL LIBCLANG_PATH;
2121
inherit (config.devShells.tooling) BATS_LIB;
2222

2323
shellHook = ''

‎tools/nix/parts/elixir.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ in {
4343

4444
ASDF_ELIXIR_VERSION = lib.optional cfg.shadowAsdf "system";
4545
ASDF_ERLANG_VERSION = lib.optional cfg.shadowAsdf "system";
46-
inherit (config.devShells.rust) OCKAM_DISABLE_UPGRADE_CHECK RUSTFLAGS RUST_SRC_PATH;
46+
inherit (config.devShells.rust) OCKAM_DISABLE_UPGRADE_CHECK RUSTFLAGS RUST_SRC_PATH LIBCLANG_PATH;
4747
inherit (config.devShells.tooling) BATS_LIB;
4848
};
4949
};

‎tools/nix/parts/rust.nix

+4-2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ in {
3434
devShells = let
3535
compilerTools = with pkgs; [
3636
clang
37+
libclang
3738
cmake
3839
lld
3940
];
@@ -94,6 +95,7 @@ in {
9495
OCKAM_DISABLE_UPGRADE_CHECK = lib.optional cfg.disableUpgradeCheck true;
9596
RUSTFLAGS = "--cfg tokio_unstable -Cdebuginfo=0 -Dwarnings";
9697
CARGO_INCREMENTAL = 0;
98+
LIBCLANG_PATH = "${pkgs.libclang.lib}/lib";
9799
};
98100
in {
99101
rust = pkgs.mkShell {
@@ -107,7 +109,7 @@ in {
107109

108110
inherit (config.devShells.tooling) BATS_LIB;
109111

110-
inherit (envVars) CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER OCKAM_DISABLE_UPGRADE_CHECK RUSTFLAGS CARGO_INCREMENTAL;
112+
inherit (envVars) CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER OCKAM_DISABLE_UPGRADE_CHECK RUSTFLAGS CARGO_INCREMENTAL LIBCLANG_PATH;
111113

112114
DYLD_FALLBACK_LIBRARY_PATH = "${toolchain}/lib";
113115
RUST_SRC_PATH = lib.optional cfg.rustAnalyzer "${toolchain}/lib/rustlib/src/rust/library";
@@ -122,7 +124,7 @@ in {
122124
]
123125
++ nightlyTooling
124126
++ sharedInputs;
125-
inherit (envVars) CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER OCKAM_DISABLE_UPGRADE_CHECK RUSTFLAGS CARGO_INCREMENTAL;
127+
inherit (envVars) CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER OCKAM_DISABLE_UPGRADE_CHECK RUSTFLAGS CARGO_INCREMENTAL LIBCLANG_PATH;
126128
DYLD_FALLBACK_LIBRARY_PATH = "${nightlyToolchain}/lib";
127129
RUST_SRC_PATH = lib.optional cfg.rustAnalyzer "${nightlyToolchain}/lib/rustlib/src/rust/library";
128130
};

0 commit comments

Comments
 (0)
Please sign in to comment.