Skip to content
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

A way to specify externals and versions and have them downloaded #176

Open
chr15m opened this issue Feb 11, 2018 · 8 comments
Open

A way to specify externals and versions and have them downloaded #176

chr15m opened this issue Feb 11, 2018 · 8 comments

Comments

@chr15m
Copy link
Contributor

chr15m commented Feb 11, 2018

Related: #92 #93 #94

Use-case: a person distributing a patch wants the end user of the patch to be able to quickly and easily get the right set of external dependencies to run the patch.

Design sketch:

  • New menu item under "Find externals" -> "Install dependencies".
  • Menu item appears if current patch (window) has a file externals.txt in the folder where it is saved.
  • Format of the externals.txt file copies prior art: Javascript's package.json, Python's requirements.txt, and Ruby's Gemfile.
  • When the menu item is selected the deken plugin searches for and tries to install the first search hit of each line in the file. [search would need to be amended to allow for version-targeted searching]
  • By default installs to the folder where the patch itself resides with the option to install to the Pd-wide default. This is so the end user can install the dependencies of a patch without messing up their system externals.
  • Example of externals.txt file format:
freeverb~ v1.2.3
creb
zexy v2.2.6
@umlaeute
Copy link
Contributor

one problem: the user already has zexy v2.3 installed. deken has no notion of the current state, so it might

  • downgrade the library
  • install multiple different versions of the same library

@chr15m
Copy link
Contributor Author

chr15m commented Feb 13, 2018

Yep that's a tough problem. I think if this mechanism confines itself to the patch-local folder only then it could avoid the issue for the most part.

When I think about the situations where somebody would use this functionality patch-local-folder install seems like the best default. For the most part I expect it would be: "I've downloaded this patch from the internet and it has a bunch of dependencies. I want to try it out but I don't want to mess up my carefully curated Pd externals collection."

So it would behave the same as node_modules or Python virtualenv in that respect.

@umlaeute
Copy link
Contributor

umlaeute commented Oct 19, 2020

btw, this is implemented in the cmdline tool:

$ cat <<EOF >requirements.txt
zexy==2.2.5
iemguts>=0.3
creb
EOF
$ deken -v install --no-verify -r requirements.txt --installdir .
  • there's currently a bug that will prevent the installation of unversioned libraries (creb) if there are versioned libraries present (zexy==2.2.5, iemguts>=0.3)
  • this issue is (of course) mainly about getting this functionality in the GUI-plugin!

@chr15m
Copy link
Contributor Author

chr15m commented Oct 19, 2020

Wow that looks cool!

@umlaeute
Copy link
Contributor

and it's been there since about ba853a3 ...

@mxa
Copy link

mxa commented Jan 12, 2022

Instead of an externals.txt it could also just parse the pd patch for [declare -lib/-path]. Example: You open MAIN.pd and (there are errors 'could not create object' when opening), then deken would ask if you want to install the declared libs freeverb, creb and zexy and reload the patch.

@umlaeute
Copy link
Contributor

umlaeute commented Jan 13, 2022

the plan is slightly different:

  • prerequisite: you can search for libraries and/or objects
  • clicking on the "could not create" error-message in the Pd-console, will open up the deken search dialog, with the missing object name already filled in (and the proper search mode selected)

the above part is pretty easy (and is already present in pure-data's feature/dekenception branch).

the problems start with extracting missing libraries from [declare] (as the [declare] object itself doesn't do any loading in the general case).
also, a binary that cannot be loaded by [declare -lib] does not necessarily mean that all things are broken anyhow (see pure-data/pure-data#281).


i would not want to (re)install all required libraries with a simple click: currently re-installing a deken package means, that a folder is wiped from the harddisk, which can have very undesired side-effects.

@umlaeute
Copy link
Contributor

i've finally opened a PR against Pd to enable this pure-data/pure-data#1547

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants