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 fails on OTP 19.0 #860

Closed
michaelklishin opened this issue Jun 26, 2016 · 8 comments
Closed

Compilation fails on OTP 19.0 #860

michaelklishin opened this issue Jun 26, 2016 · 8 comments
Assignees
Milestone

Comments

@michaelklishin
Copy link
Member

michaelklishin commented Jun 26, 2016

There are two issues:

  • Uses of the (now removed) legacy type spec syntax
  • random is now deprecated. rand, however, is not a 100% drop-in replacement and is only available in OTP 18.0+.

For example:

src/file_handle_cache.erl:247: syntax error before: '/'
src/file_handle_cache.erl:248: syntax error before: '/'
src/file_handle_cache.erl:253: syntax error before: '/'
src/file_handle_cache.erl:258: syntax error before: '/'
src/file_handle_cache.erl:259: syntax error before: '/'
src/file_handle_cache.erl:261: syntax error before: '/'
src/file_handle_cache.erl:262: syntax error before: '/'
src/file_handle_cache.erl:263: syntax error before: '/'
src/file_handle_cache.erl:264: syntax error before: '/'
src/file_handle_cache.erl:265: syntax error before: '/'
src/file_handle_cache.erl:266: syntax error before: '/'
src/file_handle_cache.erl:267: syntax error before: '/'
src/file_handle_cache.erl:268: syntax error before: '/'
src/file_handle_cache.erl:270: syntax error before: '/'
src/file_handle_cache.erl:271: syntax error before: '/'
src/file_handle_cache.erl:272: syntax error before: '/'
src/file_handle_cache.erl:273: syntax error before: '/'
src/file_handle_cache.erl:274: syntax error before: '/'
src/file_handle_cache.erl:275: syntax error before: '/'
src/file_handle_cache.erl:276: syntax error before: '/'
src/file_handle_cache.erl:277: syntax error before: '/'
src/file_handle_cache.erl:278: syntax error before: '/'
src/file_handle_cache.erl:279: syntax error before: '/'
src/file_handle_cache.erl:280: syntax error before: '/'
src/file_handle_cache.erl:281: syntax error before: '/'
src/file_handle_cache.erl:282: syntax error before: '/'
src/file_handle_cache.erl:283: syntax error before: '/'
src/file_handle_cache.erl:284: syntax error before: '/'
src/file_handle_cache.erl:285: syntax error before: '/'
src/file_handle_cache.erl:286: syntax error before: '/'
src/file_handle_cache.erl:239: type ref() is unused
src/file_handle_cache.erl:240: type ok_or_error() is unused
src/file_handle_cache.erl:241: type val_or_error(_) is unused
src/file_handle_cache.erl:242: type position() is unused
src/file_handle_cache.erl:245: type offset() is unused
@michaelklishin
Copy link
Member Author

The rand module is only available in 18.0+. That's painful.

@michaelklishin
Copy link
Member Author

No random:seed functions are used on the hot path so we can introduce a shim module, e.g. rabbit_rand. I don't think we should put in the effort comparable to time_compat and ssl_compat in this case.

@michaelklishin
Copy link
Member Author

Actually, now that we have an internal module that does hot swapping for _compat modules, maybe we should do the same thing for rand.

@michaelklishin michaelklishin changed the title Compilation fails on OTP 19.0 because of legacy type specs Compilation fails on OTP 19.0 Jun 26, 2016
@michaelklishin michaelklishin modified the milestones: 3.6.4, 3.6.3 Jun 26, 2016
@jj1bdx
Copy link

jj1bdx commented Jun 27, 2016

If you have compatibility issues, you can use exsplus116 here: https://github.com/jj1bdx/exsplus116

@michaelklishin
Copy link
Member Author

@jj1bdx thank you. Is it supposed to be a drop-in replacement for rand?

@jj1bdx
Copy link

jj1bdx commented Jun 27, 2016

@michaelklishin Same algorithm, does not use anything specific for 18.0 or later.

dumbbell added a commit to rabbitmq/rabbitmq-common that referenced this issue Jun 28, 2016
The old format is removed in Erlang 19.0, leading to build errors.

Also, get rid of the `use_specs` macro and thus always define -spec() &
friends.

While here, unnify the style of -type and -spec.

References rabbitmq/rabbitmq-server#860.
[#118562897]
[#122335241]
dumbbell added a commit to rabbitmq/rabbitmq-common that referenced this issue Jun 28, 2016
Not all `rand` functions are implemented because there is no equivalent
in `random`.

References rabbitmq/rabbitmq-server#860.
[#122335241]
dumbbell added a commit that referenced this issue Jun 28, 2016
The old format is removed in Erlang 19.0, leading to build errors.

Also, get rid of the `use_specs` macro and thus always define -spec() &
friends.

While here, unnify the style of -type and -spec.

References #860.
[#118562897]
[#122335241]
dumbbell added a commit that referenced this issue Jun 28, 2016
@michaelklishin michaelklishin modified the milestones: 3.6.3, 3.6.4 Jun 28, 2016
@michaelklishin
Copy link
Member Author

Fixed in stable, needs merging into master.

dumbbell added a commit to rabbitmq/rabbitmq-common that referenced this issue Jun 29, 2016
dumbbell added a commit to rabbitmq/rabbitmq-common that referenced this issue Jun 29, 2016
dumbbell added a commit to rabbitmq/rabbitmq-common that referenced this issue Jun 29, 2016
The old format is removed in Erlang 19.0, leading to build errors.

Also, get rid of the `use_specs` macro and thus always define -spec() &
friends.

While here, unnify the style of -type and -spec.

References rabbitmq/rabbitmq-server#860.
[#118562897]
[#122335241]
dumbbell added a commit that referenced this issue Jun 29, 2016
dumbbell added a commit to rabbitmq/rabbitmq-erlang-client that referenced this issue Jun 29, 2016
The old format is removed in Erlang 19.0, leading to build errors.

Also, get rid of the `use_specs` macro and thus always define -spec() &
friends.

While here, unnify the style of -type and -spec.

References rabbitmq/rabbitmq-server#860.
[#118562897]
[#122335241]
dumbbell added a commit to rabbitmq/rabbitmq-erlang-client that referenced this issue Jun 29, 2016
dumbbell added a commit to rabbitmq/rabbitmq-delayed-message-exchange that referenced this issue Jun 29, 2016
The old format is removed in Erlang 19.0, leading to build errors.

Also, get rid of the `use_specs` macro and thus always define -spec() &
friends.

While here, unnify the style of -type and -spec.

References rabbitmq/rabbitmq-server#860.
[#118562897]
[#122335241]
dumbbell added a commit to rabbitmq/rabbitmq-federation that referenced this issue Jun 29, 2016
dumbbell added a commit to rabbitmq/rabbitmq-federation that referenced this issue Jun 29, 2016
dumbbell added a commit to rabbitmq/rabbitmq-management that referenced this issue Jun 29, 2016
dumbbell added a commit to rabbitmq/rabbitmq-management that referenced this issue Jun 29, 2016
dumbbell added a commit to rabbitmq/rabbitmq-mqtt that referenced this issue Jun 29, 2016
The old format is removed in Erlang 19.0, leading to build errors.

Also, get rid of the `use_specs` macro and thus always define -spec() &
friends.

While here, unnify the style of -type and -spec.

References rabbitmq/rabbitmq-server#860.
[#118562897]
[#122335241]
dumbbell added a commit to rabbitmq/rabbitmq-rtopic-exchange that referenced this issue Jun 29, 2016
dumbbell added a commit to rabbitmq/rabbitmq-sharding that referenced this issue Jun 29, 2016
dumbbell added a commit to rabbitmq/rabbitmq-sharding that referenced this issue Jun 29, 2016
dumbbell added a commit to rabbitmq/rabbitmq-shovel that referenced this issue Jun 29, 2016
dumbbell added a commit to rabbitmq/rabbitmq-stomp that referenced this issue Jun 29, 2016
The old format is removed in Erlang 19.0, leading to build errors.

Also, get rid of the `use_specs` macro and thus always define -spec() &
friends.

While here, unnify the style of -type and -spec.

References rabbitmq/rabbitmq-server#860.
[#118562897]
[#122335241]
@dumbbell
Copy link
Member

All repositories pulled by the Umbrella which were using the old -spec format and/or random are fixed.

dumbbell added a commit to rabbitmq/rabbitmq-consistent-hash-exchange that referenced this issue Jun 30, 2016
dumbbell added a commit that referenced this issue Jun 30, 2016
erszcz pushed a commit to erszcz/credit_flow that referenced this issue Sep 6, 2018
The old format is removed in Erlang 19.0, leading to build errors.

Also, get rid of the `use_specs` macro and thus always define -spec() &
friends.

While here, unnify the style of -type and -spec.

References rabbitmq/rabbitmq-server#860.
[#118562897]
[#122335241]
dcorbacho pushed a commit that referenced this issue Nov 18, 2020
Add missing queue arguments for stream and quorum queues
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants