-
Notifications
You must be signed in to change notification settings - Fork 226
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
Option to exclude or ignore specific artifacts #503
Comments
Thanks for the report. I'd like to understand your use-case a little better. You explicitly don't want to build the binary usually and use a feature to disable building it?
I am hesitant with implementing a heuristic to determine if compilation succeeded. Compilation should be ideally all-or-nothing.
Something like |
Yes. The project only needs the library. The binary contains some additional stuff that's only interesting for development purposes. The binary can run as a standalone GUI application while the library depends on Rustler. I guess I could abstract the Rustler code from the library to another binary, but then the same problem will remain as Rustler tries to assert the existence of all possible artifacts. This is my first project in Rust, so I'm still new to how the build system works. I run the binary inside IntelliJ and all I know is that when I'm compiling my Elixir project it only tries to compile the library. I use required features to include some dependencies in the binary while excluding them from the library.
That should do the trick yeah. However, the latter might be too restrictive for other projects. |
First of all, thank you for creating Rustler! I really enjoy using it.
I have a Cargo.toml that looks something like this:
I use the lib artifact in my Elixir code, and I use the bin artifact to debug the lib with some GUI stuff that's not needed in the lib artifact (prevents fetching and compiling unneeded dependencies).
Once it has successfully compiled, Rustler tries to copy all artifacts:
This is not desired because I only need the lib, which has successfully compiled.
Instead, my build failed because not every artifact was compiled.
Related Rustler code:
https://github.com/rusterlium/rustler/blob/rustler-0.26.0/rustler_mix/lib/rustler/compiler.ex#L178
https://github.com/rusterlium/rustler/blob/rustler-0.26.0/rustler_mix/lib/rustler/compiler.ex#L197
My personal preference would go to a solution like this: Continue to try to copy all possible artifacts, but give a warning instead of halting the Rustler compile process when a specific artifact doesn't exist (but maybe require at least one artifact per package?).
I'm also ok with a solution that allows people to exclude/include specific artifacts.
The text was updated successfully, but these errors were encountered: