-
Notifications
You must be signed in to change notification settings - Fork 527
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
SweetXML as hard dependency on 0.4.10? #81
Comments
It's still listed as an optional dependency, let me see what's going on. |
Not entirely sure what's going on there, the line that's erroring for you is inside this if statement https://github.com/CargoSense/ex_aws/blob/master/lib/ex_aws/s3/parsers.ex#L2 which ought to prevent this kind of thing. Will look into it more. |
@benwilson512 imports are lexical, meaning that they are always used regardless of which code path is executed. If you put the Is there a reason for generating a module with stub functions if |
@ericmj so this is weird. Prior to the last release, I had sweet_xml listed as a dev dependency but that was it. While it was merely a development dependency it was entirely possible to have ex_aws as a dep without also having sweet_xml, and would compile. However, after adding it as an optional dependency we now have the above error. What's the best way to achieve what I want here? The use case here is that streaming functions require that you parse the XML so it can handle pagination and build the list of items. However, such functionality isn't necessary if all you're doing is basic get/put object so I want to make it optional. |
The previous configuration of having sweet_xml as a dev dependency was incorrect. Optional and dev work differently so there is no surprise it no longer works. I gave a suggestion for how to fix it in my previous comment:
But to be able to help out more I need to know some information:
|
In answer to your latter question: At the moment I'm doing https://github.com/CargoSense/ex_aws/blob/master/lib/ex_aws/s3/impl.ex#L53 where if you have sweet_xml installed it'll get parsed, otherwise it won't. On reflection, this probably isn't the right call as it's implicit. The streaming code should call it explicitly, and the basic impl call should leave it alone. The upcoming changes will make a nicer line between what should parse by default and what shouldn't. |
The easiest non breaking change it seems however would just be to have two versions of the same module, one inside each branch of the |
If I understand it correctly you will get a pretty obscure error message if SweetXml is not present. Why even generate the stub module? |
Right now every call to list_objects calls Parsers.parse_list_objects. If SweetXML is present, it'll get parsed, if not, it'll just pass the value along. I didn't want to check for the presence of SweetXML at runtime as that would be a lot of avoidable overhead. |
Won't it error if SweetXml is not there anyway? Or is it valid to not parse the response? It feels like you are just going around "fail fast". EDIT: You don't have to check for the presence, just let the runtime raise the normal error. |
It's valid to not parse the response until I've built parsers for every request such that it consistently returns a parsed value. This is contingent upon generating parsers, a step that is in progress. |
Hi Ben,
just updated
ex_aws
dependency on my project from 0.4.8 to 0.4.10 and now get this error on compilation:Has SweetXML become a mandatory dependency?
Thanks!
The text was updated successfully, but these errors were encountered: