We were using System.otp_release() as a part of a cache-key in our build system, and a patch version of an OTP release introduced an ssl handshake bug in a few of our applications. Once we pinned down the problem, and cleared our build cache, we realized we should have been using the full otp version as the cache key, instead of just the major release.
Existing behaviour:
Note that System.otp_release() just calls :erlang.system_info(:system_version) which only returns "25" because "The exact OTP version in the general case is difficult to determine" source
Current workarounds:
The current OTP version can be found using the method here.
And this workaround can already be found among the community:
Solution:
The proposal is to add a better function that can return the full otp version, somewhere in the core library.
Here are a few example APIs that do not have any breaking changes, but the final result doesn't have to be one of these:
Example api with options seen in the Version module:
# Return major version (existing behaviour)Example api with options seen in Date, DateTime, modules:
Example api returning a %Version{} struct instead of a string:
Version implements String.Chars so it's pretty easy to get the string this way. This one is probably my favorite, but it means System.version() and System.otp_version() would have different call signatures, which may not be very ergonomic.
# Return major version (existing behaviour)--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/fd52d094-cbcc-4b2a-9939-41774274c159n%40googlegroups.com.