blackducksoftware / hub-detect

This is now deprecated. Please see synopsys-detect.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Windows support?

omerlh opened this issue · comments

I tried today the Nuget scanner - but encounter the following error:

 WARN--- The nuget executable must be on the path - are you sure you are running on a windows system?

How can I run hub-detect on windows? Is there a powershell alternative to the shell script?

The path of your NuGet executable needs to be added to the PATH system environment variable.

Also, there is a Windows 10 feature you can turn on, called "Windows Subsystem of Linux (Beta)" which will allow you to invoke shell scripts.

https://www.howtogeek.com/265900/everything-you-can-do-with-windows-10s-new-bash-shell/

I am aware to that, but both options you specified are not windows environment. Maybe you should consider changing the error message?
Anyway, look like it is possible to run NuGet on windows. I will try that tomorrow and see if it works.

Update - I manage to install NuGet by using brew, now there is a new error:

 INFO--- Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@649d209a: startup date [Tue Jul 25 08:55:30 IDT 2017]; root of context hierarchy
 INFO--- You seem to be running in a MAC operating system.
 INFO--- Configuration processed completely.
 INFO--- 
Current property values:
------------------------------------------------------------
cleanupBdioFiles = true
cleanupBomToolFiles = true
createVirtualEnv = true
dockerInspectorVersion = 0.1.3
gradleBuildCommand = dependencies
gradleCleanupBuildBlackduckDirectory = true
gradleInspectorVersion = 0.0.7
hubPassword = ****************
hubSignatureScannerMemory = 4096
hubTimeout = 120
hubUrl = <>
hubUsername = teamcity
loggingLevel = INFO
mavenAggregateBom = true
nugetInspectorPackageName = IntegrationNugetInspector
nugetInspectorPackageVersion = 1.0.0
nugetPath = /usr/local/bin/nuget
outputDirectoryPath = /Users/omerl/blackduck
packagistIncludeDevDependencies = true
pearNotRequiredDependencies = false
policyCheckTimeout = 300000
searchDepth = 10
sourcePath = <>
------------------------------------------------------------


 INFO--- NUGET applies given the current configuration.
 INFO--- Running executable >/usr/local/bin/nuget install IntegrationNugetInspector -Version 1.0.0 -OutputDirectory /Users/omerl/blackduck/nuget
 INFO--- Installing 'IntegrationNugetInspector 1.0.0'.
 INFO--- Successfully installed 'IntegrationNugetInspector 1.0.0'.
 INFO--- Running executable >/Users/omerl/blackduck/nuget/IntegrationNugetInspector.1.0.0/tools/IntegrationNugetInspector.exe --target_path=/Users/omerl/dev/pavel/pavel-server/AuthenticationApi --output_directory=/Users/omerl/blackduck/nuget --ignore_failure=false
ERROR--- NUGET threw an Exception: java.io.IOException: Cannot run program "/Users/omerl/blackduck/nuget/IntegrationNugetInspector.1.0.0/tools/IntegrationNugetInspector.exe" (in directory "/Users/omerl/dev/pavel/pavel-server/AuthenticationApi"): error=13, Permission denied
ERROR--- There was a problem communicating with the Hub : Could not find the version: 2017-07-25T08:55:40.488 for project: AuthenticationApi
 INFO--- Registering beans for JMX exposure on startup
 INFO--- Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@649d209a: startup date [Tue Jul 25 08:55:30 IDT 2017]; root of context hierarchy
 INFO--- Unregistering JMX-exposed beans on shutdown
Result code of 0, exiting

Look like it is trying to run exe file, not sure how this is going to work on mac...

commented

ERROR--- NUGET threw an Exception: java.io.IOException: Cannot run program "/Users/omerl/blackduck/nuget/IntegrationNugetInspector.1.0.0/tools/IntegrationNugetInspector.exe" (in directory "/Users/omerl/dev/pavel/pavel-server/AuthenticationApi"): error=13, Permission denied

^------ there is your error.

However since you are on a Mac, not sure what the plan is, the .exe will not run.

I know that - that why I asked about windows support... How should I run NuGet scan with HubDetect?
Also - why permission denied? this is file installed by the HubDetect, into regular user path...

commented

You are running on a Mac and looking for NuGet support, so we are a bit confused, permission denied probably has something to do with trying to run a windows executable on a Mac operating system.

As for your other question. Enable bash or download Git Bash and then just run the script on Windows, it will work with no special modifications.

I am aware to that. I was not expecting that it will work on Mac - that why I originally posted my question. I will try later to today using Git Bash and update.

This actually worked on windows, as you said. With that being said, this is very weird to run shell script on windows - and we will have to figure out how we to do that on TeamCity.

commented

Glad it worked. Well, yes, it is a bit weird although with Windows 10 and Git the bash options are widely available. The other option is to write a Batch script, but it would not offer the same benefits.

Installing Git Bash is absolutely the easiest way to overcome this problem.

This is another reason to work with Docker - the shell script just downloads and run the tool, if it was in a Docker image, there was no need to have the script. Also, you could have the NuGet tool as part of the image - making it a lot easier to use...