grame-cncm / faustservice

Other
3 stars 6 forks source link

Modify the faustservice to facilitate building self-extracting installers (resubmit) #11

Closed bassmanitram closed 2 months ago

bassmanitram commented 2 months ago

[redo of #10] This PR maybe a bit radical - but I think it has merit!

It adds another Makefile target name - at the moment this is installer.sh but that is fairly specific to shell scripts - perhaps just installer would be better?

Anyway the idea is that the Makefile produces something executable that the developer only has to run in order to "go further".

The PR includes the addition of the makeself package to the docker image in which the faust service runs. Makeself allows you to create an executable shell script that "runs stuff" - i.e. an installer. The use-case is, of course, the Chaos Audio Effect installer - this is currently a standard binary.zip which the user must manually unzip and then execute a script within.

Having an installer<.sh> target would allow for a smoother experience for this kind of use case.

Dynamic target lookup

The /precompile resource of the server set the target name to binary.zip. This PR allows the makefile to declare what target should be used for binary builds. The proposed method is a standard-optional "first line" of the makefile of the following form:

#FaustBinaryTarget: <name-of-target>

Obviously the default for this will be binary.zip meaning that only special cases need to use this feature. And <name-of-target> must still be a supported name - not just a random name.

For the Stratus use case, the makefile would have

#FaustBinaryTarget: installer.sh

(with the current naming proposals).

At commit 3eec380 this scheme works for generating the binary artifact (both default case and special case) but does not yet work for downloading. To do that the /precompile must communicate back to the UI the URL of the built target, and the UI must take that into account.

Communicating back the URL of the build target

The HTTP Location header is the canonical means of telling a client where the result of some piece of work is located.

Commit e2bddc2 does exactly that with very little fuss. Now all we need to do is make the client use it - that is the subject of this FaustIDE PR

bassmanitram commented 2 months ago

Arghghgh - I hate linear histories!