5 ms·
The Super Duper Universal Binary
- ChrisMarshallNY 6y agoThis kind of thing is pretty cool, but I’ve learned to avoid them, because they can result in A) BIG clumps of code, and B) testing issues. I used to have a special shell script that I wrote, that used lipo to combine multiple binaries into an aggregate library. I probably still have it around, somewhere. I was fairly proud of it. Also, I had to use static libs, which wasn’t a problem, as long as I didn’t mind a big executable that couldn’t be trimmed. Over the years, I’ve learned (the hard way, since I’m a stubborn knucklehead) not to “end run” around Apple’s prescribed methodology. Now that Apple has wrapped Swift Package Manager into Xcode, it lessens the need for “clumped” binaries (for internal projects).
- steviedotboston 6y agoA super duper universal binary? Oh you mean a .jar file
- ReactiveJelly 6y agoYou can move any car by pushing it, but I wouldn't call that driving.
- wolrah 6y agoAh yes, Java, with the promise of "write once, run anywhere"...as long as anywhere has a specific version of the JRE installed that's been EoL since 2007. Obviously that's not the case for all Java software, but has always amazed me how seemingly easy Java made it to end up like that. So many legacy Java apps that are a complete pain to support, and $deity help you if one user needs to run two different legacy apps with non-overlapping JRE requirements. And that's not even getting in to the horrors that were the Java plugin, fortunately that is entirely out of my life and gone for good.
- seanhunter 6y agoAgree and I am very glad I don't have to deal with this type of thing any more. Sane support for different JREs is one of the use cases where containerization would really show its worth I expect. It should be relatively easy to set up a container with the app, the right jre version and a consistent set of dependency jars, all wrapped up with a shellscript that sets the class path and adds any horrible monkey patches you need to get things working and then launches it with the right set of arguments etc. Once that's done all that nastiness would be kept in its own private hell and you could have multiple of them running simultaneously and know that they won't infect each other and upgrading any one piece and/or your system jdk isn't going to kill everything. It's not dependent on the system or user classpath or other environment variables, so should be reproducible and avoid weird "it works for me" bugs where the user is suffering something you just don't see. Safe to say that's far from what "write once, run everywhere" seems to promise.
- mikestew 6y agoas long as anywhere has a specific version of the JRE installed that's been EoL since 2007. I just ran into this on a new machine while trying to get Bamboo (Atlassian's CI product) running. Just download latest? phhhttt It needs a specific version: 1.8. Wait a minute, WTF? Java is at like v14 now, or something, right? Ah, because apparently there's some soft link from 1.8 to $WHATEVER_VERSION. Didn't matter because I downloaded the JRE, but needed the JDK. Or something. I've eventually got it working, and wrote it down this time. I go back so far that I've written software on punch cards. And someone suggests that we foist this on your average Mac (or for that matter, any OS) user? Fat binaries, please.
- cesarb 6y ago> It needs a specific version: 1.8. Wait a minute, WTF? Java is at like v14 now, or something, right? There was a compatibility break between Java 1.8 and Java 9 (the version number also lost the prefix at the same time, Java 1.8 can be thought of as "Java 8"). It was not as big as the change from Python 2 to Python 3, but a lot of software needed changes to not break; as late as last year, I was still seeing Java libraries adding fixes for compatibility with Java 9. If your software depends on libraries which have not yet been upgraded to work with Java 9, you have to require Java 8 (that is, Java 1.8). It doesn't help that, even today, the default version of Java in some major Linux distributions is Java 1.8, so not only that's a good reason to keep compatibility with Java 8, but also it means that there's a good chance that the server already has Java 1.8 installed. (In a not so distant future, however, these major Linux distributions will probably have Java 11 as the default version; the next long-term stable Java version after Java 11 is probably going to be Java 17, so you are going to see many software require Java 11 for a while, and later Java 17.)
- nkurz 6y agoWhat's the argument for why fat binaries like this are a good idea, as opposed to having separate binaries that can be downloaded for different architectures? It seems like the main advantage would be when there is (something like) a networked drive simultaneously accessed by incompatible machines, with a secondary case for when the same drive is transferred from machine to machine (or when a single machine is upgraded to a different processor). Is this a large enough use case to drive adoption, or is there some other major benefit that I'm missing? Or is it that having 2x (or 17x) larger binaries to distribute isn't actually much of a downside, so even a small benefit is sufficient justification?
- timw4mail 6y agoThe only real advantage is you don't have to worry about which binary to pick on the download page.
- sanxiyn 6y agoThis is an enormous advantage, so it's not to be disregarded lightly.
- nkurz 6y agoYes, having a user manually choose a binary to download from a web browser is poor, but certainly there are technological solutions to this that are lighter weight than doing a full download of a fat binary for everyone. Perhaps you download a shim installer that tests your processor and chooses the correct download? Perhaps instead of a generic web browser downloads are done within a framework that already knows the correct architecture? Especially if you are Apple, and if the goal is simply choosing the right version initially, it seems like there would be many better solutions.
- gruez 6y ago> Perhaps you download a shim installer that tests your processor and chooses the correct download? Wouldn't that only work if the shim itself was a universal/fat binary? Otherwise you still run into the same problem. You can sort of work around on unix-like systems by using the shebang, and on windows by having the executable in .net.
- m0llusk 6y agoPerhaps "totally gross" binary would be a more specific and direct terminology?
- m0llusk 6y agoI was serious, but of course immediately received negative feedback. Super Duper, it is then. Any chance someone will explain why they feel that is the superior choice? It doesn't seem to be any more precise. If anything it is just some unrelated expression used for kicks. Or was this just an emotional reaction unrelated to any particular line of reasoning?
- Wowfunhappy 6y agoRespectfully, I don't think it added anything to the discussion regardless of whether or not you were serious. Why is a multi-arch binary "totally gross"? The advantages and disadvantages have already been discussed heavily upthread, and they did it in a much more substantive way.
- nkurz 6y agoI downvoted it because I thought it was a low effort joke, and I wanted the comments to focus on the concept rather than the name. Also, I thought you were suggesting "totally gross binary" as a general replacement for the established term "fat binary", and it didn't seem like a good idea. I treated Super Duper as just a sarcastic title for a blog post, and don't think it's actually any better. Apologies if I misunderstood your intent.
- wazoox 6y agoBack in OpenStep, it was quite common to have fat binaries with m68k, i386, SPARC and PA-RISC architectures.
- lukeh 6y agoYes, I think we called them quad-fat back then?
- musicale 6y ago> Just build them separately and lipo them together. Perfect command name. ;-)