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

[enhancement]: install osDependencies bevore npm install is run #2938

Open
1 task done
Garfonso opened this issue Oct 10, 2024 · 4 comments
Open
1 task done

[enhancement]: install osDependencies bevore npm install is run #2938

Garfonso opened this issue Oct 10, 2024 · 4 comments
Labels
enhancement ⬆️ refinement 🔍 Needs refinement with core developers

Comments

@Garfonso
Copy link
Contributor

No existing issues.

  • There is no existing issue for my request.

Description

Currently osDependencies from io-package.json are only installed after a successufl npm installation of the adapter.

I want to propose to change that (or add another option) in order to install dependencies before running npm install.

Why?

If packages are installed before npm install this would help to support packages that require certain libraries to be successfully build. One example is the rpi2 adapter (after version 2.0.0). It depends on a gpio-librarie that needs to build a module which required libgpiod-dev to be installed, otherwise the headers are not found.
The librarie is not usually installed on all systems. Adding libgpiod-dev to osDependencies did not help here, because npm installation already fails.

How?

Currently osDependencies are installed in "finishUpdate" or "finishInstallation" after npm insallation. The info from io-package.json of the new adapter version seems to be extracted from the repository already (in order to check the version, for example). So osDependencies could be extracted from that information and be installed before the npm step.

Since it seems that we never uninstall system packages anyway, it would not be necessary to fear a failed npm installation, currently.

@mcm1957
Copy link
Contributor

mcm1957 commented Oct 10, 2024

Note that the repository does not conatin the io-package.json bundled with the to-be-installed release but the version located at Github master/main head. This is sufficient for displaying new but is definitly not useable to install some software as requirements between to-be-installed release (aka npm package) and github head might differ significantly.

@foxriver76 foxriver76 added the refinement 🔍 Needs refinement with core developers label Oct 10, 2024
@foxriver76
Copy link
Collaborator

We will talk about this and yes especially Martins point is valid, however this might be a tradeoff we will take as also done e.g. for stopBeforeUpdate flag - maybe we find better solutions.

@mcm1957
Copy link
Contributor

mcm1957 commented Oct 10, 2024

Taking the flags and i.e. requiring a newer admin / js-controller thean really required is an acceptable restiction.

But keep in mind that release 1.x.x of an adapter might require os-dependency aaa while the current head either removed the dependency or requires bbb. Both would suddenly break installation of release 1.x.x without releasing a new version or something like that. In addion this would be hard to diagnose for maintainer why the installation suddenly requires a wrong dependency.

In my oppinion either the currect content of io-package bound to the release must be used - or this problem / feature cannot be solved at least now.

@Garfonso
Copy link
Contributor Author

Samuel mentioned jsdelivr in the Telegram Chat: https://www.jsdelivr.com/documentation which can be used to read any file from any package version and even can install packages from github. Example: https://cdn.jsdelivr.net/npm/[email protected]/io-package.json

Just wanted to add it here so that it is not lost. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ⬆️ refinement 🔍 Needs refinement with core developers
Projects
None yet
Development

No branches or pull requests

3 participants