Skip to content

Commit 2c464d6

Browse files
committed
Breaking: require user to skip rustler compilation
Part of issue #9
1 parent b470c13 commit 2c464d6

File tree

4 files changed

+7
-23
lines changed

4 files changed

+7
-23
lines changed

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,7 @@ altogether: it compiles the dependency from scratch to let your project
7171
leverage Nix caching. This will mean that you'll have to wait for an initial
7272
compilation in your CI system.
7373

74-
You must disable Rustler's compilation in your release environment as well.
75-
This is done at compile time in the Nix derivation, but your runtime
76-
configuration must match this.
74+
You must disable Rustler's compilation for all rustler_precompiled dependencies.
7775

7876
e.g. for explorer, in `config/prod.exs`:
7977

fixtures/example/config/config.exs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import Config
2+
3+
config :ex_keccak, ExKeccak, skip_compilation?: true
4+
config :explorer, Explorer.PolarsBackend.Native, skip_compilation?: true
5+
config :ex_secp256k1, ExSecp256k1.Impl, skip_compilation?: true
6+
config :tokenizers, Tokenizers.Native, skip_compilation?: true

fixtures/example/deps.nix

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,11 @@ let
4646
] ++ extendedPkgs.lib.lists.optional extendedPkgs.stdenv.isDarwin extendedPkgs.darwin.IOKit;
4747
doCheck = false;
4848
};
49-
elixirConfig = pkgs.writeTextDir "config/config.exs" ''
50-
import Config
51-
52-
config :ex_keccak, ExKeccak, skip_compilation?: true
53-
config :explorer, Explorer.PolarsBackend.Native, skip_compilation?: true
54-
config :ex_secp256k1, ExSecp256k1.Impl, skip_compilation?: true
55-
config :tokenizers, Tokenizers.Native, skip_compilation?: true
56-
'';
5749

5850
in
5951
{
6052
nativeBuildInputs = [ extendedPkgs.cargo ];
6153

62-
appConfigPath = "${elixirConfig}/config";
63-
6454
env.RUSTLER_PRECOMPILED_FORCE_BUILD_ALL = "true";
6555
env.RUSTLER_PRECOMPILED_GLOBAL_CACHE_PATH = "unused-but-required";
6656

lib/deps_nix.ex

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -231,21 +231,11 @@ defmodule DepsNix do
231231
] ++ extendedPkgs.lib.lists.optional extendedPkgs.stdenv.isDarwin extendedPkgs.darwin.IOKit;
232232
doCheck = false;
233233
};
234-
elixirConfig = pkgs.writeTextDir "config/config.exs" ''
235-
import Config
236-
237-
config :ex_keccak, ExKeccak, skip_compilation?: true
238-
config :explorer, Explorer.PolarsBackend.Native, skip_compilation?: true
239-
config :ex_secp256k1, ExSecp256k1.Impl, skip_compilation?: true
240-
config :tokenizers, Tokenizers.Native, skip_compilation?: true
241-
'';
242234
243235
in
244236
{
245237
nativeBuildInputs = [ extendedPkgs.cargo ];
246238
247-
appConfigPath = "${elixirConfig}/config";
248-
249239
env.RUSTLER_PRECOMPILED_FORCE_BUILD_ALL = "true";
250240
env.RUSTLER_PRECOMPILED_GLOBAL_CACHE_PATH = "unused-but-required";
251241

0 commit comments

Comments
 (0)