Git Product home page Git Product logo

Comments (9)

lrascao avatar lrascao commented on September 24, 2024 1

nice, thanks for that, i'll dig into it soon

from rebar3_appup_plugin.

lrascao avatar lrascao commented on September 24, 2024

when calling appup release, which calls appup compile on one of our applications it generates

you mean appup generate right?

{"git", UpgradeInstructions, DowngradeInstructions} instead of putting the correct version number there.

This is weird because relapp1 also uses git versioning and it works ok, any idea what's different about your project?

from rebar3_appup_plugin.

tothlac avatar tothlac commented on September 24, 2024

Maybe I'm wrong, but as we have

{provider_hooks, [
      {pre, [{tar, {appup, tar}}]},
      {post, [{compile, {appup, compile}},
              {clean, {appup, clean}}]}
  ]}.

in our rebar.config release calls first compile, and because of the post rule appup compile is called after compiling.
When I was debugging it I saw the above mentioned line being executed and there rebar_app_info:original_vsn/2 returns 'git' instead of a string. Because of this problem our build stops in the next step when we call rebar3 relup , in systools_relup:get_script_from_appup/5 on this line:

https://github.com/erlang/otp/blob/a94d94975e06c880e0ceb4eb23b652812fdc1d34/lib/sasl/src/systools_relup.erl#L493

, 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.

from rebar3_appup_plugin.

tothlac avatar tothlac commented on September 24, 2024

One more thing we have found:
The atom git most probably comes from the .app.src of the given dependency. There we use

{vsn, git},

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.

from rebar3_appup_plugin.

tothlac avatar tothlac commented on September 24, 2024

It looks like even though

rebar3 compile

generates the .app file with the correct vsn, in appup compile still the vsn coming from the app.src files are used:

SourceAppInfo = rebar3_appup_utils:find_app_info(Name, State),

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.

#36

from rebar3_appup_plugin.

tothlac avatar tothlac commented on September 24, 2024

Unfortunately I have not noticed in relapp.appup.src the first two lines:

AppInfo = rebar3_appup_utils:find_app_info(<<"relapp">>, STATE),
"{{vsn}}" = rebar_app_info:original_vsn(AppInfo),

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.

from rebar3_appup_plugin.

lrascao avatar lrascao commented on September 24, 2024

so, on relapp1, if i delete ´relapp.appup.src´ and change the vsn tuple to {vsn, git} i should be able to reproduce the error?

from rebar3_appup_plugin.

tothlac avatar tothlac commented on September 24, 2024

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:
https://github.com/tothlac/relapp1/commits/master

from rebar3_appup_plugin.

lrascao avatar lrascao commented on September 24, 2024

i think this is another instance of #24, as @ferd mentioned on it the provider hook functionality works differently when not in an umbrella app context, for some reason git gets replaced in app_info_t in some cases and not in others

from rebar3_appup_plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.