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

Msvc init #174

Closed
wants to merge 2 commits into from
Closed

Msvc init #174

wants to merge 2 commits into from

Conversation

pauldaustin
Copy link
Contributor

Added the Msvc CCTask configuration to the NarTestCompileMojo and NarVcprojMojo. This should allow the tests to find the compiler using the path and complete.

AbstractNarMojo. This is required when the Linker.getVersion() is used
with a dummy NarCompileMojo.
NarVcprojMojo. This should allow the tests to find the compiler using
the path and complete.
@buildhive
Copy link

NAR plugin for Maven » nar-maven-plugin #335 SUCCESS
This pull request looks good
(what's this?)

@ctrueden ctrueden closed this in b0f9dc7 Jun 3, 2015
@ctrueden
Copy link
Contributor

ctrueden commented Jun 3, 2015

Rock on, we'll see how the Windows build gets on.

@ctrueden
Copy link
Contributor

ctrueden commented Jun 3, 2015

@pauldaustin
Copy link
Contributor Author

Is it possible to re-configure the jenkins windows build so that it has the invoker.debug=true set. That way we can verify which version of the compiler is being picked up and what the PATH settings look like?

If you try a build of a different branch does it work?

Is there anyone who can verify if the temp directory is out of space?

@ctrueden
Copy link
Contributor

ctrueden commented Jun 3, 2015

@pauldaustin Thanks for the reminder about the temp folder. I changed the build configuration, adding a call to delete all %TMP%\_CL_*.ss files before each build. But it seems that wasn't the problem:

+ cmd /c 'del /q "%TMP%\_CL_*.ss"'
Could Not Find C:\Users\VIRTUA~1\AppData\Local\Temp\_CL_*.ss

I also added -Dinvoker.debug=true to the mvn calll, but it doesn't immediately appear to have made any difference.

http://jenkins.imagej.net/job/NAR-Maven-Plugin-windows/68/console

I cannot remote to the Windows VM right now because I'm currently traveling. But can dig further next week when I am back, if you are stuck.

@pauldaustin
Copy link
Contributor Author

The extra debug information gets put in the build.log for the test script.

For example.

http://jenkins.imagej.net/job/NAR-Maven-Plugin-windows/ws/target/it/it0003-jni/build.log

From there I was able to get the following PATH and the command run to compile. Is it possible to try that on the command line? Maybe try it with and without the PATH to see if there is a different between the default environment and the one constructed in the plugin

set PATH=C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE;C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin;C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin
cl  /c /nologo /EHsc /DNDEBUG /MD /GR /DWindows /DWIN32 "/Itarget\it\it0003-jni\target\nar\javah-include" "/IC:\msysgit\src\fiji\java\win32\jdk1.6.0_24\include" "/IC:\msysgit\src\fiji\java\win32\jdk1.6.0_24\include\win32" "/IC:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include" "/IC:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include" C:\msysgit\workspace\target\it\it0003-jni\src\main\c\HelloWorldJNI.c

@ctrueden
Copy link
Contributor

@pauldaustin Sorry for the long delay in reply. It's been a busy summer.

Looking at the most recent build log, the failure seems very likely related to this part:

[DEBUG] cmd /c "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\cl"  /c /nologo /EHsc /DNDEBUG /MD /GR /DWIN32 /IC:\msysgit\workspace\NAR-Maven-Plugin-windows\target\it\it0003-jni\target\nar\obj\amd64-Windows-msvc /IC:\msysgit\workspace\NAR-Maven-Plugin-windows\target\it\it0003-jni\target\nar\obj\amd64-Windows-msvc /IC:\msysgit\workspace\NAR-Maven-Plugin-windows\target\it\it0003-jni\target\nar\javah-include /Ic:\msysgit\src\fiji\java\win64\jdk1.7.0_79\include /Ic:\msysgit\src\fiji\java\win64\jdk1.7.0_79\include\win32 "/IC:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include" "/IC:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include" /FoHelloWorldJNI.-1771989671.obj C:\msysgit\workspace\NAR-Maven-Plugin-windows\target\it\it0003-jni\src\main\c\HelloWorldJNI.c
[DEBUG] Setting environment variable: PATH=C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcpackages;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Tools;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE;C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\x64;C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem
[DEBUG] Setting environment variable: SystemRoot=C:\Windows
[DEBUG] Setting environment variable: TMP=C:\Temp
[DEBUG] Execute:Java13CommandLauncher: Executing 'cmd' with arguments:
'/c'
'C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\cl'
''
'/c'
'/nologo'
'/EHsc'
'/DNDEBUG'
'/MD'
'/GR'
'/DWIN32'
'/IC:\msysgit\workspace\NAR-Maven-Plugin-windows\target\it\it0003-jni\target\nar\obj\amd64-Windows-msvc'
'/IC:\msysgit\workspace\NAR-Maven-Plugin-windows\target\it\it0003-jni\target\nar\obj\amd64-Windows-msvc'
'/IC:\msysgit\workspace\NAR-Maven-Plugin-windows\target\it\it0003-jni\target\nar\javah-include'
'/Ic:\msysgit\src\fiji\java\win64\jdk1.7.0_79\include'
'/Ic:\msysgit\src\fiji\java\win64\jdk1.7.0_79\include\win32'
'/IC:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include'
'/IC:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include'
'/FoHelloWorldJNI.-1771989671.obj'
'C:\msysgit\workspace\NAR-Maven-Plugin-windows\target\it\it0003-jni\src\main\c\HelloWorldJNI.c'

The ' characters around the executable and arguments are
not part of the command.
[ERROR] 'C:\Program' is not recognized as an internal or external command,
[ERROR] operable program or batch file.

In other words: the double quotes are being stripped from the command being passed to cmd /c.

@pauldaustin Ideas on how to fix? I thought I'd ask you first, in case you know where/how this might be happening. Otherwise we can dig into the code. But I didn't immediately find it after 10 minutes of grepping.

@ctrueden
Copy link
Contributor

Also @GregDomjan, as another Windows guy—any chance the fix here is obvious to you?

@pauldaustin
Copy link
Contributor Author

Curtis,

Which branch is this on?

I’m going off the grid for a few days but might be able to look next week.

I’ll run it through a debugger to see where the quotes get stripped off. Hopefully not in the ant code.

Paul

On 27 Aug 2015, at 14:14, Curtis Rueden notifications@github.com wrote:

Also @GregDomjan https://github.com/GregDomjan, as another Windows guy—any chance the fix here is obvious to you?


Reply to this email directly or view it on GitHub #174 (comment).

@ctrueden
Copy link
Contributor

@pauldaustin It's the master branch.

And thanks for looking into it! No rush—just wanted to follow up since we do eventually need to fix it...

@pauldaustin
Copy link
Contributor Author

Thanks,

will look at this next week

On 27 Aug 2015, at 14:20, Curtis Rueden notifications@github.com wrote:

@pauldaustin https://github.com/pauldaustin It's the master branch.


Reply to this email directly or view it on GitHub #174 (comment).

@ctrueden
Copy link
Contributor

@pauldaustin Any word?

There has been a burst of activity lately regarding MSVC, and NAR on Windows in general—so it would be really helpful to have a working Windows-based CI system for NAR.

Unfortunately, I am woefully unequipped to discuss or troubleshoot Windows-centric issues with NAR. But the good news is that @GregDomjan and @markjohndoyle are much more knowledgeable, and are paying attention (at least for the moment 😉).

@pauldaustin
Copy link
Contributor Author

Chris,

I’m going away for the next 3 weeks.

Also the code to launch the command has changed since what I had working due to some security issues with what I’d done. As such I have no idea now what the correct way to call the commands such that the environment gets passed through correctly.

It also gets confusing as the code delegates off to an ant task to launch the executable so trying to figure out what it’s doing was a little tricky and not something we could modify easily.

I’m also not a windows developer so don’t know all the ins and outs of calling command line tools.

Paul

On 26 Oct 2015, at 11:37, Curtis Rueden notifications@github.com wrote:

@pauldaustin https://github.com/pauldaustin Any word?

There has been a burst of activity lately regarding MSVC, and NAR on Windows in general—so it would be really helpful to have a working Windows-based CI system for NAR.

Unfortunately, I am woefully unequipped to discuss or troubleshoot Windows-centric issues with NAR. But the good news is that @GregDomjan https://github.com/GregDomjan and @markjohndoyle https://github.com/markjohndoyle are much more knowledgeable, and are paying attention (at least for the moment ).


Reply to this email directly or view it on GitHub #174 (comment).

@kristofmoens
Copy link
Contributor

I think when I first used the nar-plugin, I had a similar problem on my first build. Can't remember if I had to change something.

But when I build now, it seems to be working on my machine... Could you maybe rebuild again?
Build log:

[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ nar-maven-plugin ---
[INFO] Building jar: c:\thalerng\synergy\nar-maven-plugin\target\nar-maven-plugin-3.3.0.jar
[INFO]
[INFO] --- maven-plugin-plugin:3.2:addPluginArtifactMetadata (default-addPluginArtifactMetadata) @ nar-maven-plugin ---
[INFO]
[INFO] --- maven-invoker-plugin:1.8:install (integration-test) @ nar-maven-plugin ---
[INFO] Installing c:\thalerng\synergy\nar-maven-plugin\pom.xml to c:\thalerng\synergy\nar-maven-plugin\target\it-repo\com\github\maven-nar\nar-maven-plugin\3.3.0\nar-maven-plugin-3.3.0.pom
[INFO] Installing c:\thalerng\synergy\nar-maven-plugin\target\nar-maven-plugin-3.3.0.jar to c:\thalerng\synergy\nar-maven-plugin\target\it-repo\com\github\maven-nar\nar-maven-plugin\3.3.0\nar-maven-plugin-3.3.0.jar
[INFO]
[INFO] --- maven-invoker-plugin:1.8:run (integration-test) @ nar-maven-plugin ---
[INFO] Building: it-parent\pom.xml
[INFO] ..SUCCESS (2.8 s)
[INFO] Building: it0003-jni\pom.xml
[INFO] ..SUCCESS (14.5 s)
[INFO] Building: it0007-lib-shared\pom.xml
[INFO] ..SUCCESS (12.9 s)
...
[INFO] ..SUCCESS (8.9 s)
[INFO] Building: it0027-dep-jni-native-lib-loader\pom.xml
[INFO] ..SUCCESS (7.6 s)
[INFO] Building: it0028-scope\pom.xml
[INFO] ..SUCCESS (30.5 s)
[INFO] -------------------------------------------------
[INFO] Build Summary:
[INFO] Passed: 24, Failed: 0, Errors: 0, Skipped: 0
[INFO] -------------------------------------------------
[INFO]
[INFO] --- maven-invoker-plugin:1.8:integration-test (integration-test) @ nar-maven-plugin ---
[INFO] Building: it-parent\pom.xml
[INFO] ..SUCCESS (3.0 s)
[INFO] Building: it0003-jni\pom.xml
[INFO] ..SUCCESS (15.1 s)
...
[INFO] Building: it0027-dep-jni-native-lib-loader\pom.xml
[INFO] ..SUCCESS (8.7 s)
[INFO] Building: it0028-scope\pom.xml
[INFO] ..SUCCESS (29.5 s)
[INFO]
[INFO] --- maven-invoker-plugin:1.8:verify (integration-test) @ nar-maven-plugin ---
[INFO] -------------------------------------------------
[INFO] Build Summary:
[INFO] Passed: 24, Failed: 0, Errors: 0, Skipped: 0
[INFO] -------------------------------------------------
[INFO]
[INFO] --- maven-install-plugin:2.5.1:install (default-install) @ nar-maven-plugin ---
[INFO] Installing c:\thalerng\synergy\nar-maven-plugin\target\nar-maven-plugin-3.3.0.jar to C:\Users\kmoens.m2\repository\com\github\maven-nar\nar-maven-plugin\3.3.0\nar-maven-plugin-3.3.0.jar
[INFO] Installing c:\thalerng\synergy\nar-maven-plugin\pom.xml to C:\Users\kmoens.m2\repository\com\github\maven-nar\nar-maven-plugin\3.3.0\nar-maven-plugin-3.3.0.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------

@ctrueden
Copy link
Contributor

ctrueden commented Jan 4, 2016

@kristofmoens wrote:

I think when I first used the nar-plugin, I had a similar problem on my first build. Can't remember if I had to change something.

But when I build now, it seems to be working on my machine... Could you maybe rebuild again?

It could be helpful to know what changed on your system that allowed it to succeed. I ran the build again on our Windows Jenkins node and it still fails.

@markjohndoyle
Copy link
Contributor

Hey all,

I'm actually one of those weird people that develop non-specific code on Windows. My target is normally linux so it also helps keeping things portablel. I use gcc and clang not msvc, in fact I don't have much experience using MSVC at all.

I'm a bit overloaded at the minute but I can probably test whether the nar plugin doesn't break when using other compilers on Windows.

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

Successfully merging this pull request may close these issues.

5 participants