![]() |
#1 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,309
Karma: 78876004
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
|
Linux, Mac OS X, and Windows Application Packaging
@KevinH and @DiapDealer (and others):
See this post over in the Windows 10 thread ![]() |
![]() |
![]() |
![]() |
#2 | |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,485
Karma: 5703586
Join Date: Nov 2009
Device: many
|
Hi PeterT,
Quote:
And requiring your entire OS to be recompiled just to update a specific library at times, is a sure sign of insanity. Linux really needs to move to a hybrid model were simple basic commands and shared libraries are still stored in the current Linux hierarchy, but actual applications are stored in a standard location in some consolidated form as on Windows (C:\Program Files\PACKAGE) and Mac OS X (/Applications). Then add in application containers to allow drag and drop of entire applications, code signed verification on load, restricted access to resources by application, and sandboxing and you will bring Linux kicking and screaming into the present. I also agree the Linus is correct, the plethora of Linux distributions with their arcane rules and distribution specific changes has done more to damage Linux on the Desktop than almost anything else. Nice post. KevinH |
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Isn't /opt pretty much the exact "consolidated form" from Windows/OSX you want, minus code signing?
|
![]() |
![]() |
![]() |
#4 | |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,485
Karma: 5703586
Join Date: Nov 2009
Device: many
|
Hi
Quote:
From the Desktop these need to be easily able to run without requiring lots of PATH of LD_LIBRARY_PATH hacks. It needs to have some form of sandboxing possible. It needs to be signable with verification on application launch. It needs have a way to keep a list of rights and resources the app is allowed to use. It needs to allow private Frameworks and other internal app structures to support internal resources, it needs to appear like a single file to the user and be drag and droppable for installation easily. Something like a separate file fork would be useful to store metadata about the app and extended attributes for the file in a manner invisible to the end user and to prevent the need for central registry nonsense, etc. I have read a few posts about application containers and their ability to run each app in its own VM sandbox that is being developed on Linux. Hopefully this would bring along many of the other desirable traits. If so, it certainly be a big step forward. KevinH |
|
![]() |
![]() |
![]() |
#5 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Well, I suppose you are eagerly awaiting some of that in Windows as well.
Last I checked, "applications appearing like a single file" is quite OSX-specific. Windows uses installers instead, and linux its package managers -- package managers could install commercial applications, if anyone could ever agree on a common format. Minor trivia -- the command-line tools for calibre are unavailable on OSX, at least without manually making symlinks deep into the heart of the Schrödinger's file of an Application, after installation, because of OSX's Application bundle model. I've gotten around that, via an OSX port of my calibre-upgrade.sh here: https://github.com/eli-schwartz/calibre-installer -- which breaks the Application-is-a-drag-and-drop-file model also. On linux, applications go in `/usr/bin` and access their `/usr/lib`'s etc. and are easily available as a matter of course. Or install to /opt and symlink to /usr/bin, possible because of the package manager strategy. On Windows, the MSI can add calibre's installation directory to the PATH. Maybe there is something similar that can be done for OSX, I don't know. Apparently neither does Kovid. Verify on application launch as opposed to signed installers? That is orthogonal to your original complaint. As are sandboxes. That relates to the security model, not the ability to publish an application that doesn't need recompilation for every trivial OS component update. And some of that has been around for a while. SELinux, containerization, both are real today. Frankly, they are only desperately urgent in a more commercial environment. registry nonsense -- Windows, not linux? ![]() Or do you mean that each file should be allowed to override its own mimetype and say which applications should open it, and each application should be allowed to, um, what? Forgive me, I have no idea what OSX is doing, much less the motivation. ![]() Last edited by eschwartz; 11-15-2015 at 01:50 PM. |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,485
Karma: 5703586
Join Date: Nov 2009
Device: many
|
Hi,
On MacOSX, Yes you can add any directory to the path for any user just like any other unix box (play with their bash startup scripts or system bash startup scripts). As for code verification on load, that is much more desirable than just signing the original package as it helps prevent any improperly changed code from launching. Single file drag and drop installation and distributed metadata, makes installation and package management much easier without the central failure point of a registry. This all in turn allows much more robust sandboxing. Linux is simply behind the times in that and as Linus pointed out, the distribution specific changes are killing commercial dev for Linux. I am hoping the new work on the Linux App Containers will fix most of these issues. Not sure what you are arguing against here. Linus even agrees with me! |
![]() |
![]() |
![]() |
#7 | |||
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Quote:
And it is IMHO unreasonable to expect people to maintain lengthy PATHs in their bashrc in order to access the CLI functionality of an Application bundle that has CLI functionality. Especially because it requires investigating what to add. People have asked here a number of times how to do it, because they tried accessing the CLI tools via what they thought was the right path, but which apparently wasn't. Anyway. This was just an example of one way in which I think Application bundles may have their weak points. Quote:
The kernel is also owned by root. Maybe they will change that instead. Okay, it's good-to-have. But I am pretty sure the current lack of it is NOT what prevents the mystical Year of the Linux Desktop. Quote:
But I do not seem to see where he agrees with any of your other points. Both Windows and linux don't have a drag-and-drop installation. Both store metadata in central locations. Windows has its registry, linux uses desktop files and custom-mimetype.xml stored in central directories, owned by packages, which are cached by the MIME database and can be trivially rebuilt from scratch. (Very pissed, by the way, that defaults are essentially random and also sometimes change at random. Windows 8 fixed that, but did linux? noooo...) As far as I know, Linus is fine with both of those. As far as I know, the linux package manager model is usually held up as an example of why Windows is/was massively behind the times (no centralized source for installation and updates? ![]() OSX of course has had an App Store for a while. Just like linux packaging except all Applications use isolated installs (linux could, technically, do the same if that is how the distros chose to compile an application. But they won't...) So all three of us agree on the need for some equivalent to Windows applications that bundle their own dependencies so long as you have a working kernel (and Linus doesn't break userspace). As far as that goes. Which is all I am saying, really. You seem to be discussing a couple different points lumped together. And they seem to be OSX > Windows & linux Not Windows & OSX > linux Last edited by eschwartz; 11-15-2015 at 03:19 PM. |
|||
![]() |
![]() |
![]() |
#8 |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,633
Karma: 29710510
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Posts 78-85 have very little to do with Sigil, epubs or the editing thereof.
How about tacking them onto the back of that other Off Topic thread the Sigil mods recently created BR |
![]() |
![]() |
![]() |
#9 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Sounds eminently reasonable.
|
![]() |
![]() |
![]() |
#10 | ||||||||||
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,485
Karma: 5703586
Join Date: Nov 2009
Device: many
|
Quote:
Quote:
Quote:
Quote:
google El Captian System Integrity Protection Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Take care, KevinH |
||||||||||
![]() |
![]() |
![]() |
#11 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 977
Karma: 2209358
Join Date: Nov 2011
Location: London, UK
Device: Kobo Aura, Kobo Aura ONE, PocketBook InkPad Color 3
|
Would linking the Linux binaries using -R $ORIGIN/../path/to/my/libraries be a reasonable way of making the Linux binaries self-contained and still movable? Users do not need to mess with the dangerous LD_LIBRARY_PATH environment variable...
Caveat: I've only used $ORIGIN on Solaris with the Solaris linker. I don't know if the Linux linker(s) can handle it. Getting '$ORIGIN' as a string through a build system can be entertaining ;-) |
![]() |
![]() |
![]() |
#12 | |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,485
Karma: 5703586
Join Date: Nov 2009
Device: many
|
That is effectively how Mac OS X handles it as well.
Libraries are linked with a full path name and that name can include placeholders like @loader_path for dlopen'd libraries and @executable_path to find the libraries relative to the current locations of the main executable. The nice thing is that there is a simple command line tool "otool" that will allow you to set the name and path to the libraries post build so you do not need to worry about passing these things along inside the build environment. We use these tricks to make the embedded Python.framework inside of Sigil.app fully relocatable since the Sigil.app itself is full relocatable on Mac OS X. I thought Linux had similar RPATH and name handling capabilities but I am not sure if it works in the same way. KevinH Quote:
|
|
![]() |
![]() |
![]() |
#13 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,359
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
If you're speaking specifically of Sigil, then "users" don't have to mess with the LD_LIBARY_PATH right now. Only packagers and knowledgeable tweakers might. In fact, in the current sigil, modifying LD_LIBRARY_PATH is unnecessary for a normal build/install (I leave it in to give me options for post-installalation diddling/repackaging). Cmake already takes care of modifying the rpath with the location of the necessary external libs (specified at build-time). The main purpose of the launch script right now, is for the setting of other env vars that allow the relocation of Sigil's support files (INSTALL_PREFIX/share/sigil), and for specifying alternative hunspell dictionaries, and for informing the Python plugin interpreter (system or bundled) where libhunspell is located so plugin devs can utilize our built-in ctypes interface to it.
|
![]() |
![]() |
![]() |
#14 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,198
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Linux also supports that, and even has a tool to easily change it called chrpath. However, I find that LD_LIBRARY_PATH works great. Just a couple of things you have to keep in mind about it:
1) When running subprocesses from outside your application bundle, remember to remove the directory you added from LD_LIBRARY_PATH in the environment the subprocess gets. For instance, when calling Code:
QDesktopServices::openURL 2) Instead of writing a bash script to launch your executable, use a little C program instead, its faster and effectively shuts up the whining from distro maintainers ![]() @KevinH: the problem in OS X is with application bundles installed with the DMG installer that have both a gui and command line tools. There is no way to install command line tools into the PATH at install time, since you can run no scripts at install time. And even on first run it cannot be done because the user account running the GUI typically does not have permission to write to the directories on PATH like /usr/bin So that means you either have to use the OS X authorization API to run a helper program as root to install the command line utils or leave it up to the user. |
![]() |
![]() |
![]() |
#15 | ||||
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Quote:
![]() And I genuinely don't know much about OSX, possibly there is some way of installing an Application bundle that also does the necessary post-install setup for complex offerings? For calibre, it is still heavily recommended to use the standalone binaries, so I had to write my own system service for triggering updates (manually or automatically). I also ported it to OSX, although I can't really test it I have been told it works as expected. On OSX, it symlinks the CLI tools, running as root, after mounting the DMG and copying the application bundle. Quote:
Sandboxing, containerization seem to be separate issues, of general security. Although also good things to have. ![]() Drag-and-drop install is just a method, one-click installers should not be fundamentally more challenging to the Linux Desktop. DEBs and RPMs I believe can already prompt you to install them, and you can put a standalone /opt -contained application in it, but of course the main issue is multiple competing standards. Quote:
There has to be some sort of consistent way of figuring out what opens what and which applications are available. ![]() Linux doesn't have a registry, per-application desktop files are the metadata that says which applications do what, and and there are curated lists of mimetypes ("shared-mime-info"). The mime database reads all those and caches the information, and actually throws it all away and recreates it from scratch IIRC every time a package post-install scriptlet triggers the update-{mime,desktop}-database command. It's similar to the way system logs are plain text files, and why systemd bothers so many people. Quote:
![]() "I would love to be able use Linux on the Desktop in some sane way that did not require me to basically become my own maintainer." Until that gets solved, we will probably just see a few things, available specifically against "whatever the current stable version of Ubuntu is". For Windows, the Windows Store is trying to solve this, but I like the look of Chocolatey myself. So does Microsoft, they modeled OneGet after it. And of course OSX curates applications and tools through homebrew/cask. Last edited by eschwartz; 11-16-2015 at 11:16 AM. |
||||
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Windows vs Linux Metadata Summary Lacking in Linux | TGPB | Library Management | 5 | 04-10-2014 10:56 AM |
New reader for Mac (and Windows, Linux) | richard37 | Reading and Management | 8 | 10-01-2009 10:50 PM |