Skip to content
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

Crash release when Erlang.mk project has dependency builded and use SemVer VSN #993

Open
vkatsuba opened this issue Dec 23, 2023 · 2 comments

Comments

@vkatsuba
Copy link

When Erlang.mk encounters a dependency on a rebar3 project that utilizes Semantic Versioning (SemVer) in its vsn (version) during the release-making process, an issue arises. The problem occurs because when Erlang.mk identifies a SemVer, the tag is not properly inserted into the application list, resulting in a structure like:

{cowboy, "2.10.0"}
{my_semver_deps}
...

This leads to a crash during the make rel operation. The documentation for git and SemVer, as outlined in http://rebar3.org/docs/basic_usage/#adding-dependencies, provides relevant information on handling dependencies with SemVer in rebar3 projects. I didn't check - but I suppose same issue can be when used atom git in vsn. To reproduce this issue the rebar3 project should have in *.spp.src:

{application, my_semver_deps, [
    {vsn, semver},
    ....
]}.

And in rebar.config:

{relx, [
             {release, {my_semver_deps, semver }, [my_semver_deps]},
	     ....
]}.
@vkatsuba
Copy link
Author

vkatsuba commented Dec 23, 2023

Maybe can be added something like:

# Get the name of the latest tag
tag=$(git describe --tags --abbrev=0)

# Extract SemVer from the tag
semver=$(echo "$tag" | grep -oP 'v?\K\d+\.\d+\.\d+')

# Print the extracted SemVer
echo "SemVer: $semver"

SemVer: 1.0.1

To https://github.com/ninenines/erlang.mk/blob/master/plugins/relx.mk#L59 - https://github.com/ninenines/erlang.mk/blob/master/plugins/relx.mk#L74 or maybe can be find better approach.

@essen
Copy link
Member

essen commented Dec 24, 2023

Should be done during autopatch around here https://github.com/ninenines/erlang.mk/blob/master/core/deps.mk#L450-L457

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants