-
Notifications
You must be signed in to change notification settings - Fork 49
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
Application name conflict between Erlang and Elixir implementations #73
Comments
Elixir application could be defined as something like: modules = Application.spec(:aws, :modules)
for module <- modules do
name =
module
|> Atom.to_string()
|> String.slice(4..-1)
|> String.split("_")
|> Enum.map(&String.capitalize/1)
# Here we probably should replace some parts with all uppercase names,
# for example `Ec2` should probably be available as `EC2`.
module_name = Module.concat(["AWS" | name])
defmodule module_name do
# Here we just delegate all exported functions from `module` in new module
for {func_name, arity} <- module.module_info(:exports),
func_name not in ~w[module_info]a
do
# With EEP 48 we probably could make arguments name more clear than
# generated gibberish
args = Macro.generate_arguments(arity, __MODULE__)
# We lose the documentation there a little, but with EEP 48 we probably would be able
# to retain all documentation as-is
defdelegate unquote(func_name)(unquote_splicing(args)), to: module
end
end
end Alternative is to generate modules that will just pass calls to the Erlang modules in |
Hey @hauleth 👋 I think for now we should go with the first option, which is to rename the applications to the name of the project. |
This is needed to avoid conflicts with aws-erlang's application name. It solves aws-beam/aws-codegen#73
One of my motivations for creating separate libraries was that I wanted it to be easy for people to jump into the code and read it, to find out what it's doing. That's also why the code generator tries to generate code that is pretty to humans (though passing that code through a code formatter like |
This is needed to avoid conflicts with aws-erlang's application name. It solves aws-beam/aws-codegen#73
I'm afraid we have to revert the commit that renames I don't think this is necessary. Instead, we could just rename the application name of our @jkakar @robertoaloi what do you think? |
@philss I think that the ultimate goal would be to merge these two projects into hybrid like |
I don't have a problem with the |
Spring cleaning is good they say :-) I discussed this briefly with a colleague and also with @hauleth on Slack who re-raised this issue. I'll take a look at opentelemetry_api over the coming weeks or so and see how we could use this. I'll update this issue and ping the necessary people when we get to that stage. I'm guessing it would have to mean a new package called |
Right now both of the implementations use
aws
as an application name, which may conflict if there will be need to include both of them in a single project (for example as a transitive dependency).Possible solutions:
opentelemetry_api
)The text was updated successfully, but these errors were encountered: