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

Fix build with RabbitMQ master and 3.8.x #10

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

dumbbell
Copy link

Two changes are required for that:

  1. An update to rabbitmq-components.mk to have the correct fetch method for ra
  2. Getting rid of direct uses of the #internal_user{} record because it was made private.

.... to get values from the #internal_user{} record. The reason is the
record was made private and opaque to allow it to change without
breaking the API/ABI.
@simmel
Copy link
Owner

simmel commented Oct 17, 2020

Thank you so much for the PR!

Can't get it to build though, but I'm probably doing something wrong:

onrain:~/code/rabbitmq-auth-backend-kerberosᛘremotes/origin/pr/10$ make
 DEP    rabbit_common (origin/pr/10)
 DEP    rabbit (origin/pr/10)
make[1]: Entering directory '/home/simmel/code/rabbitmq-auth-backend-kerberos/deps/rabbit_common'
 DEP    rabbitmq_codegen (origin/pr/10)
 DEP    lager (3.8.0)
No beam files found.
escript: exception error: undefined function make:files/2
  in function  erl_eval:do_apply/6 (erl_eval.erl, line 680)
  in call from erl_eval:expr/5 (erl_eval.erl, line 273)
  in call from escript:eval_exprs/5 (escript.erl, line 872)
  in call from erl_eval:local_func/6 (erl_eval.erl, line 567)
  in call from escript:interpret/4 (escript.erl, line 788)
  in call from escript:start/1 (escript.erl, line 277)
  in call from init:start_em/1
/home/simmel/code/rabbitmq-auth-backend-kerberos/deps/rabbit_common
{"init terminating in do_boot",{undef,[{rmemo,start,[],[]},{erl_eval,do_apply,6,[{file,"erl_eval.erl"},{line,680}]},{erl_eval,exprs,5,[{file,"erl_eval.erl"},{line,126}]},{init,start_it,1,[]},{init,start_em,1,[]},{init,do_boot,3,[]}]}}
init terminating in do_boot ({undef,[{rmemo,start,[],[]},{erl_eval,do_apply,6,[{_},{_}]},{erl_eval,exprs,5,[{_},{_}]},{init,start_it,1,[]},{init,start_em,1,[]},{init,do_boot,3,[]}]})

Crash dump is being written to: erl_crash.dump...done
 DEP    jsx (2.11.0)
{"init terminating in do_boot",{undef,[{rmemo,start,[],[]},{erl_eval,do_apply,6,[{file,"erl_eval.erl"},{line,680}]},{erl_eval,exprs,5,[{file,"erl_eval.erl"},{line,126}]},{init,start_it,1,[]},{init,start_em,1,[]},{init,do_boot,3,[]}]}}
init terminating in do_boot ({undef,[{rmemo,start,[],[]},{erl_eval,do_apply,6,[{_},{_}]},{erl_eval,exprs,5,[{_},{_}]},{init,start_it,1,[]},{init,start_em,1,[]},{init,do_boot,3,[]}]})

Crash dump is being written to: erl_crash.dump...done
 DEP    ranch (1.7.1)
 DEP    recon (2.5.1)
{"init terminating in do_boot",{undef,[{rmemo,start,[],[]},{erl_eval,do_apply,6,[{file,"erl_eval.erl"},{line,680}]},{erl_eval,exprs,5,[{file,"erl_eval.erl"},{line,126}]},{init,start_it,1,[]},{init,start_em,1,[]},{init,do_boot,3,[]}]}}
init terminating in do_boot ({undef,[{rmemo,start,[],[]},{erl_eval,do_apply,6,[{_},{_}]},{erl_eval,exprs,5,[{_},{_}]},{init,start_it,1,[]},{init,start_em,1,[]},{init,do_boot,3,[]}]})

Crash dump is being written to: erl_crash.dump...done
 DEP    credentials_obfuscation (2.2.0)
{"init terminating in do_boot",{undef,[{rmemo,start,[],[]},{erl_eval,do_apply,6,[{file,"erl_eval.erl"},{line,680}]},{erl_eval,exprs,5,[{file,"erl_eval.erl"},{line,126}]},{init,start_it,1,[]},{init,start_em,1,[]},{init,do_boot,3,[]}]}}
init terminating in do_boot ({undef,[{rmemo,start,[],[]},{erl_eval,do_apply,6,[{_},{_}]},{erl_eval,exprs,5,[{_},{_}]},{init,start_it,1,[]},{init,start_em,1,[]},{init,do_boot,3,[]}]})

Crash dump is being written to: erl_crash.dump...done
make[2]: Entering directory '/home/simmel/code/rabbitmq-auth-backend-kerberos/deps/rabbitmq_codegen'
make[2]: Leaving directory '/home/simmel/code/rabbitmq-auth-backend-kerberos/deps/rabbitmq_codegen'
Error: No Makefile to build dependency /home/simmel/code/rabbitmq-auth-backend-kerberos/deps/lager.
make[1]: *** [erlang.mk:4512: deps] Error 2
make[1]: Leaving directory '/home/simmel/code/rabbitmq-auth-backend-kerberos/deps/rabbit_common'
make: *** [erlang.mk:4512: deps] Error 2
onrain:~/code/rabbitmq-auth-backend-kerberosᛘremotes/origin/pr/10$ !2!

@simmel
Copy link
Owner

simmel commented Oct 17, 2020

Uh, scratch that, I'm just bad at following instructions! I'll report back.

@simmel
Copy link
Owner

simmel commented Oct 17, 2020

What are your thoughts of specifying dependency_version_requirements?

@dumbbell
Copy link
Author

Crap, I see the internal_user module didn't make it to a 3.8.x release yet... So with my patch, the plugin is not compatible with any release of RabbitMQ for now. Let me talk to the developer who worked on the change to #internal_user{}.

@dumbbell
Copy link
Author

The new API was backported to the 3.8.x release branch, so it will be part of the next release. The plugin could advertise compatibility with RabbitMQ 3.8.10.

Unfortunately, the way it was backported makes it impossible to have the same plugin compatible with 3.8.10+ and previous releases.

@simmel
Copy link
Owner

simmel commented Oct 20, 2020 via email

@dumbbell
Copy link
Author

I believe the plugin with this branch, but without the 3rd commit, will work with RabbitMQ 3.8.0 to 3.8.9 included.

With the 3rd commit in this branch, it is only compatible with 3.8.10.

The internal_user API was poorly backported to the 3.8.x branch, and it's impossible to have the same codebase compatible with all versions of RabbitMQ.

@simmel
Copy link
Owner

simmel commented Oct 20, 2020 via email

@simmel
Copy link
Owner

simmel commented Dec 8, 2020

Sorry for lagging with this PR @dumbbell, it's been a hectic autumn. Do you know how I can build a plugin towards a specific version of RabbitMQ? I searched make help but didn't see anything and nor did the docs I could find.

@dumbbell
Copy link
Author

There is no documented way, but a good solution is to use the current_rmq_ref on the command line:

make current_rmq_ref=v3.8.9 dist

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 this pull request may close these issues.

2 participants