-
Notifications
You must be signed in to change notification settings - Fork 23
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
appup compile generates "git" into the generated appup file #35
Comments
you mean
This is weird because |
Maybe I'm wrong, but as we have
in our rebar.config release calls first compile, and because of the post rule appup compile is called after compiling. , because TopVsn comes from the generated appup file where it contains 'git', and that won't match TopApp#application.vsn. I was trying to figure out the reason why this is not correctly set in rebar. If it helps I will try to create a similar application. |
One more thing we have found:
instead of an exact version number. The .app file already contains the version number correctly after the compile in the generated .app.src. If I change {vsn, git} in the .app.src file to a version string, we don't have this problem anymore. |
It looks like even though
generates the .app file with the correct vsn, in appup compile still the vsn coming from the app.src files are used:
So SourceAppInfo is basically the contents of the .app.src file, but AppInfo already contains the contents of the generated .app file with the correct Vsn. I've created a PR which just passes the orinal_vsn coming from #rebar_state{} to the template function. |
Unfortunately I have not noticed in relapp.appup.src the first two lines:
With those two lines added to our .appup.src the correct version is used. The problem was that with earlier versions of the plugin the versioning worked without these two lines, so actually it can still be a problem for other users. What do you think do we need this bugfix (maybe it is not a bug this way)? If you want it, I can create a test for it. |
so, on relapp1, if i delete ´relapp.appup.src´ and change the vsn tuple to |
I've pushed some commits to my local repo containing the needed changes to reproduce the same problem. So basically if the project is not umbrella, and the first lines setting the vsn in the .appup.src are missing, and semver is used for relx in rebar.config the string "git" will be stored in the generated .appup file after calling "rebar3 compile" which calls "rebar3 appup compile". The commits are here: |
nice, thanks for that, i'll dig into it soon |
when calling appup release, which calls appup compile on one of our applications it generates
{"git", UpgradeInstructions, DowngradeInstructions} instead of putting the correct version number there. The version number comes from this line:
rebar3_appup_plugin/src/rebar3_appup_compile.erl
Line 123 in c9fae0f
It gives back an atom 'git' instead of the version.
so basically there is a bad version number coming from the rebar state.
I also see that during earlier when rebar_app_info:original_vsn/2 is called the Vsn still stores the correct value, but right after that this atom comes out from the state. I can't see who sets it.
Can it be a rebar bug, or maybe in this case the plugin should read this information from somewhere else?
The text was updated successfully, but these errors were encountered: