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

store platform & arch information next to installed binary #48

Open
2 tasks
derhuerst opened this issue May 19, 2020 · 3 comments
Open
2 tasks

store platform & arch information next to installed binary #48

derhuerst opened this issue May 19, 2020 · 3 comments

Comments

@derhuerst
Copy link
Collaborator

#35 made clear that, in a cross-platform-packaging project using ffmpeg-static as a dependency, a second npm install should install an ffmpeg binary for a different platform/arch than before.

To enable this, install.js needs to

  1. write the platform & arch next to the binary (e.g. to ffmpeg.json).
  2. check if there's a ffmpeg.json in place, with a different platform/arch than desired. If platform & arch are equal, it can exit successfully.
@snobu
Copy link

snobu commented May 21, 2021

I would suggest a naming convention for the ffmpeg binary rather than additional metadata file.

@derhuerst
Copy link
Collaborator Author

True, that would work as well. We could follow the Go or Rust binary naming scheme here.

@terribleplan
Copy link

The benefits I see with something like an ffmpeg.json or similar is that it:

  1. Allows for for never having to list the directory and have conditional code for the platform as long is it is not changed between build/install time and runtime. (Store "filename": "ffmpeg.exe" to make windows just work). Else you would have to list the dir, see what is in it, find something that starts with "ffmpeg-", detect platform and arch by splitting on "-", figure out what to do if there are multiple, etc...
  2. Allows for drift detection. (Store "hash": "sha256 of the file", allows for detecting if something has gotten weird/been modified/etc) Could be an interesting future feature, at least debugging tool somewhat.

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