I'm trying to use dune with elixir-nx/Nx and getting the following error about import.
iex(12)> defmodule ExtendedAllowlist do
...(12)> use Dune.Allowlist, extend: Dune.Allowlist.Default
...(12)>
...(12)> allow Nx, :all
...(12)> allow Nx.Defn, :all
...(12)> end
{:module, ExtendedAllowlist,
<<70, 79, 82, 49, 0, 0, 211, 244, 66, 69, 65, 77, 65, 116, 85, 56, 0, 0, 38,
94, 0, 0, 3, 217, 24, 69, 108, 105, 120, 105, 114, 46, 69, 120, 116, 101,
110, 100, 101, 100, 65, 108, 108, 111, 119, 108, 105, ...>>, :ok}
iex(13)> Dune.eval_string("defmodule Foo do import Nx.Defn; defn foo(n) do Nx.power(n, 2) end end; Foo.foo(3)", allowlist: ExtendedAllowlist)
%Dune.Failure{
type: :module_restricted,
message: "** (DuneRestrictedError) the following syntax is restricted inside defmodule:\n import Nx.Defn",
stdio: ""
}
I'm trying to use dune with elixir-nx/Nx and getting the following error about import.