Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: [1] 2  Send TopicPrint
Very Hot Topic (More than 25 Replies) VMBuild does not find board when run as Jenkins job (Read 1865 times)
revvers
Junior Member
**
Offline


Posts: 30
Joined: Sep 11th, 2023
VMBuild does not find board when run as Jenkins job
Oct 4th, 2024 at 11:09pm
Print Post  
I'm using VMBuild in a Jenkins job for a nightly build. Unfortunately, it does not find the board I need to compile against. It is probably an issue with the user account under which the job is run. I don't know how to 'install' boards under a non-interactive account, if that is what is required.

Also, as the following output shows, the switch
Code
Select All
-builder.close=true 

does not seem to work in this job context.

Code
Select All
"C:\Program Files\VMicro\VMBuilder\VMBuild.exe" erFirmware\PumpControllerFirmware.vcxproj" -builder.build=true -builder.board_id=minima -builder.close=true
The operation failed with exception: Unable to find board: minima
System.Exception: Unable to find board: minima
   at VMBuild.VMBuilder.SelectedBoard(VMBuilderProject oProject)
   at VMBuild.VMBuilder.BuilderWrapperCreate(VMBuilderProject oProject)
   at VMBuild.VMBuilder.RunBuilder()
   at VMBuild.VMBuilder..ctor(VMBuildArgs _vmArgs)
   at VMBuild.Program.Main(String[] args)Press any key to continue.

Unhandled Exception: System.InvalidOperationException: Cannot read keys when either application does not have a console or when console input has been redirected from a file. Try Console.Read.
   at System.Console.ReadKey(Boolean intercept)
   at VMBuild.Program.Main(String[] args) 

  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2499
Joined: Feb 13th, 2019
Re: VMBuild does not find board when run as Jenkins job
Reply #1 - Oct 7th, 2024 at 11:01am
Print Post  
Thanks for the report.

For headless builds you will want to specify both the builder.close and builder.closeonerror flags so it exits without waiting for input in both success and failure scenarios.

One option is to:
  • Instal the Arduino 1.6/1.8 IDE from ZIP to your normal machine.
  • Then create the portable folder within the IDE folder (as shown here).
  • Then you can install the board packages you need using the Arduino IDE UI (which will be installed beneath the portable folder created above).
  • Now you can copy the whole folder to the Jenkins server.
  • Passing in the -builder.application_id=arduino16x, and then also pass the -builder.ide_path pointing to the folder the IDE is in on the Jenkins server.


This will then use the boards from the IDE and its' portable folders for the build process.

We are reviewing this area currently and if there is a better way to deploy this setup to a headless environment we will update this thread.
  
Back to top
IP Logged
 
revvers
Junior Member
**
Offline


Posts: 30
Joined: Sep 11th, 2023
Re: VMBuild does not find board when run as Jenkins job
Reply #2 - Oct 7th, 2024 at 9:18pm
Print Post  
As usual, thanks for the quick and thorough response.

Used:
Code
Select All
-builder.close=true -builder.closeonerror=true 


but got same error.

Code
Select All
Unhandled Exception: System.InvalidOperationException: Cannot read keys when either application does not have a console or when console input has been redirected from a file. Try Console.Read.
   at System.Console.ReadKey(Boolean intercept)
   at VMBuild.Program.Main(String[] args) 



What do you think I'm doing wrong?
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2499
Joined: Feb 13th, 2019
Re: VMBuild does not find board when run as Jenkins job
Reply #3 - Oct 8th, 2024 at 2:34pm
Print Post  
Can you try the latest VMBuilder version (below), which should remove the error and will add a message stating the redirected input to help with any future issues.
https://1drv.ms/u/s!AsT00oFsGAmRoZ1tV0Ac1NsuNjMmlg?e=tLT9ag
  
Back to top
IP Logged
 
revvers
Junior Member
**
Offline


Posts: 30
Joined: Sep 11th, 2023
Re: VMBuild does not find board when run as Jenkins job
Reply #4 - Oct 12th, 2024 at 1:08am
Print Post  
Latest version fixes the key input error. Thanks!

I can't get the 'portable' config to work. Maybe you can update that page so that folder structure matches the current v2.3.3 structure. I'm not sure where to create the 'portable' folder. 

And also, contrary to the documentation, when I run the IDE from within the portable distribution, it picks up the path to board packages from the installed version. Even if I uninstall the desktop app, the build job still fails to find the board.

Are we sure 'minima' is the correct board ID?

I've also tried this https://forum.arduino.cc/t/change-board-package-folder-for-shared-access/1231038 and succeeded in changing the boards folder to a shared drive to which the Jenkins job has access. But it fails in the same way.
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2499
Joined: Feb 13th, 2019
Re: VMBuild does not find board when run as Jenkins job
Reply #5 - Oct 14th, 2024 at 1:21pm
Print Post  
Thanks for the update, can you try the latest version from the link below:
https://1drv.ms/u/s!AsT00oFsGAmRoZ1tV0Ac1NsuNjMmlg?e=PSc7Vi

This will pick up the settings from the Arduino2 IDE correctly, and the location of the board packages can now also be specified using the builder.packages_path flag whch has been updated on the CLI Documentation Page:
e.g. -builder.packages_path=C:\Arduino15

https://www.visualmicro.com/page/Visual-Micro-Command-Line-Interface.aspx
  
Back to top
IP Logged
 
revvers
Junior Member
**
Offline


Posts: 30
Joined: Sep 11th, 2023
Re: VMBuild does not find board when run as Jenkins job
Reply #6 - Oct 15th, 2024 at 12:35am
Print Post  
Dang - really thought you fixed it but unfortunately, no change...

Code
Select All
"C:\Program Files\VMicro\VMBuilder\VMBuild.exe"
-builder.project_path="F:\JenkinsWorkspaces\xxx\PumpControllerFirmware.vcxproj"
-builder.build=true -builder.close=true -builder.closeonerror=true
-builder.ide_path="C:\Program Files\Arduino IDE"
-builder.packages_path="D:\Arduino15\packages"
-builder.board_id=minima
-builder.output_directory="F:\JenkinsWorkspaces\xxx\dist"
The operation failed with exception: Unable to find board: minima
System.Exception: Unable to find board: minima
   at VMBuild.VMBuilder.SelectedBoard(VMBuilderProject oProject)
   at VMBuild.VMBuilder.BuilderWrapperCreate(VMBuilderProject oProject)
   at VMBuild.VMBuilder.RunBuilder()
   at VMBuild.VMBuilder..ctor(VMBuildArgs _vmArgs)
   at VMBuild.Program.Main(String[] args)
F:\JenkinsWorkspaces\xxx_Nightly_Build>exit -1
Build step 'Execute Windows batch command' marked build as failure
[Checks API] No suitable checks publisher found.
Finished: FAILURE 



Also, I don't seem to have a "vMicro>general options>contributions folder" option. I just updated to the latest VS extension as far as I can tell.
« Last Edit: Oct 18th, 2024 at 8:16pm by revvers »  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
revvers
Junior Member
**
Offline


Posts: 30
Joined: Sep 11th, 2023
Re: VMBuild does not find board when run as Jenkins job
Reply #7 - Oct 22nd, 2024 at 3:33pm
Print Post  
Any ideas? Thanks.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12166
Location: United Kingdom
Joined: Apr 10th, 2010
Re: VMBuild does not find board when run as Jenkins job
Reply #8 - Oct 23rd, 2024 at 5:48am
Print Post  
Sorry there is a documentation error. set the packages path to the arduino15 folder. don't add the \packages sub folder part.

  
Back to top
IP Logged
 
revvers
Junior Member
**
Offline


Posts: 30
Joined: Sep 11th, 2023
Re: VMBuild does not find board when run as Jenkins job
Reply #9 - Oct 24th, 2024 at 9:09pm
Print Post  
Code
Select All
"C:\Program Files\VMicro\VMBuilder\VMBuild.exe"
-builder.project_path="PumpControllerFirmware.vcxproj"
-builder.build=true -builder.close=true -builder.closeonerror=true
-builder.packages_path="D:\Arduino15"
-builder.ide_path="c:\program files\microsoft visual studio\2022\enterprise\common7\ide\extensions\54nfnzpu.boe\Micro Platforms\arduino16x"
The operation failed with exception: Unable to find board: minima
System.Exception: Unable to find board: minima
   at VMBuild.VMBuilder.SelectedBoard(VMBuilderProject oProject)
   at VMBuild.VMBuilder.BuilderWrapperCreate(VMBuilderProject oProject)
   at VMBuild.VMBuilder.RunBuilder()
   at VMBuild.VMBuilder..ctor(VMBuildArgs _vmArgs)
   at VMBuild.Program.Main(String[] args)

"C:\Program Files\VMicro\VMBuilder\VMBuild.exe" -builder.project_path="PumpControllerFirmware.vcxproj"
-builder.build=true -builder.close=true -builder.closeonerror=true
-builder.packages_path="D:\Arduino15"
The operation failed with exception: Visual Micro: Program not found opening settings
.ino
System.Exception: Visual Micro: Program not found opening settings
.ino
   at Visual.Micro.ProgramConfiguration.ProgramSettingsReader..ctor(String programFullName, String _SettingsExt)
   at Visual.Micro.ProgramConfiguration.ProgramSettings..ctor(String programFullName, String _SettingsExt)
   at VMBuild.VMBuilder.BuilderWrapperCreate(VMBuilderProject oProject)
   at VMBuild.VMBuilder.RunBuilder()
   at VMBuild.VMBuilder..ctor(VMBuildArgs _vmArgs)
   at VMBuild.Program.Main(String[] args)
 



Maybe unrelated, but I can't compile my project in VS IDE either (on Jenkens server; works on all other machines). It appears that it is not outputting the object files for my shared library project. Each file is compiled with '-o "nul"' for some reason.
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12166
Location: United Kingdom
Joined: Apr 10th, 2010
Re: VMBuild does not find board when run as Jenkins job
Reply #10 - Oct 25th, 2024 at 8:29pm
Print Post  
Don't set the ide path. It only applies to arduino1x ide builds.

If the vMicro extension is not finding any boards and you have not entered any values in the vMicro IDE Locations > Arduino 2 then the arduino-cli.yaml should be used to discover paths.

"C:\Program Files\VMicro\VMBuilder\VMBuild.exe"
-builder.project_path="PumpControllerFirmware.vcxproj"
-builder.build=true -builder.close=true -builder.closeonerror=true

Zip and send us your vxcproj if you have continued problem.
  
Back to top
IP Logged
 
revvers
Junior Member
**
Offline


Posts: 30
Joined: Sep 11th, 2023
Re: VMBuild does not find board when run as Jenkins job
Reply #11 - Oct 25th, 2024 at 9:07pm
Print Post  
Just a few more tries before I zip and send project.

Code
Select All
"C:\Program Files\VMicro\VMBuilder\VMBuild.exe" -builder.project_path="PumpControllerFirmware.vcxproj"
-builder.build=true -builder.close=true -builder.closeonerror=true
The operation failed with exception: Visual Micro: Program not found opening settings
.ino
System.Exception: Visual Micro: Program not found opening settings
.ino
   at Visual.Micro.ProgramConfiguration.ProgramSettingsReader..ctor(String programFullName, String _SettingsExt)
   at Visual.Micro.ProgramConfiguration.ProgramSettings..ctor(String programFullName, String _SettingsExt)
   at VMBuild.VMBuilder.BuilderWrapperCreate(VMBuilderProject oProject)
   at VMBuild.VMBuilder.RunBuilder()
   at VMBuild.VMBuilder..ctor(VMBuildArgs _vmArgs)
   at VMBuild.Program.Main(String[] args) 



arduino-cli.yaml:
Code
Select All
board_manager:
    additional_urls: []
 

  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12166
Location: United Kingdom
Joined: Apr 10th, 2010
Re: VMBuild does not find board when run as Jenkins job
Reply #12 - Oct 25th, 2024 at 9:26pm
Print Post  
Thanks, the project might be missing the _vm sub folder.

Can you build the project using visual micro (vs ide) on the same machine?
  
Back to top
IP Logged
 
revvers
Junior Member
**
Offline


Posts: 30
Joined: Sep 11th, 2023
Re: VMBuild does not find board when run as Jenkins job
Reply #13 - Oct 25th, 2024 at 10:37pm
Print Post  
Tim@Visual Micro wrote on Oct 25th, 2024 at 9:26pm:
Thanks, the project might be missing the _vm sub folder.

Can you build the project using visual micro (vs ide) on the same machine?


No, I cannot build the project on the same machine via VS IDE + Vmicro. See: https://www.visualmicro.com/forums/YaBB.pl?num=1729891636;start=0;action=threadp...
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12166
Location: United Kingdom
Joined: Apr 10th, 2010
Re: VMBuild does not find board when run as Jenkins job
Reply #14 - Oct 25th, 2024 at 10:48pm
Print Post  
EDIT

Your build output shows your project is set to use the Arduino 2 entry in the list not the "No IDE" entry in our picture.

The arduino-cli.yaml you emailed has incorrect folder based on your configuration
directories:
  data: C:\Users\richl\AppData\Local\Arduino15

If you have created your own arduino15 folder you should ensure any files in "C:\Users\richl\AppData\Local\Arduino15" are copied or moved to the "Arduino15" folder you want to use.

Please show an image of your visual micro IDE Locations > Arduino 2 settings. They can cause configusion. We will stick with the settings via arduino-cli.yaml because its easier. 
« Last Edit: Oct 25th, 2024 at 11:06pm by Tim@Visual Micro »  
Back to top
IP Logged
 
revvers
Junior Member
**
Offline


Posts: 30
Joined: Sep 11th, 2023
Re: VMBuild does not find board when run as Jenkins job
Reply #15 - Oct 25th, 2024 at 11:05pm
Print Post  
Tim@Visual Micro wrote on Oct 25th, 2024 at 10:48pm:
When you are editing project code which IDE name shows in the tool bar and on the vMicro menu? "Arduino 2" or "Visual Micro (No IDE)"?

"Visual Micro (No IDE)"
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12166
Location: United Kingdom
Joined: Apr 10th, 2010
Re: VMBuild does not find board when run as Jenkins job
Reply #16 - Oct 25th, 2024 at 11:08pm
Print Post  
If you have arduino-cli.yaml then select arduino 2 for the project. It's easier to control things via the yaml and will ensure you have a valid arduino15 folder too.
  
Back to top
IP Logged
 
revvers
Junior Member
**
Offline


Posts: 30
Joined: Sep 11th, 2023
Re: VMBuild does not find board when run as Jenkins job
Reply #17 - Oct 25th, 2024 at 11:10pm
Print Post  
Tim@Visual Micro wrote on Oct 25th, 2024 at 10:48pm:
Clear the optional sketch book folder property.

No change.
  
Back to top
 
IP Logged
 
revvers
Junior Member
**
Offline


Posts: 30
Joined: Sep 11th, 2023
Re: VMBuild does not find board when run as Jenkins job
Reply #18 - Oct 25th, 2024 at 11:33pm
Print Post  
Thank you again for all the help.

I'm confused.

On all the other machines where this works, I have always selected "Visual Micro (No IDE)", and I don't install Arduino IDE.

On the Jenkins server in question, that is also the configuration. I don't want to install Arduino IDE unless it is necessary.

In this case, what is arduino-cli.yaml affecting? Is only VMbuilder referencing this file?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12166
Location: United Kingdom
Joined: Apr 10th, 2010
Re: VMBuild does not find board when run as Jenkins job
Reply #19 - Oct 25th, 2024 at 11:41pm
Print Post  
You can delete the arduino-cli if you are not using arduino 2. 

What is in your c:\arduino15 folder?

  
Back to top
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send TopicPrint