-
Notifications
You must be signed in to change notification settings - Fork 521
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
rebar_git_resource may produce incorrect versions #2235
Comments
There may be a better git way of doing this as well now. I don't remember why we even use that line instead of just |
It there are no objections, I'd be happy to remove regex, and the whole call to It's rather slow and does not seem to help much. Also I can't find any documentation on how {vsn, git} is supposed to work. Also, I found one example of even more exotic case: https://github.com/tomas-abrahamsson/gpb/blob/master/src/gpb.app.src#L24 |
Yeah that's a supported format: Lines 742 to 743 in 8ff256d
I'm fine more or less getting rid of the slow line ( |
rebar supports {vsn, git} in myapp.app.src file, which is converted into actual version here:
https://github.com/erlang/rebar3/blob/master/src/rebar_git_resource.erl#L345-L355
However it is possible that git tag is not myapp-1.2.3. It is also possible that git tag contains directory separators. Hence https://github.com/erlang/rebar3/blob/master/src/rebar_git_resource.erl#L338 produces something exotic, for example:
063ecc4f (tag: myrepo/myapp/063eca9) Commit message 3
a3a268c1 (tag: myrepo/myapp/a3a26ae) Commit message 2
76543210 (tag: myrepo/myapp/1234567) Commit message 1
This will generate myapp.app file containing {vsn, "myrepo/myapp/063eca9"} - with slashes in application version. Then, relx will generate a release with sub-folders myrepo/myapp, and a single directory 063eca9 containing actual app.
There are at least 3 possible fixes to this:
Out of these 3, last one looks to keep most information available. Are there any more options?
The text was updated successfully, but these errors were encountered: