-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Distributing quarks with binary components #7
base: main
Are you sure you want to change the base?
Conversation
So while I intended to mainly discuss implementation details for a source-based distribution of Quarks containing plugins that require building, feedback from sc-dev said that binary distributing would be preferable. If we go the binary route, I agree that github releases are a great way to do it. Perhaps my preference for automatically building from source comes from working with linux- installing a build system that works is just a one-liner in the shell and is very standardized and reliable, while having to setup something like homebrew on OSX just to get quarks would suck. I'll check out how the ruby folks did it for something like nokogiri, an Ruby SSL package that compiles. In any case, another thing to keep in mind is that linux has many, many different combinations of processor architecture, word length and executable format. Perhaps the pragmatic choice is to ship binaries for OSX and Windows, and allow linux users to autobuild. There is nothing more frustrating as to be an arch user and you have to do a manual build from source because the packages are only for ubuntu and redhat. Further, source build would also support the likes of FreeBSD, raspberry pi and the Bela. Now I've got pretty good sclang knowledge so I can expand the Quark system in whatever way we decide, but I don't really have the skills to set up and maintain a CI system for the quarks, however that does seem to be the most quark-developer friendly option. I suspect that if we have quark developers build on their own box, getting cross-platform support would require every developer setting up a transpiling toolchain to OSX, Windows and Linux, which seems unreasonable to me, so we would likely get a lot of single-OS quarks. I think we should go to considerable lengths to avoid that. |
There are some basic requirements that the quarks system needs in order to make something like this feasible. Here's the list of things off the top of my head, but there may be more - these should be incorporated somehow, as I don't think a binary system will work without them?
This is all I can think of at the moment - anyone else have thoughts here? |
One possible strategy to ease the engineering load here... Basically platforms have at least one package manager that can already pull dependencies, build them or install binaries, manage versions etc... What if the binary distribution part of this was simply handled by the proper OS package manager, plus a Quarks PPA / tap that we maintain? This would mean quark owners would only need to specify e.g. a brew formula to get their quark working - for things like server plugins, this would be total boilerplate and easily copy-paste-able from a template. This feels easier than making quark maintainers write separate build scripts for every platform, and more reliable because the package manager can take care of a lot of the heavy lifting of e.g. build toolchains, other dependencies, etc. Then, a quark file could have something like:
|
I think it was already discussed on sc-dev with Christof (I haven't really looked into it), but it would be worth mentioning that one should probably look into the externals management of Pure Data ("Deken"). |
Done. The Deken downloader is a TCL script that does approximately what Quark.gui does. The Deken packager is made up of a shell script, a python script, and a script in hy, a lisp-syntax for python. The shell and python scripts do some argument wrangling while the hy script does the heavy lifting, which consists of scanning a compiled library and deriving architecture, OS version, and executable format, and then packing it into a zip file with a name to that extent, e.g. osmething like myExternal-x86_64-darwin4-macho.zip or myExternal-armv6-linux-ELI5.zip, and uploads it to their package repository. That's it. The actual build process is intended to be done on each target machine individually using a boilerplate Makefile. |
My personal role model for quarks are Ruby Gems, which are like Quarks for ruby, because they pioneered the package script idea, they are a mature system with excellent usability and code quality, and because sclang has a tradition of borrowing from Ruby since the very beginning. So I investigated Nokogiri as a stand-in for all binary Gems, which is one of the most popular ruby packages, which depends on compiling a ruby binary extension that depends on libxml and libxslt, two C-language XML libraries. This is a good role model because it is so widely used, and because it distributes a binary library that also depends on an existing C library, so it covers all use cases. So it turns out that Nokogiri agrees with Christof, Brian and Luke for Windows insofar as it distributes a binary library and does not attempt to perform a build on the target system by default, but that is still available as an advanced option. However, for OSX, Nokogiri depends on installing the XCode command line tools, an install of which can be triggered with a single command. For various flavors of Linux, a package called build-essential or similar can also be installed with a single command, or via familiar GUI. So I would like to use this to reiterate that building on target systems does not have to mean difficulty for the user at all, at least on unix-based systems such as OSX and Linux. Further, helpful error messages or even help installing dependencies could be displayed with a simple command-line availability check, just like it is done with git. The benefits are quite simply that it is much, much easier to maintain a binary repository for a single system instead of three, and that full cross-platform compatibility can be achieved this way with the least possible amount of effort, resulting in a much richer ecosystem across platforms. |
That's a cool idea to leverage existing systems! My experience attempting to install python packages from the linux package manager together with packages installed by pip, a python package manager, indicates that what you are proposing is actually a much more difficult technical problem than extending Quarks to support binary, because three different systems and their packages must be integrated with Quarks. I would therefore prefer to require packages to supply their own dependencies as source, perhaps optionally linking to whatever system packages are present.
My prototype Quark.build already reads the version number from sclang to download the right SC headers for bulding, what I had in mind is that a switch is detected and a notification to run Quarks.updateAll (or something) is run. Thinking about it more, we should probably just put all binary quarks in version specific directories so you can use the same install based on various SC versions with no conflict.
A way to specify downloadable (e.g. non Git based) dependencies
Same same- that doesn't exist yet? Weird. |
We discussed this on the developer call today. A couple topics came up:
please edit this comment if there's anything i forgot to add! |
agree with brian, i think this is a really important direction to go in. we need to think bigger about the large-scale implications. some rhetorical questions for us to consider:
|
Thanks for the great summary, Brian, and thanks again to everyone for the cool discussion on the call.
Also agree with Nathan's input! Let me just put out what I've got so far on your questions:
|
I updated the RFC to reflect the state of discussion after the developer call to reflect the requirement of non-root user installation, and hence of binary distribution. Please comment as you see fit! |
@capocasa - do you feel like this is now at a stage for consideration to work on for 3.12? |
@joshpar Yeah, I think it is! |
No description provided.