Hello there, For a long time, Pharaoers and Squakers have been asking for headless support in the Cocoa VMs just as we have with Carbon VMs. Carbon is becoming a legacy framework so people needed this.
I wanted to thanks Square [i] International for sponsoring me to implement such a support. Not only have they sponsored the development but they have also agreed to release it under MIT license for the community. This headless support will be included in the official Pharo VM and will be, therefore, accessible to everybody.
The project is not yet finished but I do have a demo/prototype that I wanted to share with you so that you can test it and give me feedback. This VM should only work starting at OSX 10.6. How to use it? Basically it works this way: to have headless, just edit the Info.plist and set the flag LSBackgroundOnly to 1 (add the key if it is not present):
<key>LSBackgroundOnly</key> <true/> When doing this, you don't even need the -headless anymore since, setting LSBackgroundOnly to 1, will cause the same effect (being the flag almost mandatory). If you don't want headless, put it to false or don't even put the key. If you don't set LSBackgroundOnly to 1 but send -headless, the VM will still be headless but you will see a little flash. If this flash bothers you, then set the flag. I am trying to get a way to avoid the "flash" while also avoiding to set LSBackgroundOnly to 1, but I still couldn't find it. Anyway, I think we can live with the current situation.
How to test it? You should run the image with something like RFB or Seaside or whatever you can and then confirm if it is working even if you are headless. As a matter of testing, I saved an image with seaside running in the port 5555. You can get both, this Seaside image and the VM with headless from: https://www.dropbox.com/sh/r7qk49bxywk2xce/6N7-fdyx6V
So if you run the VM headless with that image and go to localhost:5555, you should see that Seaside is running.
I would appreciate if you can test it. And please let me know in which version of OSX you tried. Of course, the more of you who can test it, the better. Notice that this VM was compiled with LLVM GCC 4.2 and it may have some problems in older OSX versions (but I think it shouldn't). I still couldn't compile a VM with GNU GCC 4.2 as I get a crash :(
Expected results? In headless mode, anything should be displayed (no window, no menu, no item in the dock and nothing appear when switching apps). When running headfull, everything should be normal.
Where is the code? The code I have modified to the VM is committed to my own fork of the VM: https://gitorious.org/~marianopeck/cogvm/marianopecks-blessed
Once the code is ready, I will do a pull request so that it can be integrated. Thanks everyone for the testing and feedback. Once again, thanks Square [i] International for sponsoring this great feature. Also thanks Esteban Lorenzano and Mark Smith for their incredible help.
This was just the first prototype. I will keep you informed about possible progress.
Best regards, Mariano http://marianopeck.wordpress.com |
I would like thank officially Square [i] for this gift to the community.
Thank again. Further work in this direction should be supported by the association and the consortium. Stef On Jan 18, 2013, at 8:14 PM, Mariano Martinez Peck wrote: > Hello there, > > For a long time, Pharaoers and Squakers have been asking for headless support in the Cocoa VMs just as we have with Carbon VMs. Carbon is becoming a legacy framework so people needed this. > > I wanted to thanks Square [i] International for sponsoring me to implement such a support. Not only have they sponsored the development but they have also agreed to release it under MIT license for the community. This headless support will be included in the official Pharo VM and will be, therefore, accessible to everybody. > > The project is not yet finished but I do have a demo/prototype that I wanted to share with you so that you can test it and give me feedback. This VM should only work starting at OSX 10.6. > > How to use it? Basically it works this way: to have headless, just edit the Info.plist and set the flag LSBackgroundOnly to 1 (add the key if it is not present): > > <key>LSBackgroundOnly</key> > <true/> > > When doing this, you don't even need the -headless anymore since, setting LSBackgroundOnly to 1, will cause the same effect (being the flag almost mandatory). If you don't want headless, put it to false or don't even put the key. If you don't set LSBackgroundOnly to 1 but send -headless, the VM will still be headless but you will see a little flash. If this flash bothers you, then set the flag. I am trying to get a way to avoid the "flash" while also avoiding to set LSBackgroundOnly to 1, but I still couldn't find it. Anyway, I think we can live with the current situation. > > How to test it? You should run the image with something like RFB or Seaside or whatever you can and then confirm if it is working even if you are headless. As a matter of testing, I saved an image with seaside running in the port 5555. You can get both, this Seaside image and the VM with headless from: https://www.dropbox.com/sh/r7qk49bxywk2xce/6N7-fdyx6V > So if you run the VM headless with that image and go to localhost:5555, you should see that Seaside is running. > > I would appreciate if you can test it. And please let me know in which version of OSX you tried. Of course, the more of you who can test it, the better. Notice that this VM was compiled with LLVM GCC 4.2 and it may have some problems in older OSX versions (but I think it shouldn't). I still couldn't compile a VM with GNU GCC 4.2 as I get a crash :( > > Expected results? In headless mode, anything should be displayed (no window, no menu, no item in the dock and nothing appear when switching apps). When running headfull, everything should be normal. > > Where is the code? The code I have modified to the VM is committed to my own fork of the VM: https://gitorious.org/~marianopeck/cogvm/marianopecks-blessed > Once the code is ready, I will do a pull request so that it can be integrated. > > Thanks everyone for the testing and feedback. Once again, thanks Square [i] International for sponsoring this great feature. Also thanks Esteban Lorenzano and Mark Smith for their incredible help. > > This was just the first prototype. I will keep you informed about possible progress. > > Best regards, > > -- > Mariano > http://marianopeck.wordpress.com |
In reply to this post by Mariano Martinez Peck
This doesn't work
open CogVM-release-noflash-noArgs.app Pier3.image & Jan 19 11:20:51 Stephan-Eggermonts-iMac [0x0-0x2f92f9].org.seaside-project[36832]: This interpreter (vers. 6502) cannot read image file (vers. 6505). Jan 19 11:20:51 Stephan-Eggermonts-iMac [0x0-0x2f92f9].org.seaside-project[36832]: Press CR to quit... Jan 19 11:20:52 Stephan-Eggermonts-iMac ReportCrash[36836]: Failed to create CSSymbolicatorRef for launchd Jan 19 11:20:52 Stephan-Eggermonts-iMac com.apple.launchd.peruser.501[207] ([0x0-0x2fa2fa].org.squeakfoundation.Squeak[36835]): Job appears to have crashed: Segmentation fault Jan 19 11:20:52 Stephan-Eggermonts-iMac ReportCrash[36836]: Saved crash report for launchd[36835] version ??? (???) to /Users/stephan/Library/Logs/DiagnosticReports/launchd_2013-01-19-112052_Stephan-Eggermonts-iMac.crash |
Can you try –
$ open -a CogVM-release-noflash-noArgs.app Pier3.image or $ ./CogVM-release-noflash-noArgs.app/Contents/MacOS/CogVM Pier3.image On 19 Jan 2013, at 10:24, Stephan Eggermont <[hidden email]> wrote: > This doesn't work > > > open CogVM-release-noflash-noArgs.app Pier3.image & > > > Jan 19 11:20:51 Stephan-Eggermonts-iMac [0x0-0x2f92f9].org.seaside-project[36832]: This interpreter (vers. 6502) cannot read image file (vers. 6505). > Jan 19 11:20:51 Stephan-Eggermonts-iMac [0x0-0x2f92f9].org.seaside-project[36832]: Press CR to quit... > Jan 19 11:20:52 Stephan-Eggermonts-iMac ReportCrash[36836]: Failed to create CSSymbolicatorRef for launchd > Jan 19 11:20:52 Stephan-Eggermonts-iMac com.apple.launchd.peruser.501[207] ([0x0-0x2fa2fa].org.squeakfoundation.Squeak[36835]): Job appears to have crashed: Segmentation fault > Jan 19 11:20:52 Stephan-Eggermonts-iMac ReportCrash[36836]: Saved crash report for launchd[36835] version ??? (???) to /Users/stephan/Library/Logs/DiagnosticReports/launchd_2013-01-19-112052_Stephan-Eggermonts-iMac.crash |
In reply to this post by Stephan Eggermont-3
On Sat, Jan 19, 2013 at 7:24 AM, Stephan Eggermont <[hidden email]> wrote: This doesn't work Which OSX version are you using?
Mariano http://marianopeck.wordpress.com |
Hi Mariano,
on MacOS 10.6.8 doing ./CogVM-release-noflash-noArgs.app/Contents/MacOS/CogVM Pier3.image does not work, I get Illegal instruction...
the same with ./CogVM-release-noflash-noArgs.app/Contents/MacOS/CogVM --headless Pier3.image if i try using open CogVM-release-noflash-noArgs.app Pier3.image, it works but It's not headless, however when looking in the info.plist the key you have mentioned is there
<key>LSBackgroundOnly</key>
<true/>
On Sat, Jan 19, 2013 at 2:26 PM, Mariano Martinez Peck <[hidden email]> wrote:
Dr. Ciprian TEODOROV Ingénieur Développement CAO tél : 06 08 54 73 48 mail : [hidden email] www.teodorov.ro |
In reply to this post by Stéphane Ducasse
We will blog it and tweet it :)
Thanks again. Stef On Jan 19, 2013, at 11:21 AM, Stéphane Ducasse wrote: > I would like thank officially Square [i] for this gift to the community. > Thank again. Further work in this direction should be supported by the association and the consortium. > > Stef > > > On Jan 18, 2013, at 8:14 PM, Mariano Martinez Peck wrote: > >> Hello there, >> >> For a long time, Pharaoers and Squakers have been asking for headless support in the Cocoa VMs just as we have with Carbon VMs. Carbon is becoming a legacy framework so people needed this. >> >> I wanted to thanks Square [i] International for sponsoring me to implement such a support. Not only have they sponsored the development but they have also agreed to release it under MIT license for the community. This headless support will be included in the official Pharo VM and will be, therefore, accessible to everybody. >> >> The project is not yet finished but I do have a demo/prototype that I wanted to share with you so that you can test it and give me feedback. This VM should only work starting at OSX 10.6. >> >> How to use it? Basically it works this way: to have headless, just edit the Info.plist and set the flag LSBackgroundOnly to 1 (add the key if it is not present): >> >> <key>LSBackgroundOnly</key> >> <true/> >> >> When doing this, you don't even need the -headless anymore since, setting LSBackgroundOnly to 1, will cause the same effect (being the flag almost mandatory). If you don't want headless, put it to false or don't even put the key. If you don't set LSBackgroundOnly to 1 but send -headless, the VM will still be headless but you will see a little flash. If this flash bothers you, then set the flag. I am trying to get a way to avoid the "flash" while also avoiding to set LSBackgroundOnly to 1, but I still couldn't find it. Anyway, I think we can live with the current situation. >> >> How to test it? You should run the image with something like RFB or Seaside or whatever you can and then confirm if it is working even if you are headless. As a matter of testing, I saved an image with seaside running in the port 5555. You can get both, this Seaside image and the VM with headless from: https://www.dropbox.com/sh/r7qk49bxywk2xce/6N7-fdyx6V >> So if you run the VM headless with that image and go to localhost:5555, you should see that Seaside is running. >> >> I would appreciate if you can test it. And please let me know in which version of OSX you tried. Of course, the more of you who can test it, the better. Notice that this VM was compiled with LLVM GCC 4.2 and it may have some problems in older OSX versions (but I think it shouldn't). I still couldn't compile a VM with GNU GCC 4.2 as I get a crash :( >> >> Expected results? In headless mode, anything should be displayed (no window, no menu, no item in the dock and nothing appear when switching apps). When running headfull, everything should be normal. >> >> Where is the code? The code I have modified to the VM is committed to my own fork of the VM: https://gitorious.org/~marianopeck/cogvm/marianopecks-blessed >> Once the code is ready, I will do a pull request so that it can be integrated. >> >> Thanks everyone for the testing and feedback. Once again, thanks Square [i] International for sponsoring this great feature. Also thanks Esteban Lorenzano and Mark Smith for their incredible help. >> >> This was just the first prototype. I will keep you informed about possible progress. >> >> Best regards, >> >> -- >> Mariano >> http://marianopeck.wordpress.com > > |
In reply to this post by Ciprian Teodorov-3
On Sat, Jan 19, 2013 at 10:40 AM, Ciprian Teodorov <[hidden email]> wrote: Hi Mariano, Well, this one is weird ;) I think the problem is (as Mark pointed out) the "open". When you do: open CogVM-release-noflash-noArgs.app Pier3.image I will (I think) do two things: - open the CogVM-release-noflash-noArgs.app (which will popup the window to choose an image)
- open the Pier3.image with the default app associated (that would be the same as double clicking the .image from the finder) So, I think that what you need is to add the "-a": open -a CogVM-release-noflash-noArgs.app Pier3.image
In this case, you should at least get the same behavior as:
./CogVM-release-noflash-noArgs.app/Contents/MacOS/CogVM Pier3.image
that is, a ilegal instruction. Is it like this?
Now...why the ilegal instruction?? I don't know. I will check. I could be maybe what I said that I compiled with LLVM GCC.
We should compile this VM with GNU GCC...but so far I couldn't in 10.8.2 :( Thanks for the testing to everybody!!!
Mariano http://marianopeck.wordpress.com |
Administrator
|
In reply to this post by Mariano Martinez Peck
Yes, thank you, thank you!! I've been using Pharo for Jenkins build scripts, and it was really disruptive to see the image pop up every time a job started. As to the flag limitation, I think for now I'll have two copies of the VM - a headful one, which will be the default on my Mac, and one with the headless flag set, that gets explicitly launched by Jenkins... not perfect, but a HUGE step!! Cheers, Sean
Cheers,
Sean |
On Jan 19, 2013, at 5:08 PM, Sean P. DeNigris wrote: > Mariano Martinez Peck wrote >> thanks Square [i] International <http://www.square-i.net/> >> ... headless support will be included in the official Pharo >> VM and will be, therefore, accessible to everybody. > > Yes, thank you, thank you!! I've been using Pharo for Jenkins build scripts, > and it was really disruptive to see the image pop up every time a job > started. > > As to the flag limitation, I think for now I'll have two copies of the VM - > a headful one, which will be the default on my Mac, and one with the > headless flag set, that gets explicitly launched by Jenkins... not perfect, > but a HUGE step!! Yes this is why we thank Square [i] And I would like to really encourage effort in that direction. > > Cheers, > Sean > > > > -- > View this message in context: http://forum.world.st/ANN-Headless-support-for-Cog-Cocoa-VM-tp4664137p4664212.html > Sent from the Pharo Smalltalk mailing list archive at Nabble.com. > |
In reply to this post by Mariano Martinez Peck
On Sat, Jan 19, 2013 at 12:08 PM, Mariano Martinez Peck <[hidden email]> wrote:
Well, I have compiled a normal VM (without my headless changes) with LLVM GCC.
Now, can you try this VM (CogVM-standard) please? If we get Ilegal Instruction, then it is the compiler. If we don't, and it works, then it is something related with my changes.
Thanks,
Mariano http://marianopeck.wordpress.com |
In reply to this post by Sean P. DeNigris
On Sat, Jan 19, 2013 at 1:08 PM, Sean P. DeNigris <[hidden email]> wrote: Mariano Martinez Peck wrote Yes, that's the easiest way. I spent *a lot* of time trying to find another way, but they all failed. There is one possibility that should work but it is too hacky for me:
very at the beginning of the VM (before starting Cocoa) read the arguments. If "-headless" is present, then programmatically set/write the flag in the Info.plist. If it it not, do nothing (or set it to false). But modifying the file on startup looks hacky to me. I prefer the user to manually set it.
Mariano http://marianopeck.wordpress.com |
yeah, I declare my self guilty for having that incredibly ugly idea... :)
On Jan 21, 2013, at 3:35 PM, Mariano Martinez Peck <[hidden email]> wrote:
|
On Tue, Jan 22, 2013 at 1:19 PM, Esteban Lorenzano <[hidden email]> wrote:
heheheheh :) As you see (and I thanked in the email) Esteban has been helping me here.
And then he will merge and integrate :)
Mariano http://marianopeck.wordpress.com |
In reply to this post by Mariano Martinez Peck
Hi Mark,
Should have read the man page for open instead of a web page. I had already tried the second version. Still crashes though, with the same error, on 10.6.8 (can try it on newer and older versions too, after finding a working version) Mariano: CogVM-sandard also has the illegal instruction Stephan |
On Wed, Jan 23, 2013 at 11:07 AM, Stephan Eggermont <[hidden email]> wrote: Hi Mark, No problem. I had already tried the second version. Ok, the good news for me then is that it is not my headless change but the problem of GNU GCC VS. LLVM GCC ;) We need to find a way to compile the VM in 10.8 and with GNU :( Stephan Mariano http://marianopeck.wordpress.com |
we have it
is just you who cannot :) On Jan 23, 2013, at 3:28 PM, Mariano Martinez Peck <[hidden email]> wrote:
|
On 23 January 2013 15:32, Esteban Lorenzano <[hidden email]> wrote:
> we have it > > is just you who cannot :) yeah.. but i would be much more happier to have stable VM compiled by LLVM compiler, because Apple abandoned GCC ;( -- Best regards, Igor Stasenko. |
yes... in short time we need to be able to run llvm compiled vms even in older (10.5, 6) OSX versions... it cannot be so hard, after all, is just a compiler :)
On Jan 23, 2013, at 4:01 PM, Igor Stasenko <[hidden email]> wrote: > On 23 January 2013 15:32, Esteban Lorenzano <[hidden email]> wrote: >> we have it >> >> is just you who cannot :) > > yeah.. but i would be much more happier to have stable VM compiled by LLVM > compiler, because Apple abandoned GCC ;( > > > > -- > Best regards, > Igor Stasenko. > |
On 23 January 2013 16:06, Esteban Lorenzano <[hidden email]> wrote:
> yes... in short time we need to be able to run llvm compiled vms even in older (10.5, 6) OSX versions... it cannot be so hard, after all, is just a compiler :) > hehe.. keep a good spirit and hope :) -- Best regards, Igor Stasenko. |
Free forum by Nabble | Edit this page |