-
Notifications
You must be signed in to change notification settings - Fork 18
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
feat: add resource resolver crate #106
feat: add resource resolver crate #106
Conversation
I am not too keen about this tbh because we have to support Node.js (as well as future bindings) and since the implementation is simple enough, it could be layed out as a spec in the documentation and users build their own resolver. cc @lucasfernog-crabnebula |
the implementation isn't that simple due to security risks. I think we should have a crate like this (with bindings too, yay). |
I think we can document the security risks and provide a reference example, also the implementation in the PR requires the app to be built by the packager and depends on feature flags which won't work in the bindings. The alternative would be to pass the format as an argument but I think it is better just provide a reference example. |
What about documenting what env variables need to be set to use this crate (currently
I'm not very familiar with bindings and tauri, can you explain what's causing the problem? |
Even if you set the
They would still need to build the app multiple times using
I am not totally opposed to the point but I am just trying to make sure we cover the needed cases.
The bindings I mentioned are Node.js bindings for the packager and updater which allows usage of these crates in Node.js and Electron environments, which can be found here https://github.com/crabnebula-dev/cargo-packager/tree/main/bindings. |
This seems reasonable, if all formats provide this feature. But it could perhaps cause problems when the program is invoked by command line.
From my pov, this will just move the problem to the user, how will he know what format is in use?
I don't really see this as a problem, because most of the time, the package build step is done during a release. The dev can use |
2eb8936
to
fd16858
Compare
Argument here is an argument to the
We can't know either, there is a better chance the user knows which version he is using.
You can't guarantee that the user will use You don't need to worry about the bindings, I can add them later if you can't |
Oh, I thought you were speaking about cli argument, mb.
Imagine you want to use both deb and rpm (i know rpm is not yet supported), this will not be easy/straitforward.
I don't really understand why the bindings can't work in this case? Isn't the resource-resolver crate be compiled in the same environnement? What about having the main API use an arguments, like you said, and providing a feature (not default), without node.js binding (if it's possible, idk), that provide the
This will allow a user to not use a build.rs file, which can be unintuitive for a beginer, while also having an out of the box solution for resource, for rust app. For the deb implementation, maybe |
For us, we can't really detect the currently installed package format because the user is the one responsible for building their app and so they can embed this metadata while we can't.
it is not the same, because it will be pre-compiled in our CI as a node native addon (NAPI) and be pulled from NPM to users.
I guess that's the only way to it really (however it may fragment the usage a bit). |
Nsis, Deb and cargo run work for me, and idk what's prettier have against me. I'm not sure current_exe will always works for debian tho, maybe taking the app name as an arg is better, but it's will be a shame, since it's the only format that require it. |
@naman-crabnebula - would you mind reviewing the deb process here? |
also looks like a merge from main is needed @wiiznokes |
154e41a
to
25beed3
Compare
I'll take a look at this over the weekend, I love this idea :) |
I didn't tested appImage |
also better error info + auto-detect-formats feature
Co-authored-by: Lucas Nogueira <[email protected]>
Co-authored-by: Lucas Nogueira <[email protected]>
Co-authored-by: Lucas Nogueira <[email protected]>
Co-authored-by: Lucas Nogueira <[email protected]>
Co-authored-by: Lucas Nogueira <[email protected]>
Co-authored-by: Lucas Nogueira <[email protected]>
Co-authored-by: Lucas Nogueira <[email protected]>
…esource seens it can be confusing, and it's not dificult for the user to impl this behavior + AppImage format support
Co-authored-by: Amr Bashir <[email protected]>
ff90f23
to
2e1fa2d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you and sorry for the long delay
b0621fa
to
66139f0
Compare
same as #105 but with separate commits on cargo-packager.
Also, no cargo update has been run this time so let's hope this pass CI 🙏