diff --git a/installer/mix.tasks/zig.get.ex b/installer/mix.tasks/zig.get.ex index d8d2e62e..408b63b4 100644 --- a/installer/mix.tasks/zig.get.ex +++ b/installer/mix.tasks/zig.get.ex @@ -159,13 +159,16 @@ defmodule Mix.Tasks.Zig.Get do end defp get_public_key(%{verify: false} = opts), do: opts + defp get_public_key(opts) do # this might be fragile. - public_key = http_get!("https://ziglang.org/download/") - |> Floki.parse_document!() - |> Floki.find("[role=\"main\"] .container pre code") - |> Floki.text - |> String.trim + public_key = + http_get!("https://ziglang.org/download/") + |> Floki.parse_document!() + |> Floki.find("[role=\"main\"] .container pre code") + |> Floki.text() + |> String.trim() + %{opts | public_key: public_key} end @@ -229,15 +232,18 @@ defmodule Mix.Tasks.Zig.Get do ], body_format: :binary ) + body end defp fetch_signature!(%{verify: false} = opts), do: opts + defp fetch_signature!(opts) do %{opts | signature: http_get!(opts.url ++ ~c'.minisig')} end defp verify_signature!({bin, %{verify: false}}), do: bin + defp verify_signature!({bin, opts}) do Minisign.verify!(bin, opts.signature, opts.public_key) bin diff --git a/lib/zig/assembler.ex b/lib/zig/assembler.ex index 7afbcdde..d4744e90 100644 --- a/lib/zig/assembler.ex +++ b/lib/zig/assembler.ex @@ -33,11 +33,12 @@ defmodule Zig.Assembler do opts = Keyword.merge([to: directory], opts) - opts = if Keyword.has_key?(opts, :link_lib) do - Keyword.put(opts, :link_lib, adjust_link_lib(opts[:link_lib], opts[:from])) - end + opts = + if Keyword.has_key?(opts, :link_lib) do + Keyword.put(opts, :link_lib, adjust_link_lib(opts[:link_lib], opts[:from])) + end - #Enum.each(opts[:link_lib], fn + # Enum.each(opts[:link_lib], fn # {:system, _} -> :pass # lib -> # target = Path.join(opts[:to], lib) @@ -46,7 +47,7 @@ defmodule Zig.Assembler do # |> Path.join(lib) # |> File.ln_s!(target) # end - #end) + # end) Builder.build(module, opts) end diff --git a/mix.exs b/mix.exs index 5391d045..06fbdb41 100644 --- a/mix.exs +++ b/mix.exs @@ -6,7 +6,7 @@ defmodule Zigler.MixProject do [ app: :zigler, - version: "0.11.1-pre-2", + version: "0.11.1-pre-3", elixir: "~> 1.13", start_permanent: env == :prod, elixirc_paths: elixirc_paths(env), diff --git a/test/_support/support_content.ex b/test/_support/support_content.ex index 38a8c18f..66342ad6 100644 --- a/test/_support/support_content.ex +++ b/test/_support/support_content.ex @@ -11,4 +11,4 @@ defmodule ZiglerTest.SupportContent do end end end -end \ No newline at end of file +end diff --git a/test/integration/cxx/easy_c_test.exs b/test/integration/cxx/easy_c_test.exs index cf70abbe..f05501bf 100644 --- a/test/integration/cxx/easy_c_test.exs +++ b/test/integration/cxx/easy_c_test.exs @@ -8,7 +8,7 @@ if {:unix, :linux} == :os.type() do otp_app: :zigler, easy_c: "cblas.h", link_lib: {:system, "blas"}, - #leak_check: true, + # leak_check: true, nifs: [ :cblas_dasum, cblas_daxpy: [return: [4, length: {:arg, 0}]], diff --git a/test/integration/cxx/link_lib_local_test.exs b/test/integration/cxx/link_lib_local_test.exs index 851e5f0e..7deaa855 100644 --- a/test/integration/cxx/link_lib_local_test.exs +++ b/test/integration/cxx/link_lib_local_test.exs @@ -1,4 +1,7 @@ -ZiglerTest.SupportContent.ensure_lib("test/integration/cxx/libtest.a", "test/integration/cxx/test.zig") +ZiglerTest.SupportContent.ensure_lib( + "test/integration/cxx/libtest.a", + "test/integration/cxx/test.zig" +) defmodule ZiglerTest.Integration.CXX.LinkLibLocalTest do use ZiglerTest.IntegrationCase, async: true @@ -18,4 +21,4 @@ defmodule ZiglerTest.Integration.CXX.LinkLibLocalTest do test "can link a local library" do assert 48 == test_add_one(47) end -end \ No newline at end of file +end