Jenkins build problem

Having problems with building or using the CefSharp .NET binding? Ask your CEF-related questions here. Please ask general usage questions on StackOverflow.

Moderator: amaitland

Jenkins build problem

Postby bryanforst » Thu Jun 24, 2021 11:46 pm

I am using the build.ps1 script to eventually create a custom CEFSharp build.
For my first tests I am just going to build an existing branch, in this case cefsharp91

If I run builds.ps1 from a cmd (standard not admin) prompt on my windows build machine it works just fine.

However when I run the same command from a Jenkins windows command it seems to have problems
getting the location of my java install correct. See the output below:

Code: Select all
10:33:29 [EnvInject] - Loading node environment variables.
10:33:29 Building remotely on JenkinsWindowsBuild2019 in workspace D:\Jenkins\workspace\Eclipse_CEFSharp_nuget
10:33:29 [Eclipse_CEFSharp_nuget] $ cmd /c call C:\Users\BUILDM~1\AppData\Local\Temp\jenkins7795405647217623009.bat
10:33:29
10:33:29 D:\Jenkins\workspace\Eclipse_CEFSharp_nuget>powershell D:\Jenkins\workspace\Eclipse_CEFSharp_nuget\build.ps1 vs2019
10:33:29
10:33:29 CEF Redist Version = 91.1.21
10:33:29
10:33:29
10:33:29 Restore Nuget Packages
10:33:29
10:33:30 MSBuild auto-detection: using msbuild version '16.10.0.26302' from 'D:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\bin'.
10:33:31 All packages listed in packages.config are already installed.
10:33:31
10:33:31 Starting to build targeting toolchain v142
10:33:31
10:33:31
10:33:31 Targeting v142 using configuration Release on platform x86
10:33:31
10:33:31
10:33:31 VSWhere path C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe
10:33:31
10:33:31
10:33:31 2019InstallPath: D:\Program Files (x86)\Microsoft Visual Studio\2019\Community
10:33:31
10:33:32 cmd.exe : \Java\jre1.8.0_261\bin"" was unexpected at this time.
10:33:32 At D:\Jenkins\workspace\Eclipse_CEFSharp_nuget\build.ps1:61 char:4
10:33:32 +    cmd.exe /c " `"$Path`" $Parameters && set > `"$tempFile`" "
10:33:32 +    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10:33:32     + CategoryInfo          : NotSpecified: (\Java\jre1.8.0_...d at this time.:String) [], RemoteException
10:33:32     + FullyQualifiedErrorId : NativeCommandError
10:33:32 
10:33:32 Exception calling "Start" with "0" argument(s): "The system cannot find the file specified"


Has anyone run into this problem?

One theory i have is the startup user of the Jenkins server is different from the one I use when running it manually. Will have to check with devops to get that changed.
bryanforst
Newbie
 
Posts: 4
Joined: Mon Jun 21, 2021 5:54 am

Re: Jenkins build problem

Postby bryanforst » Tue Jul 13, 2021 2:50 am

Found the solution.
Jenkins appends the java and other program locations to the PATH setting in dos.
Java on this machine is 32bit so the folder has a space in it. Jenkins wraps the path in quotes which screws up the build.ps1 process.

Solution i found is here:
https://issues.jenkins.io/browse/JENKIN ... l-tabpanel

at its simplest means adding
set path=%path:"=%

before anything runs. This was also preventing my CEF build from working
bryanforst
Newbie
 
Posts: 4
Joined: Mon Jun 21, 2021 5:54 am


Return to CefSharp Forum

Who is online

Users browsing this forum: No registered users and 12 guests