product-os / flowzone

Reusable, opinionated, zero-conf workflows for GitHub actions
https://flowzone.pages.dev
Apache License 2.0
15 stars 5 forks source link

Some method for specifying npm install system dependencies #201

Closed Page- closed 2 years ago

Page- commented 2 years ago

eg using a native module which requires dbus requires that dbus is installed in the environment in order for npm ci to work

ab77 commented 2 years ago

https://github.com/product-os/flowzone/pull/203

... look for package.txt and pipe it to apt-get install -y

ab77 commented 2 years ago

@pipex @cywang117 @Page- do we still need this or is this adequate?

cywang117 commented 2 years ago

@ab77 The preinstall script for the Supervisor specifically works. The case may be different for repos that use Flowzone in general though. @klutchell has a vision for Flowzone last time I opened an issue here so I'm curious what he thinks.

klutchell commented 2 years ago

I like @ab77's solution in #203 but it's even better if we don't need it. As far as I can tell, npm is the only project type that might require a pre-install of some kind and it already supports it natively via package.json?

I would think that docker(-compose) and balena packages would never have local dependencies. So maybe we shelf the package.txt solution until we find a need for it?

ab77 commented 2 years ago

npm is the only project type

If we support Python, there may be system dependencies as well prior to running pip install -r ...

Page- commented 2 years ago

This can be handled by #216 using a flowzone-preinstall script in package.json

Page- commented 2 years ago

For reference a standard preinstall script does not work on npm 7+ because the preinstall script happens after dependencies are installed, which kind of scuppers things if the dependency is what requires the native module