chewbranca opened a new issue #617: CouchDB won't build on OTP-20 URL: https://github.com/apache/couchdb/issues/617 <!--- Provide a general summary of the issue in the Title above --> While doing a fresh CouchDB build on OTP-20 I ran into blocking issues with the removal of the deprecated `crypto:rand_bytes/1` function. This function was deprecated in [1] in the OTP-19 release and has now been completely removed in OTP-20 with [2]. You can see in [1] that there is an alternative function `crypto:strong_rand_bytes/1` that is now being used in Erlang. I don't know the nuances of that change well enough to conclude whether this would be appropriate for us to use. It does appear that the current incarnation of `crypto:strong_rand_bytes/1` has been in since OTP-17 [3], and an earlier version even further. We currently used `crypto:rand_bytes` in a number of modules, and even in 3rd party deps like Mochiweb: ``` $ grep -r crypto:rand_bytes src/ src//b64url/test/benchmark.escript: Data = crypto:rand_bytes(Size), src//chttpd/src/chttpd.erl: Nonce = couch_util:to_hex(crypto:rand_bytes(5)), src//couch/src/couch_uuids.erl: list_to_binary(couch_util:to_hex(crypto:rand_bytes(16))). src//couch/src/couch_uuids.erl: utc_suffix(couch_util:to_hex(crypto:rand_bytes(9))). src//couch/src/couch_uuids.erl: couch_util:to_hex((crypto:rand_bytes(13))). src//couch/test/couch_work_queue_tests.erl: Item = crypto:rand_bytes(Size), src//couch/test/couchdb_views_tests.erl: {<<"value">>, base64:encode(crypto:rand_bytes(1000))} src//couch_replicator/test/couch_replicator_large_atts_tests.erl: {data, fun(Count) -> crypto:rand_bytes(Count) end} src//couch_replicator/test/couch_replicator_many_leaves_tests.erl: AttData = crypto:rand_bytes(100), src//couch_replicator/test/couch_replicator_missing_stubs_tests.erl: AttData = crypto:rand_bytes(6000), src//couch_replicator/test/couch_replicator_missing_stubs_tests.erl: body = {[{<<"value">>, base64:encode(crypto:rand_bytes(100))}]} src//ddoc_cache/src/ddoc_cache_util.erl: to_hex(crypto:rand_bytes(16), []). src//mochiweb/src/mochiweb_multipart.erl: mochihex:to_hex(crypto:rand_bytes(8))). src//mochiweb/src/mochiweb_session.erl: IV = crypto:rand_bytes(16), src//mochiweb/src/mochiweb_session.erl: IV = crypto:rand_bytes(16), src//mochiweb/test/mochiweb_tests.erl: Body = crypto:rand_bytes(Size), src//oauth/src/oauth.erl: Nonce = base64:encode_to_string(crypto:rand_bytes(32)), % cf. ruby-oauth src//snappy/README.md:18> Large = base64:encode(crypto:rand_bytes(100 * 1024)). ``` In the ticket title I've intentionally left `crypto:rand_bytes` out as I have not verified this is the only deprecated function preventing CouchDB from building on OTP-20. [1] https://github.com/erlang/otp/commit/1ad18832cb21fac5a5b513005f1e6a5ffd7d0329 [2] https://github.com/erlang/otp/commit/a30254355bc9798348471878009b6e063ad26fca [3] https://github.com/erlang/otp/commit/973c10a2d139eae7d276802cd19a30f8d1a24189 ## Expected Behavior Expect to be able to compile CouchDB on OTP-20. ## Current Behavior Cannot compile CouchDB on OTP-20. ## Possible Solution Remove all uses of removed deprecated functions. ## Steps to Reproduce (for bugs) 1. Build OTP-20 2. Use OTP-20 to compile CouchDB 3. See explosions 4. fix it? ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
With regards, Apache Git Services
