Saturday, December 12, 2015

38.5.0 available, and maybe 45 as the swan song, in not too long

TenFourFox 38.5.0 is now available for testing (download, hashes, release notes). Remember to quit any foxboxes you have open before you update the browser, and start the browser before you start any foxboxes back up if you want to have the browser and foxboxes running simultaneously (the Dock gets a little confused otherwise). This version backs out the last of the debugging code from issue 308 (which also yields a small improvement to memory and speed), works around issue 307 to always dump .json bookmarks (now with the correct extension), and fixes the application menu in foxboxes and certain add-ons by importing the patch from Mozilla bug 1181977.

This version also enables MP3 audio support by default (we use the minimp3 decoder, which I hacked for our purposes since AudioToolbox in 10.4 does not understand MP3). There are already some known files that don't play in it that do play in QuickTime, so this appears to be a bug in minimp3. If you report MP3 files that don't work, please include the encoder so we have at least a chance at something analysable. If you don't, I'll still accept the report, but I may not do much with it unless it's glaringly obvious what about the file it doesn't like.

With 38.5, Firefox 45, the next ESR, moves out of nightly into aurora. Since Mozilla is only up to the point of doing A/B testing for multi-process Electrolysis in Fx44 beta, it seems unlikely that 45ESR will make Electrolysis mandatory, so that means I would be foolish to not make at least an attempt at porting it. This will require another toolchain upgrade like we did for TenFourFox 19. Fortunately, we do have a working gcc 4.8 in MacPorts and it does build and run 38 successfully without our current gcc 4.6 shim, and I'm working with Sevan Janiyan to get the Tiger pkgsrc gcc 4.9 functional (it seems to need updates to as and ld, since it will parse the source, but currently builds a defective XUL). I'm also looking into using Misty DeMeo's Tigerbrew gcc as an alternative. Either way, after the update for TenFourFoxBox and its official release I'll probably start working on trying to adapt 45ESR, which should give us plenty of time to have a functional beta out by 45.1, assuming it doesn't blow up in my face.

I am, however, going to call 45 the end of source parity, and this time I mean it. I know I've said "the end" lots of times in the past, but besides the fact Electrolysis won't compile as-is on 10.4 (and quite possibly will be a net negative even if it works), and Electrolysis will almost certainly be mandatory by 52ESR now, Mozilla is now importing code written in Rust into Gecko, not just C/C++. Although Rust allegedly supports PowerPC, it is only known to work on Linux (and there isn't a snapshot, rustc or cargo for it even there); it is not known to work, or have a snapshot available, for OS X/ppc, and then there's the matter of llvm on our same platform. Mercifully it does not appear any of the existing Rust code (which is already in the tree) will be required for 45ESR, but it does appear that new Rust code will replace a number of older C/C++ modules by 52ESR once Mozilla works out the build system kinks, making Rust a build requirement. This would be a showstopper for us and any other Tier-3 platform that lacks a Rust compiler (Solaris on SPARC? the remnants of OS/2?). It would also probably signal the end of 10.6 support in the near future, since by default the Rust standard library requires features Snow Leopard doesn't have (though there are ways around it).

Frankly, I'm not going to maintain a completely new compiler for a language I'm not fluent in and its runtime platform on top of a browser and debugger I'm already maintaining singlehandedly when we're already facing two other portkillers (loss of 10.6 support, whenever that comes, and E10S). Assuming this trajectory continues unchanged we will drop source parity after 45ESR, but there will of course still be updates; besides new features we can now release since we're not worried about maintainability against Mozilla source anymore, we'd still get a fair chance to import later updates to the core that were still in C/C++, and we'd be still a very advanced browser for at least a couple years. We'd be better off than Goanna in Pale Moon, anyway, which is still 24.x-era with various patches.

It had to happen for real sooner or later.

Tuesday, December 8, 2015

So long, Firefox phones

Fresh from Mozilla's internal revelation they'd like to jettison Thunderbird as a drag on Firefox development (sure to rankle our Tenfourbird builder in the land of the Rising Sun), Mozilla has now announced the end of the Firefox OS smartphone.

I can't say I'm surprised. I liked FxOS as a user, but its application support was dismal (so I could not ditch my Nexus 5, nor could I truly dogfood any Firefox device), and FxOS seemed to only be offered as an option on truly awful hardware. In my case, it was the so-bad-it's-terrible Geeksphone Revulsion Revolution, branded as their developer unit after the whimpering fail of the Peak. True to form, when I actually finally got one, it turned out to be an unmitigated steaming heap and essentially ensured I would never buy a Geeksphone device ever again. Yes, it was that bad. And this was supposed to be their developer device, to get people actually excited about the platform!

That said, I'm sad to see this development (even if I'm not at all shocked), because even though FxOS will live on in some form as an open source project I predict it'll eventually go the benignly neglected way of things like Firefox for webOS (which, having recently acquired an HP Veer for snickers and fighting with endian problems in novacomd, would be really handy about now). That's bad for us in Power Mac land because the improvements to boost Firefox performance on constrained mobile devices also help with our now decade-plus computers. Time will tell if Mozilla decides to kill the entire project as well, not just shipping Firefox phones.

TenFourFoxBox so far has been a huge success. I should publicly mention Mike Hommey's comment in the last blog entry: yes, the true successor to WebRunner is the webapp runtime that Firefox presently comes with, but the webapp runtime doesn't work on 10.4 and needs quite a bit of hacking to do so, and since we weren't using it anyway I could just implement an even lighter chrome and make it even faster. There will be some adjustments to allow people with differently-named executables to work (as well as an override version in case you want to use a specific version of the browser to run your foxboxes), and we need to implement a component for certain sites that try to enumerate navigator.* properties (Chase was the main offender), but otherwise it's been very well received. 1.0 will appear after 38.5.0 and will receive its own website at that time.

Speaking of, I haven't had a lot of time to do much else with 38.5 or the occasional test complaints about the MP3 decoder due to time constraints and finishing my Master's degree, but the MP3 decoder will be enabled and we'll gather some data points to figure out which encoders minimp3 doesn't like (after all, the fact it can play most MP3 files is better than none). There will also be a patch for bug 1181977 to fix the empty Application menu in foxboxes (remember to quit any running foxboxes before you upgrade the browser), and a custodial cleanup after issue 308. Watch for it this weekend for release next week.

Saturday, November 21, 2015

TenFourFoxBox: because it's time to think inside the (fox)box. (a/k/a: we dust off Mozilla Prism for a new generation)

As long as there have been web browsers, there have been people trying to get the web freed up from the browser that confines it, because, you know, the Web wants to be free, or some other similarly aspirational throwaway platitude. These could be robots, or screen scrapers, or aggregating services, or chromeless viewers, but no matter what these browserless browsers are doing, they all tend to specialize in a particular site for any number of reasons usually circulating around business or convenience. This last type, the chromeless viewer, spawned the subcategory of "site specific browsers" that morphed into the "Rich Internet Application" and today infects our phones and tablets in the guise of the "lazy-*ss programmer mobile app."

Power Mac users have only had access to a few tools that could generate site-specific browsers. Until Adobe withdrew support, Adobe AIR could run on PowerPC 10.4+, but it was more for generally Internet-enabled apps and wasn't specifically focused at creating site-specific browsers, though it could, with a little work. Leopard users could use early betas of Fluid before that went Intel-only, and I know a few of you still do. Even Mozilla themselves got into the act with Mark Finkle's WebRunner, which became Mozilla Prism in 2007, languished after a few releases, got moved to Salsita and renamed WebRunner again in 2011, and cancelled there as well around the time of Firefox 5. However, WebRunner née Prism née WebRunner was never available for Power Macs; its required binary components were Intel-only, even though the Mozilla releases could run on 10.4, so that was about it for PowerPC. (Mozilla tried again shortly afterward with Chromeless, but this didn't get off the ground either, and was never intended as a Prism successor in any case. Speaking of, Google Chrome can do something similar, but Chrome was of course never released for Power Macs either because Alphagooglebet are meaniepants.)

There are unique advantages as TenFourFox users to having separate apps that only handle one site at a time. Lots of tabs requires lots of garbage collection, the efficiency of which Mozilla has improved substantially, but is still a big drain on old computers like ours which are always under memory pressure. In addition, currently Firefox and TenFourFox must essentially cooperatively multitask between tabs because JavaScript infamously has run-to-completion semantics, which is why you get the "script too long" dialogue box if the watchdog portion of the browser detects something's pegging it. Since major portions of the browser itself are written in JavaScript, plus all those addons you tart it up with, the browser chrome must also cooperatively multitask with everything else which is why sometimes it temporarily grinds to a halt. I've sunk an incredible amount of time over TenFourFox's existence into our just-in-time JavaScript compiler for PowerPC to reduce this overhead, but that only gets us so far, and the typical scripts on popular websites aren't getting any less complex. Mozilla intends to solve this problem (and others) with multi-process Firefox, also known as Electrolysis, but it won't work without significant effort on 10.4 and I have grave doubts about its ability to perform well on these older computers; for that reason, I've chosen not to support it.

However, generating standalone browser apps for your common sites helps to mitigate both these problems. While each instance of the standalone browser uses more memory than a browser tab, with only one site in it garbage collection is much easier to accomplish (and therefore faster), and the memory is instantly reclaimed when the standalone browser terminates. In fact, on G5 systems with more than 2GB of RAM, it helps you actually use that extra memory more effectively: while TenFourFox is a 32-bit application (being a hybrid of Carbon and Cocoa), you'd be running multiple instances of it, all of which have their own 32-bit address space which can be located in that extra RAM you've got on board. Also, separate browser instances become ... multiple processes. That means they preemptively multitask, like Electrolysis content processes would. They could even be scheduled on a different core on multiprocessor Power Macs. That improves their responsiveness substantially, to say nothing of the fact that the substantially reduced amount of browser chrome has dramatically less overhead. Now, standalone browsers also have disadvantages; they lack a lot of the features of a regular browser, including safety features, and they can be more difficult to navigate in because of the reduced interface. But for many sites those are acceptable tradeoffs.

So, without further ado, let's introduce TenFourFoxBox.

TenFourFoxBox is an application that generates site-specific browsers ("foxboxes") for you, running them in private instances of TenFourFox (a la XULRunner). This has been one of my secret internal projects since I got Amazon Music working properly with TenFourFox, so I wanted to use it as a jukebox without dragging down the rest of the browser, and to help beef up the performance of my online coursework site which has a rather heavy implementation and depends greatly on Google Docs and Box. And now you'll get to play with it as well.

Although TenFourFoxBox borrows some code from Prism/WebRunner, mostly the reduced browser chrome, in actual operation it functions somewhat differently. First, TenFourFoxBox isn't itself written in XUL; it's a "native" OS X application that just happens to generate XUL-based applications. Second, for webapps created with Prism (or its companion tool Refractor), it's Prism itself that actually does the running with its own embedded copy of the XUL framework, not Firefox. With TenFourFoxBox, however, foxboxes you create actually run using the copy of TenFourFox you have installed (and yes, the foxboxes will look for and run the correct version for your architecture), just as separate processes, with their own browser chrome and their own application support and cache directory independent of the main browser. The nice thing about that is when you upgrade TenFourFox, you upgrade the browser core in every foxbox on your system all at once, as well as your main browser, because TenFourFox is your main browser, amirite?

The implementation in TenFourFoxBox is also a little different with respect to how data is stored. Foxboxes are driven essentially as independent XULRunner apps, so they have their own storage separate from the browser. Prism allowed this space to be shared, but I don't think that was a good idea, so not only are all foxboxes independent, but by default they operate effectively in "private browsing" mode and clear out cookies and other site data when they quit. By default they also disable autocomplete, improving both privacy and a little bit of performance; you can, of course, change these settings, and override checks sites might do which could detect you're not actually in a regular browser. I also decided to keep a constant unchanging title (regardless of the website you're viewing) so that you can more easily identify it in Exposé.

So, let's see it in action. Here's Bing Maps, in full 1080p on the quad G5, looking for drone landing sites.

And here's what I originally wrote this for, Amazon Music, playing the more or less official album of International Space Year:

(Stupid Amazon. I already have Flood and Junta!)

So now it's time to get this ready for the masses, and what better way than to have you slavering lot mercilessly bang on it? The following bugs/deficiencies are known:

  • The application menu only has "Quit." This is actually Mozilla bug 1181977, and will be fixed in TenFourFox 38.5, after which all the foxboxes will "fix themselves."
  • Localization isn't supported yet, even if you have a localized TenFourFox; most things will still appear in English. It's certainly possible to do, just non-trivial because of TenFourFoxBox's dual nature (we have to localize both the OS X portion and the XUL code it generates, and then figure out how to juggle multi-lingual resources). I'm not likely to do anything with this until the rest of it is stable enough to freeze strings.
  • Although the browser core they run is shared, individual foxboxes have their own private copies of the foxbox support code and chrome which are independent. Thus, when a new TenFourFoxBox comes out, you will need to manually update each of your foxboxes. You can do this in place and overwrite them; it's just somewhat inconvenient.
  • There are probably browser features missing that you'd like. I'm willing to entertain reasonable requests.

Even the manual is delivered as a foxbox, which makes it easy to test on your system. Download it, try it and post your comments in the comments. TenFourFox 38.4 or higher is required. This is a beta, so treat it accordingly, with the plan to release it for general consumption a week or so after 38.5 comes out.

Let's do a little inside-the-box thinking with an old idea for a new generation, shall we?

Wednesday, November 11, 2015

Two interesting things

(Shout-out to Stories of Apple, which did a very nice piece on TenFourFox. Check out their other fascinating articles on Apple history. And a shout-out to my father, an American veteran, for his service to this country.)

First, from the Google Chrome blog:

Today, we’re announcing the end of Chrome’s support for Windows XP, as well as Windows Vista, and Mac OS X 10.6, 10.7, and 10.8, since these platforms are no longer actively supported by Microsoft and Apple. Starting April 2016, Chrome will continue to function on these platforms but will no longer receive updates and security fixes.

(Recall that Google had already dropped 32-bit Intel Macs with Chrome 39.)

I've long warned on this blog that Firefox dropping 10.6 support will probably really hurt us in TenFourFox-land, since there are major API changes and assumptions about the compiler, as well as the loss of 32-bit support (we are a hybrid Carbon/Cocoa 32-bit application, even on G5 systems). Naturally, we would of course add it back in just like we did when 10.4 and 10.5 support was progressively removed from the tree, but it would greatly hurt long-term maintainability and may force dependencies on certain features Tiger just doesn't have. However, with 45 (the next ESR) now on Nightly with 10.6 support still fully in effect, and with even plans to merely drop 10.6.0-10.6.2 stalling, it doesn't look like that will happen before 45ESR. That at least gives us a chance at one more ESR version assuming Electrolysis isn't mandatory by then.

Now, second. I've never particularly been a big fan of Grüber Alles, but he says something very interesting in his review of the iPad Pro:

According to Geekbench's online results, the iPad Pro is faster in single-core testing than Microsoft's new Surface Pro 4 with a Core-i5 processor. The Core-i7 version of the Surface Pro 4 isn't shipping until December -- that model will almost certainly test faster than the iPad Pro. But that's a $1599 machine with an Intel x86 CPU. The iPad Pro starts at $799 and runs an ARM CPU -- Apple's A9X. There is no more trade-off. You don't have to choose between the performance of x86 and the battery life of ARM.

We've now reached an inflection point. The new MacBook is slower, gets worse battery life, and even its cheapest configuration costs $200 more than the top-of-the-line iPad Pro.

Although it's quite possible this says more about how bad the new MacBook sucks than about how good the iPad Pro is, it really looks like those P.A. Semi folks Apple snapped up a few years back (yes, the people who worked on the PWRficient PA6T, one of the PowerPC CPUs in the running for the post-PowerBook G4 PowerBook) are starting to make serious inroads against x86. POWER remains a monster in the datacenter because it can scale, and, well, it's IBM, but IBM hasn't cared (as much) about performance per watt in that environment for quite some time whereas that matters a great deal in the consumer market, and that's why we never got a PowerBook G5. For years industry pundits said the reason ARM chips were so thrifty with their power usage is that they weren't all that powerful, comparatively speaking. Well, the A9X changes that landscape substantially: now you've got an ARM core that's seriously threatening the low to mid range of Chipzilla's market segment and is highly power efficient, and I can't imagine Intel isn't scared about Apple licensing their design. This blog may be written by an old RISC fetishist -- in this very room I have a PA-RISC, a SuperH, a SPARC, a DEC Alpha, several SGI-MIPS and of course a whole crapload of PowerPC hardware -- but after seeing these surprising benchmark numbers all those old rumours about Apple eventually coming up with an ARM MacBook suddenly don't seem all that far-fetched.

Finally, okay, okay, three things, this Engrish gem from mozilla.governance, emphasis mine:

I’m now writing to you to tell you something that make me puzzled. As I know, Firefox is a free browser which offers users independent web suffering.

We all know it, brother. We all know it. :)

Friday, October 30, 2015

TenFourFox 38.4.0 available

TenFourFox 38.4.0 is now available for testing (release notes, downloads, hashes), just in time for you to surf on your iBook G4 while you aim your water cannon loaded with Tabasco sauce at juvenile delinquents craving candy. You know, as you do. Along with fixes for two crashes (most notoriously issue 308) and miscellaneous, this version, as promised, includes complete HTML5 MP3 audio support. To try it out, turn tenfourfox.mp3.enabled to true. If there are no major issues, it will be the default in 38.5.

As always, barring major issues, the browser will be released officially late Monday Pacific time, along with unveiling the new El Spoofistan design for the main page.

In other ecosystem news, I am incredibly delighted to see Tenfourbird 38.3 from our anonymous builder in the land of the Rising Sun, and it works great -- I use it for (appropriately enough) reading news.mozilla.org. Try it. You'll like it.

Saturday, October 24, 2015

And now for something completely different: El Crapitan sucks (or why SIP will make me go Linux if they keep this crap up)

ObTenFourFox news: 38.4 goes to build next week when Mozilla drops build tags on ESR with a couple more fixes too. Watch for it. Recommended.

Yes, I confess I actually do own two Intel Macs, an old 2007 Core 2 Duo Mac mini running 10.6 which mostly serves as a test machine, and a 2014 i7 MacBook Air which I use for taxes and Master's program homework. The MBA reminds me regularly of why I preferred the New World Power Mac days, and why my daily drivers are still all Tiger PowerPC. Lately every year when Apple issues their annual update I get a bit nervous because their quality assurance seems to have gone right down the pot -- I think the beta testers just twiddle a couple buttons and call it good for golden master, and never mind when everyone's machines explode because they might actually have customized it a bit, or something similarly empowering that Apple doesn't want you doing with your overpriced appliances. (More on that when we get to my overall gripe at the end.)

Part of what makes my trepidation more acute is that I actually do write software that can run on a current Intel Mac from time to time, despite my reputation as a Power Mac-clinging troglodyte. Now, this software is still truly Universal in the strictest sense of the term -- I build on my G5 against the 10.4 universal SDK to make applications that generally run on any Mac OS from 10.4 till now, on any Power Mac and on any Intel Mac, and I even found a version of SDL 1.2 (1.2.14) that happily runs in the same environments on all systems without tripping any deprecation warnings so far. I'll be talking about one particular app in the very near future because not only is it Universal ppc/i386, it also includes AltiVec support, so it's actually 750/7400/i386. Keep an eye out for that column. Fortunately El Capitan didn't break the ones I write based on that environment.

Next, I turned to GopherVR and Mosaic-CK, my rebuilds of two venerable Motif-based X11 applications (the GopherVR client, allowing you to view gopherspace graphically, and an updated port of NCSA Mosaic that doesn't immediately barf on newer pages). These use a special launcher program to install a Dock icon and transfer control to the binary under X11. They both crashed immediately. I looked in the console and found that they were unable to run OpenMotif, which they should have detected, but I said no problem and got out my installer of IST OpenMotif 10.5+ which worked perfectly in Yosemite. On El Cap, it wouldn't install.

Why? Blame the new System Integrity Protection, which amongst other things blocks write access to certain directories, in this case /usr, even if you're root ("rootless protection"). OpenMotif expects to install itself to (more or less) /usr/OpenMotif. El Crap won't let it.

Now, you can keep your superior security snark out of my comments, thanks. I get why SIP exists, because users are stupid, and SIP saves them (somewhat) from themselves. At least so far, unless some gaping kernel hole is discovered, it looks pretty hard to toast an SIP-locked installation other than via hardware failure, and yes, if you're willing to jump through a couple hoops, you can turn it off. But you don't have to be particularly clairvoyant to realize Apple won't let you do that forever, and even now it's mostly all or nothing unless you turn SIP off and tinker with its configuration file. Frankly, making users go to all that trouble isn't a good way to distribute software.

So the first thing I did was patch OpenMotif to run from /Applications, which isn't protected (yes, /Library might be more appropriate, but I had to patch a couple paths embedded in the libraries in place and the length matched better), by changing all the linkages to the new path with a Perl script I dashed off and doing a couple direct binary changes. It looked sane, so I put it in /Applications/OpenMotif21 and rebuilt the apps on the G5 to link against that. It worked fine on 10.4 and 10.6, but on the 10.11 MBA they still crashed.

This time, the OpenMotif libraries could be found, but they were linking against /usr/X11R6, because that's where the universal X11 libraries are in the 10.4 universal SDK and every version of OS X from 10.5 to 10.10 had a symlink to /usr/X11 so it all just worked. Guess what new version of OS X doesn't? And guess what version prevents you from modifying /usr to add that link because of SIP?

I toyed with a couple solutions, but the simplest was to lipo a second i386 binary from the main one (since all Power Macs will run the original binary pointing to /usr/X11R6 fine) at the time the app package is built and rewrite all its linkages to /usr/X11 instead. Then, when the launcher starts, it figures out which binary to run depending if /usr/X11R6 exists or not, and transfers control to that. It's ugly and it bloats the app by about 25%, but it's transparent to the user, at least, and it doesn't require the user to have developer tools installed or I'd just have the launcher do the stripping and rewriting on the fly.

After that, I fixed a couple more bugs (including the original one where I had a short-circuit in the prerequisites detector) and packed everything up for distribution, and now you can use GopherVR and Mosaic-CK once again. Make sure you have X11 or XQuartz installed first, and then grab my patched OpenMotif from SourceForge (choose the 10.4 package for Tiger, or the 10.5 package for Leopard through El Capitan). Just drag the folder to /Applications without changing the name or any of the contents, and then run either GopherVR and Mosaic-CK's launcher app, and it should "just work" on any 10.4+ Mac just as it did before.

Why does SIP annoy me most, though, aside from making my binaries more complex and my headache larger? Simply put, I don't like the feeling I don't own my computer, and I'm getting that feeling more and more from Apple. I feel this much less on my Tiger boxes because I can patch them up manually and improve their security and functionality, or alter the way the OS is laid out to suit my taste and needs and how things are installed and activated, and I'm quite sure Apple has great concerns about allowing that on what they consider to be an "appliance." In fact, the irrepressible cynic in me suspects part of SIP's purpose is not just security -- it also has the (to Apple) desirable side effect of forcing most systems to exist in a specific uniform state so that installations and upgrades are more deterministic instead of allowing a (dangerously?) clueful user to muck about at will. While predictions that Gatekeeper would become locked in stone and unsigned apps would be never be allowed to run even by request have not yet come to pass, a lot fewer people will be inconvenienced by SIP than by Gatekeeper except for nutbag tinkerers and hackers like me, and Apple has little downside to making it permanent in a future version of OS X. That means one day you may not be able to change the OS at all except through those changes Apple authorizes, and that would really suck. It would also drive me to Linux on commodity hardware, because if system limitations mean I can't find a way to run my custom apps on a current Mac that run just fine on my G5 daily driver, then why have a current Mac? As it turns out, I'm not the only one thinking about that. What's Apple going to break next year, my legs?

Geez, Tim.