尝试编译时 nmake 失败 argon2_elixir
nmake fails when attempting to compile argon2_elixir
我正在尝试将 argon2_elixir
添加到我的 phoenix 项目中,但在编译时出现此错误:
mix compile
==> argon2_elixir
Microsoft (R) Program Maintenance Utility Version 14.00.24210.0
Copyright (C) Microsoft Corporation. All rights reserved.
makefile(34) : fatal error U1000: syntax error : ')' missing in macro invocation
Stop.
could not compile dependency :argon2_elixir, "mix compile" failed. You can recompile this dependency with "mix deps.compile argon2_elixir", update it with "mix deps.update argon2_elixir" or clean it with "mix deps.clean argon2_elixir"
==> chatter
** (Mix) Could not compile with "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\nmake.exe" (exit status: 2).
One option is to install a recent version of
[Visual C++ Build Tools](http://landinghub.visualstudio.com/visual-cpp-build-tools)
either manually or using [Chocolatey](https://chocolatey.org/) -
`choco install VisualCppBuildTools`.
After installing Visual C++ Build Tools, look in the "Program Files (x86)"
directory and search for "Microsoft Visual Studio". Note down the full path
of the folder with the highest version number. Open the "run" command and
type in the following command (make sure that the path and version number
are correct):
cmd /K "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
This should open up a command prompt with the necessary environment variables
set, and from which you will be able to run the "mix compile", "mix deps.compile",
and "mix test" commands.
在此错误之前,它先前提到如何找不到 nmake.exe
并将其设置为 MAKE
系统变量。所以我进入环境变量并将路径设置为 C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\nmake.exe
.
如果我使用以下命令打开 cmd/powershell cmd /K "C:\..." amd64
我必须 cd
回到 phoenix 项目。在运行mix compile
/mix deps.compile argon2_elixir
之后,它给了我同样的错误。
我注意到有一个 closed github issue 但它没有解决方案。
这是我的 mix.ex 文件
defmodule Chatter.MixProject do
use Mix.Project
def project do
[
app: :chatter,
version: "0.1.0",
elixir: "~> 1.5",
elixirc_paths: elixirc_paths(Mix.env()),
compilers: [:phoenix, :gettext] ++ Mix.compilers(),
start_permanent: Mix.env() == :prod,
aliases: aliases(),
deps: deps()
]
end
# Configuration for the OTP application.
#
# Type `mix help compile.app` for more information.
def application do
[
mod: {Chatter.Application, []},
extra_applications: [:logger, :runtime_tools, :phoenix, :phoenix_pubsub, :phoenix_html, :cowboy, :logger, :gettext,
:phoenix_ecto, :postgrex, :comeonin ]
]
end
# Specifies which paths to compile per environment.
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_), do: ["lib"]
# Specifies your project dependencies.
#
# Type `mix help deps` for examples and options.
defp deps do
[
{:phoenix, "~> 1.4.1"},
{:phoenix_pubsub, "~> 1.1"},
{:phoenix_ecto, "~> 4.0"},
{:ecto_sql, "~> 3.0"},
{:postgrex, ">= 0.0.0"},
{:phoenix_html, "~> 2.11"},
{:phoenix_live_reload, "~> 1.2", only: :dev},
{:gettext, "~> 0.11"},
{:jason, "~> 1.0"},
{:plug_cowboy, "~> 2.0"},
{:comeonin, "~> 5.1.1"},
{:argon2_elixir, "~> 2.0"}
]
end
# Aliases are shortcuts or tasks specific to the current project.
# For example, to create, migrate and run the seeds file at once:
#
# $ mix ecto.setup
#
# See the documentation for `Mix` for more info on aliases.
defp aliases do
[
"ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"],
"ecto.reset": ["ecto.drop", "ecto.setup"],
test: ["ecto.create --quiet", "ecto.migrate", "test"]
]
end
end
您在 Makefile
中的第 34 行遇到错误。它应该在 Windows 上使用 Makefile.win
而不是 Makefile
,但在这种情况下它不会。
原来这是elixir_make
的"feature"。如果要使用的 make 可执行文件是 nmake
,它使用参数 /F Makefile.win
,否则它不指定要使用哪个 makefile,并且 nmake
可能会退回到使用 Makefile
.发生这种情况 here.
但是由于您将 MAKE
环境变量设置为 C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\nmake.exe
,这不再等于 nmake
,因此使用 Makefile
而不是 Makefile.win
- 你得到一个错误。
我建议两件事:
- 不要设置
MAKE
环境变量,而是更改 PATH
以包含 nmake.exe
所在的目录。
- Report a bug in
elixir_make
。它可能应该检查 MAKE
指定的可执行文件是否具有文件名 nmake
或 nmake.exe
而不管目录,而不是简单地与字符串 "nmake"
. 进行比较
我正在尝试将 argon2_elixir
添加到我的 phoenix 项目中,但在编译时出现此错误:
mix compile
==> argon2_elixir
Microsoft (R) Program Maintenance Utility Version 14.00.24210.0
Copyright (C) Microsoft Corporation. All rights reserved.
makefile(34) : fatal error U1000: syntax error : ')' missing in macro invocation
Stop.
could not compile dependency :argon2_elixir, "mix compile" failed. You can recompile this dependency with "mix deps.compile argon2_elixir", update it with "mix deps.update argon2_elixir" or clean it with "mix deps.clean argon2_elixir"
==> chatter
** (Mix) Could not compile with "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\nmake.exe" (exit status: 2).
One option is to install a recent version of
[Visual C++ Build Tools](http://landinghub.visualstudio.com/visual-cpp-build-tools)
either manually or using [Chocolatey](https://chocolatey.org/) -
`choco install VisualCppBuildTools`.
After installing Visual C++ Build Tools, look in the "Program Files (x86)"
directory and search for "Microsoft Visual Studio". Note down the full path
of the folder with the highest version number. Open the "run" command and
type in the following command (make sure that the path and version number
are correct):
cmd /K "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
This should open up a command prompt with the necessary environment variables
set, and from which you will be able to run the "mix compile", "mix deps.compile",
and "mix test" commands.
在此错误之前,它先前提到如何找不到 nmake.exe
并将其设置为 MAKE
系统变量。所以我进入环境变量并将路径设置为 C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\nmake.exe
.
如果我使用以下命令打开 cmd/powershell cmd /K "C:\..." amd64
我必须 cd
回到 phoenix 项目。在运行mix compile
/mix deps.compile argon2_elixir
之后,它给了我同样的错误。
我注意到有一个 closed github issue 但它没有解决方案。
这是我的 mix.ex 文件
defmodule Chatter.MixProject do
use Mix.Project
def project do
[
app: :chatter,
version: "0.1.0",
elixir: "~> 1.5",
elixirc_paths: elixirc_paths(Mix.env()),
compilers: [:phoenix, :gettext] ++ Mix.compilers(),
start_permanent: Mix.env() == :prod,
aliases: aliases(),
deps: deps()
]
end
# Configuration for the OTP application.
#
# Type `mix help compile.app` for more information.
def application do
[
mod: {Chatter.Application, []},
extra_applications: [:logger, :runtime_tools, :phoenix, :phoenix_pubsub, :phoenix_html, :cowboy, :logger, :gettext,
:phoenix_ecto, :postgrex, :comeonin ]
]
end
# Specifies which paths to compile per environment.
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_), do: ["lib"]
# Specifies your project dependencies.
#
# Type `mix help deps` for examples and options.
defp deps do
[
{:phoenix, "~> 1.4.1"},
{:phoenix_pubsub, "~> 1.1"},
{:phoenix_ecto, "~> 4.0"},
{:ecto_sql, "~> 3.0"},
{:postgrex, ">= 0.0.0"},
{:phoenix_html, "~> 2.11"},
{:phoenix_live_reload, "~> 1.2", only: :dev},
{:gettext, "~> 0.11"},
{:jason, "~> 1.0"},
{:plug_cowboy, "~> 2.0"},
{:comeonin, "~> 5.1.1"},
{:argon2_elixir, "~> 2.0"}
]
end
# Aliases are shortcuts or tasks specific to the current project.
# For example, to create, migrate and run the seeds file at once:
#
# $ mix ecto.setup
#
# See the documentation for `Mix` for more info on aliases.
defp aliases do
[
"ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"],
"ecto.reset": ["ecto.drop", "ecto.setup"],
test: ["ecto.create --quiet", "ecto.migrate", "test"]
]
end
end
您在 Makefile
中的第 34 行遇到错误。它应该在 Windows 上使用 Makefile.win
而不是 Makefile
,但在这种情况下它不会。
原来这是elixir_make
的"feature"。如果要使用的 make 可执行文件是 nmake
,它使用参数 /F Makefile.win
,否则它不指定要使用哪个 makefile,并且 nmake
可能会退回到使用 Makefile
.发生这种情况 here.
但是由于您将 MAKE
环境变量设置为 C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\nmake.exe
,这不再等于 nmake
,因此使用 Makefile
而不是 Makefile.win
- 你得到一个错误。
我建议两件事:
- 不要设置
MAKE
环境变量,而是更改PATH
以包含nmake.exe
所在的目录。 - Report a bug in
elixir_make
。它可能应该检查MAKE
指定的可执行文件是否具有文件名nmake
或nmake.exe
而不管目录,而不是简单地与字符串"nmake"
. 进行比较