crabnebula-dev / cargo-packager

Rust executable packager, bundler and updater.
https://docs.crabnebula.dev/packager/
Apache License 2.0
241 stars 16 forks source link

feat: allow Linux dependencies to be specified via a file path #254

Closed kevinaboos closed 3 months ago

kevinaboos commented 3 months ago

This makes it possible to dynamically generate the list of dependencies for Linux Debian and pacman package formats.

Fixed a small documentation bug in PacmanConfig.

Notes

We needed this feature in Project Robius to relieve the app dev from the burdens of:

  1. figuring out which dependencies their app binaries need.
  2. having to keep that list up to date when adding or removing dependencies from their app, which typically is only done at the Rust crate level (rather than the Linux native package/library level).

This changeset has been tested to work for us on Ubuntu LTS 20.04, 22.04, and 24.04, on both aarch64 and x86_64.

Question: I modified the crates/packager/schema.json file by hand -- not sure if that's correct or if it's generated automatically. It appears that bindings/packager/nodejs/schema.json was indeed auto-generated; not sure if that needs to be committed too. Please advise, thanks!

amr-crabnebula commented 3 months ago

Question: I modified the crates/packager/schema.json file by hand -- not sure if that's correct or if it's generated automatically. It appears that bindings/packager/nodejs/schema.json was indeed auto-generated; not sure if that needs to be committed too. Please advise, thanks!

It should be automatically generated if your IDE runs the build script of config-schema-generator crate, if not, you can manually build it using cargo b -p config-schema-generator and it will generate the schemas.

kevinaboos commented 3 months ago

ah sorry, i had forgotten to run rustfmt. Fixed now.

amr-crabnebula commented 3 months ago

Thank you

kevinaboos commented 3 months ago

Thanks! Shall I go ahead and add env var support too?

amr-crabnebula commented 3 months ago

That would be awesome, thanks