basho / riak-erlang-client

The Riak client for Erlang.
Apache License 2.0
311 stars 189 forks source link

Problem with Hex package causing endless rebuilds due to wrong app version settings #382

Open nickelization opened 5 years ago

nickelization commented 5 years ago

The develop branch has the vsn setting in riakc.app.src set to git, and so this has been inherited by the packages on hex.pm. The problem with this is that when you specify riakc as a dependency in another project, the Hex package gets downloaded and the source code gets built, and since the contents of the Hex package is not a Git repo, the Git commands to get the current package version end up searching up the directory tree for a .git directory and find one in the parent project instead. Thus, in a project where the latest tag is, say, 0.3.2, the riakc.app file will get build with that version instead of the version of the riakc package (which is currently 2.5.3 for the most recent package available on hex.pm).

This doesn't cause any issues with functionality that I've encountered, but it does lead to some annoying behavior from rebar3, where it constantly thinks the riakc package is outdated and needs to be upgraded; every time I run a rebar3 command, it ends up decompressing and rebuilding the whole package from scratch all over again, which adds a bit of unnecessary delay to my day-to-day work.

I believe the correct fix for this is to simply update riakc.app.src to include the current project version directly, instead of setting it to git like we do now. This solution is slightly annoying in that it requires us to correctly maintain the vsn setting by hand for future releases, but this does seem to be the approach that most other Erlang projects take, so I think this is probably the best way forward.

I don't know who owns access rights to the source code for this project anymore; I used to have membership in the Basho org but it was suddenly revoked a few months ago, perhaps because I have not been particularly active in any of the projects recently, though I'm not really sure of the reasons. Anyway, if the current maintainers agree, I can go ahead and create a PR for this change. I've also spoken to @lukebakken who is the current publisher of this package on hex.pm, and he said he doesn't have access to change the source code anymore, but that he'd be happy to hand over ownership of the Hex package to whomever would be appropriate.

nickelization commented 5 years ago

I've noticed same issue also exists in the riak_pb project, which gets pulled in as a dependency of this project. If switching the config to directly specify the version string is approved as a fix for this project, I'll also look at making a similar change over there.