Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nar-compile cannot find mt.exe with Visual Studio 2017 #335

Open
bribass opened this issue Mar 2, 2019 · 2 comments
Open

nar-compile cannot find mt.exe with Visual Studio 2017 #335

bribass opened this issue Mar 2, 2019 · 2 comments

Comments

@bribass
Copy link

bribass commented Mar 2, 2019

The attached nar-issue.zip contains a project that builds a JAR and a JNI library. When built on a Windows 10 machine with Visual Studio 2017 (version 15.9.7), nar-compile fails to build the DLL because it cannot find mt.exe.

[INFO] --- nar-maven-plugin:3.6.0:nar-compile (default-nar-compile) @ nar-mt-issue ---
[INFO] Compiling 1 native files
[INFO] 1 total files to be compiled.
[INFO] Found 8 processors available
[INFO] Limited used processors to 1
[INFO]
Starting Core 0 with 1 source files...
[INFO] native.c
[INFO] Linking...
[INFO] Starting link {link /MANIFEST /MANIFESTFILE:C:\src\terrsrv\pythonsrv\src\nar-issue\target\nar\nar-mt-issue-0.1-SNAPSHOT-amd64-Windows-msvc-jni\lib\amd64-Windows-msvc\jni\native.manifest /MACHINE:X64 /LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\lib\x64 /LIBPATH:C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\ucrt\x64 /LIBPATH:C:\Program Files (x86)\Windows Kits\10\Lib\10.0.17763.0\um\x64 /NOLOGO /DLL /SUBSYSTEM:CONSOLE /INCREMENTAL:NO}
[INFO]    Creating library native.lib and object native.exp
[INFO] + mt.exe /manifest C:\src\terrsrv\pythonsrv\src\nar-issue\target\nar\nar-mt-issue-0.1-SNAPSHOT-amd64-Windows-msvc-jni\lib\amd64-Windows-msvc\jni\native.manifest /outputresource:C:\src\terrsrv\pythonsrv\src\nar-issue\target\nar\nar-mt-issue-0.1-SNAPSHOT-amd64-Windows-msvc-jni\lib\amd64-Windows-msvc\jni\native.dll;#2
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 16.039 s
[INFO] Finished at: 2019-03-01T14:32:01-08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.maven-nar:nar-maven-plugin:3.6.0:nar-compile (default-nar-compile) on project nar-mt-issue: Could not launch cmd.exe /X /C "mt.exe /manifest C:\src\terrsrv\pythonsrv\src\nar-issue\target\nar\nar-mt-issue-0.1-SNAPSHOT-amd64-Windows-msvc-jni\lib\amd64-Windows-msvc\jni\native.manifest /outputresource:C:\src\terrsrv\pythonsrv\src\nar-issue\target\nar\nar-mt-issue-0.1-SNAPSHOT-amd64-Windows-msvc-jni\lib\amd64-Windows-msvc\jni\native.dll;#2": Error while executing process. Cannot run program "mt.exe": CreateProcess error=2, The system cannot find the file specified -> [Help 1]

If I add the directory C:\Program Files (x86)\Windows Kits\10\bin\10.0.17763.0\x64 (the directory in which mt.exe resides) to the PATH, nar-compile succeeds. However, since nar-maven-plugin automatically determines paths for other parts of nar-compile (i.e., the compiler and the linker), this is not expected (or desired) behavior.

@bribass
Copy link
Author

bribass commented Mar 2, 2019

Attached are the following files:

  • nar-issue.zip: A project that provides a minimal reproduction of the issue.
  • mvn_package.log: The result of running mvn -X package.
  • Dockerfile.txt: A Dockerfile for building an image (in conjuntion with Docker Desktop for Windows) that contains the environment that allows for the issue to be reproduced.

@bribass
Copy link
Author

bribass commented Mar 2, 2019

OK, now I feel stupid. This failure is with version 3.6.0 (the latest available version on Maven Central). I tried again with the current master, and everything is working as expected. Is there any estimation on when a new version (either the 3.7.0 release that is implied by the presence of a tag in the repository, or a 3.7.1 containing the current master) will be available?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant