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

bug: vsn replacement with file syntax in app.src from rebar is not applied #933

Closed
benoitc opened this issue Jun 24, 2021 · 2 comments
Closed

Comments

@benoitc
Copy link
Contributor

benoitc commented Jun 24, 2021

rebar3 allows a new way to replace the version in the app.src file by the content of another file. The vsn value is set to {file, "<NAMEOFFILE>"} where the content is replaced at compile time by the content of the file <NAMEOFFILE>. Exeple with the opentelemetry_ap application?.

The app.src is:

{application,opentelemetry_api,
             [{description,"OpenTelemetry API"},
              {vsn,{file,"VERSION"}},
              {registered,[]},
              {applications,[kernel,stdlib]},
              {env,[]},
              {modules,[]},
              {licenses,["Apache-2.0"]},
              {links,[{"GitHub",
                       "https://github.com/open-telemetry/opentelemetry-erlang-api"}]}]}.

The .app file should be:

{application,opentelemetry_api,
             [{description,"OpenTelemetry API"},
              {vsn,"1.0.0-rc.2"},
              {registered,[]},
              {applications,[kernel,stdlib]},
              {env,[]},
              {modules, ['opentelemetry','otel_baggage','otel_ctx','otel_propagator','otel_p
ropagator_http_b3','otel_propagator_http_w3c','otel_span','otel_tracer','otel_tracer_noop','
otel_tracer_provider']},
              {licenses,["Apache-2.0"]},
              {links,[{"GitHub",
                       "https://github.com/open-telemetry/opentelemetry-erlang-api"}]}]}.

But with erlang.mk the vsn is still {file,"VERSION"} after the compilation.

@lhoguin
Copy link

lhoguin commented Jun 24, 2021

Thanks. In the meantime you may use a patch as we discussed. Here's an example Makefile doing an autopatch (in this case it creates a file in the dep's directory, you'll want to do the patch command instead):

PROJECT = z
PROJECT_DESCRIPTION = New project
PROJECT_VERSION = 0.1.0

DEPS = opentelemetry_api
dep_opentelemetry_api = git-subfolder https://github.com/open-telemetry/opentelemetry-erlang main apps/opentelemetry_api

include erlang.mk

autopatch-opentelemetry_api::
	touch $(DEPS_DIR)/opentelemetry_api/HELLO

You need to put the autopatch target after the include.

@essen
Copy link
Member

essen commented May 16, 2023

opentelemetry_api no longer uses {file, ...} so I'll be closing this. Should anyone find another project that uses it I will fix it. Thanks!

@essen essen closed this as completed May 16, 2023
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

3 participants