morse-simulator / morse

The Modular OpenRobots Simulation Engine
http://morse-simulator.github.io/
Other
357 stars 156 forks source link

CI: Added Windows builds via Appveyor #811

Closed stephendade closed 5 years ago

stephendade commented 5 years ago

Finally figured out Windows builds via Appveyor! Biggest issue was figuring out how to get the correct version of Python into Appveyor (Blender uses 3.5.3, Appveyor uses 3.5.4 ... it's enough to make Morse not work). I fixed this by using conda instead.

This patch: -Builds Morse on Appveyor -Runs a "morse check" -Creates a Windows installer in both x86 and x86-64 architectures (needs to match Blender). The installer will set the relevant evironment vars too, so the user can get straight into running Morse.

The Morse repo admins will need to enable builds on Appveyor.

Also, we'll need to figure out where to store the built Windows installers.

For reference, the completed builds (based on my repo) are here: https://ci.appveyor.com/project/stephendade/morse/builds/21514582

nicolaje commented 5 years ago

That's really great Stephen !

A way to "store" the build could be to push the binaries as Github releases as explained here : https://www.appveyor.com/docs/deployment/github/ ?

severin-lemaignan commented 5 years ago

That's great! Well done!

I see that currently, you are not running any test, though, except morse check. You have commented out some test that do not run due to configuration issues, but if some do run, it would be useful to run them.

One of the reason why the test may fail, though, is because Blender requires an OpenGL context. On travis, we had to create a fake, headless, X server to run the test:

xvfb-run --auto-servernum --server-args="-screen 0 160x120x16" python3.4 ../testing/$1

I do not know the equivalent for Windows/appveyor.

Before merging, can you:

severin-lemaignan commented 5 years ago

Also, I see you are using both InnoSetup and pyinstaller. Do they not achieve the same goal? In any case, I'd rename morse.spec into morse-windows.spec as even though pyinstaller is cross-platform, this spec file is clearly Windows-specific.

stephendade commented 5 years ago

A way to "store" the build could be to push the binaries as Github releases as explained here : https://www.appveyor.com/docs/deployment/github/ ?

Yep, that would work nicely. Will need a repo admin to authorise/setup.

I see that currently, you are not running any test, though, except morse check. You have commented out some test that do not run due to configuration issues, but if some do run, it would be useful to run them. One of the reason why the test may fail, though, is because Blender requires an OpenGL context. On travis, we had to create a fake, headless, X server to run the test:

The exact commands run fine on my PC, so as you suggest an issue with Blender not wanting to run headless. I'll see if I can figure out a fix for Appveyor.

Before merging, can you:

Yep, will do those tasks.

Also, I see you are using both InnoSetup and pyinstaller. Do they not achieve the same goal?

Different stages in the process. pyinstaller compiles Morse into a windows executable, so the user doesn't need to worry about Python environments or other dependencies. Inno then wraps a setup script around all that - importantly sets the MORSE_ROOT and MORSE_BLENDER environment vars. This makes it very "plug and play" for the user.

I'd rename morse.spec into morse-windows.spec

Sure. Will do

stephendade commented 5 years ago

Ok, that's the documentation side done. Will try to get Blender headless running tomorrow.

stephendade commented 5 years ago

Ok, I've figured out running the tests: -Blender 2.79 was crashing in Appveyor due to a lack of hardware graphics -I tried with Blender 2.78 and a software OpenGL renderer and it all works fine

Thus I'll keep the Appveyor build running with Blender 2.78; but it will require any users to ensure they're running Blender 2.78 too. I've updated to documentation to reflect this.

stephendade commented 5 years ago

@nicolaje and @severin-lemaignan - are you happy with my changes?

nicolaje commented 5 years ago

That's perfect for me. Where will the Windows installer be stored ?

@pierriko can this be integrated & the online doc updated to include this change ?

severin-lemaignan commented 5 years ago

Merged, thanks!