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

Compilation failed on Erlang 19 #28

Closed
iamd3vil opened this issue Jul 1, 2016 · 18 comments
Closed

Compilation failed on Erlang 19 #28

iamd3vil opened this issue Jul 1, 2016 · 18 comments

Comments

@iamd3vil
Copy link

iamd3vil commented Jul 1, 2016

Hello,

I upgraded to Erlang 19 and Elixir 1.3.1 and I get a compilation error. I believe the problem is with amqp_client and if you want me to file a bug there I will do it. The traceback is as follows:

$ iex -S mix
Erlang/OTP 19 [erts-8.0] [source] [64-bit] [smp:4:4] [async-threads:10] [kernel-poll:false]

==> amqp_client (compile)
include/amqp_gen_consumer_spec.hrl:30: syntax error before: '/'
include/amqp_gen_consumer_spec.hrl:31: syntax error before: '/'
include/amqp_gen_consumer_spec.hrl:32: syntax error before: '/'
include/amqp_gen_consumer_spec.hrl:34: syntax error before: '/'
include/amqp_gen_consumer_spec.hrl:35: syntax error before: '/'
include/amqp_gen_consumer_spec.hrl:36: syntax error before: '/'
include/amqp_gen_consumer_spec.hrl:37: syntax error before: '/'
include/amqp_gen_consumer_spec.hrl:38: syntax error before: '/'
include/amqp_gen_consumer_spec.hrl:39: syntax error before: '/'
include/amqp_gen_consumer_spec.hrl:42: syntax error before: '/'
include/amqp_gen_consumer_spec.hrl:30: syntax error before: '/'
include/amqp_gen_consumer_spec.hrl:31: syntax error before: '/'
include/amqp_gen_consumer_spec.hrl:32: syntax error before: '/'
include/amqp_gen_consumer_spec.hrl:34: syntax error before: '/'
include/amqp_gen_consumer_spec.hrl:35: syntax error before: '/'
include/amqp_gen_consumer_spec.hrl:36: syntax error before: '/'
include/amqp_gen_consumer_spec.hrl:37: syntax error before: '/'
include/amqp_gen_consumer_spec.hrl:38: syntax error before: '/'
include/amqp_gen_consumer_spec.hrl:39: syntax error before: '/'
include/amqp_gen_consumer_spec.hrl:42: syntax error before: '/'
Compiling src/amqp_selective_consumer.erl failed:
ERROR: compile failed while processing /home/iamd3vil/projects/strategies/deps/amqp_client: rebar_abort

This is on Ubuntu 14.04.

Let me know if you want to know anything else.

@iamd3vil
Copy link
Author

iamd3vil commented Jul 1, 2016

This is actually fixed in jbrisbin/amqp_client#30

Including amqp_client from master does the job.

@michaelklishin
Copy link

This is the same issue as rabbitmq/rabbitmq-server#860.

@kelostrada
Copy link

for anyone having this problem - until they include it into hex, you can add this to your deps (before amqp) to fix it:
{:amqp_client, git: "https://github.com/dsrosario/amqp_client.git", branch: "erlang_otp_19", override: true}

@whitfin
Copy link

whitfin commented Oct 25, 2016

@pma are you able to publish the latest to Hex, I see you're the owner of amqp_client.

Any chance of this happening? This library is forcing us to stay on OTP 18 and causing several compatibility issues (I am not comfortable pointing to a branch which may be removed at any time).

@max-vogler
Copy link

@zackehh: Same problem here. Both, linking to a branch and not being able to control the specific version made us choose a git commit hash instead. Maybe this helps you.

{:amqp_client, github: "jbrisbin/amqp_client", ref: "d50aec0", override: true},

@whitfin
Copy link

whitfin commented Oct 26, 2016

@max-vogler it's more than that though; the repo could go away at any time :p

@mendrugory
Copy link

Hi guys,

In order to avoid that, I have cloned the repo, so now I use my own (cloned) repo until the Erlang compatibility is fixed. I am not going to delete it, so you can use it with no concerns.

@whitfin
Copy link

whitfin commented Nov 4, 2016

And, as if I'm psychic:

zackehh:~/GitHub/project$ mix deps.get
* Updating amqp_client (https://github.com/jbrisbin/amqp_client.git)
* Updating rabbit_common (https://github.com/jbrisbin/rabbit_common.git)
fatal: You are on a branch yet to be born
** (Mix) Command "git --git-dir=.git checkout --quiet " failed

Can no longer use the workaround because of rabbit_common :) Have to point at forks now, which is just ridiculous considering package managers exist.

@Nezteb
Copy link

Nezteb commented Nov 7, 2016

I too was forced to fork both repos myself and put this in my deps:

defp deps do
  [
    {:rabbit_common, git: "https://github.com/Nezteb/rabbit_common.git", override: true},
    {:amqp_client, git: "https://github.com/Nezteb/amqp_client.git", override: true},
    {:amqp, "~> 0.1.4"},
  ]
end

Then everything works. Not ideal, but meh.

@whitfin
Copy link

whitfin commented Nov 14, 2016

Even more annoying now, you can no longer put packages on Hex which have a Git dependency.

@sotte
Copy link

sotte commented Dec 9, 2016

I also had this problem, but using the solution of @kelostrada (I think, can't find the project anymore) solved the problem for me. But it's not working anymore.

Trying out all the proposed ways I get the following errors.

Using the default suggested in the README {:amqp, "~> 0.1.4"},
I also get the syntax error befor: '/'

Using @kelostrada solution I get

src/rabbit_ct_client_helpers.erl:19: can't find include lib "common_test/include/ct.hrl"
Compiled src/amqp_connection_sup.erl
src/rabbit_ct_client_helpers.erl:65: undefined macro 'config/2'
src/rabbit_ct_client_helpers.erl:101: undefined macro 'config/2'
src/rabbit_ct_client_helpers.erl:61: function stop_channels_manager/1 undefined
src/rabbit_ct_client_helpers.erl:72: function open_conn/2 undefined
src/rabbit_ct_client_helpers.erl:76: function open_conn/2 undefined
Compiling src/rabbit_ct_client_helpers.erl failed:
src/rabbit_ct_client_helpers.erl:19: can't find include lib "common_test/include/ct.hrl"
src/rabbit_ct_client_helpers.erl:65: undefined macro 'config/2'
src/rabbit_ct_client_helpers.erl:101: undefined macro 'config/2'
src/rabbit_ct_client_helpers.erl:61: function stop_channels_manager/1 undefined
src/rabbit_ct_client_helpers.erl:72: function open_conn/2 undefined
src/rabbit_ct_client_helpers.erl:76: function open_conn/2 undefined
ERROR: compile failed while processing /home/stefan/prjs/rabbitmq_experiments/deps/amqp_client: rebar_abort

** (Mix) Could not compile dependency :amqp_client, "/home/stefan/.mix/rebar compile skip_deps=true deps_dir="/home/stefan/prjs/rabbitmq_experiments/_build/dev/lib"" command failed. You can recompile this dependency with "mix deps.compile amqp_client", update it with "mix deps.update amqp_client" or clean it with "mix deps.clean amqp_client"

Same for the solution of @max-vogler.

The solution of @Nezteb gives me:

src/rabbit_net.erl:27: can't find include lib "ssl/src/ssl_api.hrl"
...
Compiling src/rabbit_net.erl failed:
...

I'm using

Erlang/OTP 19 [erts-8.0] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]
Elixir 1.3.1

@pma it would be great if you can have a look.

@pma
Copy link
Owner

pma commented Dec 9, 2016

@sotte You can override the two deps of amqp to point to versions compatible with Erlang 19:

defp deps do
    [{:amqp, "~> 0.1.4"},
     {:amqp_client, github: "jbrisbin/amqp_client", override: true},
     {:rabbit_common, github: "jbrisbin/rabbit_common", override: true}]
  end

This compiles in Erlang/OTP 19 [erts-8.1] with only some warnings about the random module being deprecated.

The SSL issue could be something else. You may have an incomplete Erlang/OTP installation and miss some SSL related lib.

@sotte
Copy link

sotte commented Dec 9, 2016

@pma you're right. An OS update broke some erlang dependencies. After reinstalling erlang und using the deps you specified it seems to work again. Thanks!

@blatyo
Copy link

blatyo commented Dec 13, 2016

I built a fork of this project and pushed it to hex.pm today, because I couldn't use git or an override. Hopefully this stuff will get fixed soon, but until then, hopefully this helps:

https://hex.pm/packages/amqp19

It uses an amqp_client package I also pushed today.

@blatyo
Copy link

blatyo commented Dec 13, 2016

BTW, in order to be able to push it, but have it be a drop in replacement, the package and app name are different. You can use it like so:

{:amqp, "~> 0.1", hex: :amqp19}

@0x6e6562
Copy link

0x6e6562 commented Feb 1, 2017

Thanks @blatyo, this patch seems to fix the issue. I wonder if this is going to get ported back into master?

@blatyo
Copy link

blatyo commented Feb 1, 2017

My fork is depending on forked version of other libraries as well. The RabbitMQ team has taken ownership of rabbit_common and amqp_client and will be releasing new versions in the future. They've releases a prerelease version so far. Once they go stable, I'll deprecate all of the forks I made. At that point, it should just be a matter of updating the library dependencies for this project.

@ono
Copy link
Collaborator

ono commented Feb 8, 2017

We have just merged #51 and now amqp supports OTP 19 ✌️

Please change the version of amqp to 0.2.0-pre.1 and run mix deps.update amqp && mix deps.get (you need to run mix deps.get to get rabbit_common).

I hope all are sorted now but let us know if you experience any issues.

@ono ono closed this as completed Feb 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.