Hello, I am working on removing most of windowing code from the VM, and in trying to unify the platform specific code of the VM. In the MinimalistHeadless branch of https://github.com/ronsaldo/opensmalltalk-vm I made the following changes:I am also planning on making a standard interface for embedding the VM in an application, at least as a static library. With this new building system, this seems to be easy to do. BTW. When I tried the minimalistic Pharo image, in a completely headless VM, I got the following error: [ "Ugh .... now this is a biggie - a system that does not support any of the display depths at all." Smalltalk logError: 'Fatal error: This system has no support for any display depth at all.' inContext: thisContext. Smalltalk quitPrimitive "There is no way to continue from here" ] in DisplayScreen>>findAnyDisplayDepth DisplayScreen>>findAnyDisplayDepthIfNone: DisplayScreen>>findAnyDisplayDepth DisplayScreen>>setExtent:depth: DisplayScreen class>>startUp As a workaround, I am doing the following for ioHasDisplayDepth with the null driver: sqInt ioHasDisplayDepth(sqInt depth) { return true; } In DisplayScreen class >> startUp we have the following: startUp "DisplayScreen startUp" Display setExtent: self actualScreenSize depth: Display nativeDepth. Display beDisplay Does it make sense, to always trying to create a display in startup time? Best regards, Ronie |
Hi Ronie,
First, this is super cool! I want this to happen since a lot of time :) Second, observation below
you cannot unilaterally do this. I hate autoconf too, but in VM list we have a general agreement on how to manage the VM build process, and unless you manage to convince the rest of people working there (and specially Eliot, who works there more than the rest), you have literally zero chance this will be adopted (and then, your work will be a general lose of time…). In any case, you have my vote :)
this is sooo super :)
even more super :) where can I see the code? Esteban
|
forget it, I was so overblown with your ANN that I just skip the link to your branch :P Esteban
|
In reply to this post by Ronie Salgado
Hi 2016-11-24 8:12 GMT+01:00 Ronie Salgado <[hidden email]>:
This is super cool. With Pavel we just tried open oswindow based world from headless image and it work almost perfect. No problems with keyboard and scrolling anymore. And it already provides very good approach for deploying desktop app.
Could you explain more what traditional display backend means? Because I am probably out of domain but want to know more.
I guess it is temp solution? Because no DisplayScreen should exist in headless mode. |
In reply to this post by EstebanLM
As Estaban said: wow, a new world opens. Amazing. Phil On Thu, Nov 24, 2016 at 8:24 AM, Esteban Lorenzano <[hidden email]> wrote:
|
In reply to this post by Denis Kudriashov
This was something that I did for quickly testing and trying to remove the windowing code. I also did this, because the building system is not working all of the time in my linux machine. The scripts for loading the VMMaker image are most of the time not working at all in Linux. I got frustrated by not being able on keep working on Lowcode for supporting the 64 bits version, because of these problems. Anyway, I do not care if this part gets integrated or not, as long as I can keep working on my stuff, and I don't have a bunch of manully written scripts in build.*/* . As long as there is a single script that can be configured for each target or flavour of the VM I am okay with it. Now I will document these scripts: For setting the flavour of the VM, there are the following options - SPUR_OBJECT_MODEL (On by default) - SISTA_OPTIMIZER (Off by default) - PHARO_BRANDING (On by default) - COG_JIT(On by default. If off, it will build a stack interpreter only VM) There are platform specific check for choosing whether to build a 64 bits VM or not. When building in a x86_64 systems, there is the BUILD_I386_VERSION option (Off by default) which will set the appropiate flags for building a 32 bits VM in a 64 bits system (-m32) These options are used for making a string with the vm sources direction(src ,stacksrc, spursrc, etc) and for selecting the sources of the vm. In this experimental branch I am moving some of the sources at platform/<platform_name/vm into the minheadless/source, for including the barest minimum code for compiling the VM. By the end of this, I should probably move back the platform specific sources into their original locations. The plugins to build with the VM are defined in Plugins.cmake (https://github.com/ronsaldo/opensmalltalk-vm/blob/MinimalisticHeadless/Plugins.cmake) Most of the time, adding a plugin is just a matter calling a macro: # Basic internal plugins add_vm_plugin_sources(SqueakFFIPrims EXTERNAL ${SqueakFFIPrims_Sources}) Later I will add another macro for linking a library with a plugin, which will perform the correct action depending whether the Plugin is internal or external. The macros for building a plugin add an option for specifying whether to build or not a plugin (e.g: BUILD_PLUGIN_FilePlugin, BUILD_PLUGIN_FT2Plugin). For building the a default VM using cmake, the only commands are required in the top level source directory:
For choosing interactively which options to enable or not, it is possible to use cmake-gui instead of cmake in the above sequence of commands. The built VM will be placed at build_dir/dist Currently, I am not using the cmake configure capabilties for generating config.h and generating the HAVE_*_H defines. Later I will implement this, but taking special care in supporting the cross compilation scenario, where it is not possible to execute compiled program for probing the system for things such as sizeof(void*).
If the SUPPORT_TRADITIONAL_DISPLAY cmake option is enabled, and cmake finds SDL2 (it will look for the SDL2 libraries using the names SDL2-2.0 SDL2), then a non-headless VM will be built using sqPlatformSpecific-SDL2Window.c ( https://github.com/ronsaldo/opensmalltalk-vm/blob/MinimalisticHeadless/minheadless/source/sqPlatformSpecific-SDL2Window.c ) instead of sqPlatformSpecific-NullWindow.c ( https://github.com/ronsaldo/opensmalltalk-vm/blob/MinimalisticHeadless/minheadless/source/sqPlatformSpecific-NullWindow.c ). This non-headless VM using SDL2 instead of the platform specific API, which should help in avoiding conflicts between the OSWindow event loop and the VM event loop. This works with a normal Pharo 6 image. This SDL2 based backend creates a window for the VM, only when asked by the image and process events sent to the VM window in the traditional way of translating the events into squeak events; placing the translated event in a queue, and then signaling a semaphore. SDL2 events that are not related to the VM window are placed untranslated in a separate queue, and there are used signal a separate semaphore for allowing OSWindow to process the event. I have already implemented the required primitives and updated OSWindow for using them, when they exist. I still have to update the OSWindow configuration. This approach allows preventing conflicts between the events for the VM window and OSWindow. Ronie, do you already have code to restore windows after image save? Any issue opened? Not yet for the extra morphic Worlds. How much VM size it reduced? I have not checked yet, but this is about reducing some complexity.
That is not worthless at all. That is still an excellent mechanism for fast IPC. Have you got no mercy ? No :) . Ask Thibault about the OpenGL bindings for the UFFI. That time I was cleaning OSWindow dependencies.
It is still needed to define a proper interface for embedding the VM. This interface should be a single .h file, with the highest level of abstraction possible. There are some other issues such as potential name clashes, and the fact that the VM symbols are public by default. At the bare minimum, it has to provide functions for initializing the VM, passing command line arguments, loading an image, running the image, and shutting down. So far I managed to reduce main source code a lot in sqMain.c (https://github.com/ronsaldo/opensmalltalk-vm/blob/MinimalisticHeadless/minheadless/source/sqMain.c ) . I am probably moving most of that into a separate source code file that will be always linked with VM core library, and keeping the source file with main function only couple of lines long (Init vm, load image, interpret and shutdown ) BTW, now I am working for a chilean video game company using Unreal. I do not like Unreal because it takes a very long time to compile, even with a 44 cores machine (88 threads) that we have in the company for rendering and compiling. I am wondering how that integration is going to end. The embedding interface is not in my priority list. My priority is getting OSWindow working well in Windows (required by the Bloc and Roassal people). My second priority is getting Lowcode working on Linux, Mac and Windows in both, 32-bits and 64 bits mode. Best regards, Ronie 2016-11-24 5:59 GMT-03:00 Denis Kudriashov <[hidden email]>:
|
Thanks Ronie!
You are doing a great job! :) Cheers, Alex On 24 November 2016 at 15:06, Ronie Salgado <[hidden email]> wrote:
|
In reply to this post by EstebanLM
+10000000000000000000000000000000 amen to that. especially this: >I am also planning on making a standard interface for embedding the VM in an application, at least as a static library. With this new building system, this seems to be easy to do. This is a holy grail!!! Go, Ronie, Go!!! On 24 November 2016 at 09:24, Esteban Lorenzano <[hidden email]> wrote:
Best regards,
Igor Stasenko. |
In reply to this post by Ronie Salgado
Need help with the VM cleaning? Le 24 nov. 2016 08:13, "Ronie Salgado" <[hidden email]> a écrit :
|
Not for now. Now I will try to make this working on Windows. Once I manage to isolate the most of the stubbed dependencies on Window(heartbeat, time, asynchronous I/O), we will have a more unified core VM in a single static library. When we have this unified VM, I will need help for testing, and defining a definitive build system where the community also agrees. For now I will just keep working on my private branch. 2016-11-24 17:29 GMT-03:00 [hidden email] <[hidden email]>:
|
I am fighting Window VM compilation issues (e.g. Cairo with GCC5.x under Mingw). If you have a GCC5 instead of the old 4.6, I am interested in your config. It is great that you are giving a solid kick in this. Do not get burned out. Peace. Phil On Thu, Nov 24, 2016 at 11:48 PM, Ronie Salgado <[hidden email]> wrote:
|
In reply to this post by Ronie Salgado
This is super coooooool Embedding the Vm as a static lib is a kind of dream becoming true. Stef
-- Using Opera's mail client: http://www.opera.com/mail/ |
+100.
Great job! Doru > On Nov 26, 2016, at 9:44 AM, stepharo <[hidden email]> wrote: > > This is super coooooool > Embedding the Vm as a static lib is a kind of dream becoming true. > > Stef > > > Hello, > > I am working on removing most of windowing code from the VM, and in trying to unify the platform specific code of the VM. In the MinimalistHeadless branch of https://github.com/ronsaldo/opensmalltalk-vm I made the following changes: > > - Unified standard CMake building scripts for Unixes. I hate autoconf. I want to use them in Windows too. > - Refactoring the Unix entry points. I am trying to remove a lot of code for simplfying stuff. > - Null window driver for true headless. > - Optional SDL2 based traditional display backend for compatibility reasons, and because the extra Morphic worlds using OSWindow are a bit unstable. > > So far I managed to run a standard Pharo 6 image using this custom VM in Linux. Windows and Mac are coming next. Hopefully this is going to fix the problems with duplicated events when using OSWindow in Windows. > > I am also planning on making a standard interface for embedding the VM in an application, at least as a static library. With this new building system, this seems to be easy to do. > > BTW. When I tried the minimalistic Pharo image, in a completely headless VM, I got the following error: > > [ "Ugh .... now this is a biggie - a system that does not support > any of the display depths at all." > Smalltalk > logError: > 'Fatal error: This system has no support for any display depth at all.' > inContext: thisContext. > Smalltalk quitPrimitive "There is no way to continue from here" ] in DisplayScreen>>findAnyDisplayDepth > DisplayScreen>>findAnyDisplayDepthIfNone: > DisplayScreen>>findAnyDisplayDepth > DisplayScreen>>setExtent:depth: > DisplayScreen class>>startUp > > As a workaround, I am doing the following for ioHasDisplayDepth with the null driver: > > sqInt ioHasDisplayDepth(sqInt depth) > { > return true; > } > > In DisplayScreen class >> startUp we have the following: > startUp "DisplayScreen startUp" > Display setExtent: self actualScreenSize depth: Display nativeDepth. > Display beDisplay > > Does it make sense, to always trying to create a display in startup time? > > Best regards, > Ronie > > > > -- > Using Opera's mail client: http://www.opera.com/mail/ -- www.tudorgirba.com www.feenk.com "Be rather willing to give than demanding to get." |
In reply to this post by Ronie Salgado
Hi Roni,
... [goodness deleted]
|
Hi, I am fighting Window VM compilation issues (e.g. Cairo with GCC5.x under Mingw). Now I am building in Windows using both, MinGW version 4.9.3, and Visual Studio 2015 Community Edition. I got working pharo,exe -headless Pharo-minimal.image eval "1+1" (the -headless parameter is for the image to quit after finishing). When running a normal Pharo.image, I am getting a FFI related crash (with Visual Studio and MinGW), when the image tries to read the APPDATA environment variable. Right now I am using the same main function for both, the Unix and Win32 VM. This means, that we are close of having the embedded version. In windows I am build two variants of the VM, pharo.exe (or squeak.exe) and pharow.exe (or squeakw.exe). The executable without the w is a console program, so it can use stdin, stdout and stderr. The executable with the w is a windows program that does not create a console window on startup, but it cannot use stdout, stderr, or stdin. This is the standard workaround for an annoying limitation of Windows itself (Python does the same in windows, with the same nomenclature). Visual Studio is unstable than MinGW, but it has an excellent debugger. With Visual Studio, I am getting some false positives for an assertion because they get miscompiled. For some reason, the assert(GIV(remapBufferCount) == 0) gets compiled into the same as assert(GIV(remapBufferCount)). Apart from this assertion, these two versions of the VM are crashing in the same place.
I cannot just use makefile, because I am also compiling in Windows using Visual Studio 2015 Community Edition, by generating the visual studio projects with CMake. I looked for the older discussions on the mailing lists, I could not find, a long discussion on the mailing list, except for several short ones. I have also seen some projects(LLVM, Boost) that have more than one build system, an official based on autoconf(or something else), and an alternative based on CMake. As for the config.h, I can also generate it using CMake, and I will start doing it now because I think that it is related to the FFI crashing issues that I am experimenting on Windows. Currently I am already using CMake for generating the git version string. As long as git is in the path and cmake founds it, the header with the version string is generated correctly, even when using the Visual Studio projects. Anyway, I am not using the old CMakeVMMaker that Igor did(and I just learned about Ian CMake work by finding in the mailing list). I just adapted the plain CMake scripts that I normally use for building my own projects to build the VM. Are you on board? Would you like to discuss this on skype or somewhere? Sure we can discuss it, I am on chile so we are not far apart in time zones. As long as building the VM can be done automatically in Unixes by running a short number of commands, that work most of the time, I am OK with it. As for Windows, it has to be possible to use Visual Studio in addition to MinGW or Cygwin. Visual Studio is required to be able to build for the Universal Windows Platform, and getting the VM working in a retail XBox One ( https://msdn.microsoft.com/en-us/windows/uwp/xbox-apps/index ). Best regards, Ronie 2016-11-26 14:09 GMT-03:00 Eliot Miranda <[hidden email]>:
|
On Sat, 26 Nov 2016 23:16:50 +0100, Ronie Salgado <[hidden email]> wrote:
I love that :)
Yes this is on the roadmap of esteban but he got killed by vm merge + UFFI
-- Using Opera's mail client: http://www.opera.com/mail/ |
In reply to this post by Ronie Salgado
Ronie, Is all of this in a branch somewhere so that I can have a look? For cairo, I think that I can build it with another compiler than MinGW, it doesn't really matter as it just makes a dll (or well, I can just skip that and reuse an already built one). -ltro is the flag that makes the whole thing trips up in GCC5 and requires additional flags, but adding them just kicked the can down the road a bit further as they were still unresolved symbols. Need to see why cairo build gives that but seems a cairo issue that others are facing as well. May end up building cairo with the old compiler but this defeats the purpose. For VS2015, I've got it too and yes, the debugging facilities are much better, not to mention that the compilation times are much nicer. GCC is just dog slow on Windows compared to Linux. I read that it was because of sub-bar fork support in Windows. Nice to give me an excuse to get an XBox One for XMas in order to try Pharo on it. Best, Phil On Sat, Nov 26, 2016 at 11:16 PM, Ronie Salgado <[hidden email]> wrote:
|
Hi Phil, It is on the MinimalisticHeadless branch of ( https://github.com/ronsaldo/opensmalltalk-vm/tree/MinimalisticHeadless ).GIV(remapBufferCount) == 0 55758 These are false positives due to the macro expansion bug.
For me it is also an excuse for XMas ;) . Best regards, Ronie 2016-11-27 18:01 GMT-03:00 [hidden email] <[hidden email]>:
|
In reply to this post by philippeback
Now I found the FFI problem with MinGW , I was missing some old compilation flags on my CMake scripts. I still have to fix this same bug with MSVC, but at least normal Pharo image can eval "1+1" without crashing, and stdout is working properly now in Windows. During the rest of the week I will make this VM variant working completely on Linux, Windows and OS X, with SDL2 and hopefully we will get OSWindow working alot better in Windows and Mac. (In Linux it was already working pretty well, probably because each X connection has its own event queue). Interesting to note Microsoft is moving to Clang [1] to replace their In Windows the standard compiler is MSVC, despite it has a poorer quality than gcc/clang. The movement to the clang front-end is something where it is not possible to rely until it becomes stable. It is quite clear that the VM is not meant to be used with MSVC, because it is not being built and tested with it all of the time. However, in some platforms, the only alternative is MSVC. Best regards, Ronie 2016-11-28 0:46 GMT-03:00 Ben Coman <[hidden email]>:
|
Free forum by Nabble | Edit this page |