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

Support rebar3 profile overlay var in relx library #1254

Closed
lrascao opened this issue Jul 3, 2016 · 8 comments
Closed

Support rebar3 profile overlay var in relx library #1254

lrascao opened this issue Jul 3, 2016 · 8 comments
Labels
dependency issue resides in a rebar3 dependency enhancement new behaviour or additional functionality

Comments

@lrascao
Copy link
Contributor

lrascao commented Jul 3, 2016

Relx defines a bunch of builtin overlay vars that are pretty useful (most notably {{release_version}}), it would be pretty cool if it could know about rebar3 metadata as well, for example what profile is being built, sometimes there’s the need to copy build artifacts to the release so a {{profile}} builtin overlay var would be really helpful

@ferd ferd added the enhancement new behaviour or additional functionality label Jul 4, 2016
@ferd ferd added the dependency issue resides in a rebar3 dependency label Dec 7, 2017
@g-andrade
Copy link
Contributor

Is this somewhere on the roadmap?

@ferd
Copy link
Collaborator

ferd commented Aug 6, 2019

Not to any degree bigger than any of the other issues here or in the relx repo. There's more work than there's time for all the maintainers involved.

If you're interested in adding support, let us know and we can see how we could provide guidance.

@g-andrade
Copy link
Contributor

g-andrade commented Aug 15, 2019

I investigated a bit; I had long forgotten that more than one profile can be in use. What do you think would be good semantics for such cases?

For the build directory (rebar_dir:base_dir/1), I see that the different profile names are concatenated (e.g. _build/profile1+profile2). So perhaps the base name of that path could be passed along to relx and exposed as an overlay var?

But it would be strange to call it {{profile}}. {{profiles}} would be a better fit, but then it's not very intuitive how multiple profiles would meld together into a single string (and whether their relative order should matter.)

Alternatively, the new overlay var could be called something along the lines of {{build_dir_name}}, which would be fully precise and correct, but much less discoverable as people will be looking for a profile-thing instead, and might miss what's in front of their eyes.

For now I won't proceed any further as I'm not sure what's the best solution here.

@ferd
Copy link
Collaborator

ferd commented Aug 15, 2019

The relative order of profiles does matter in the general case. Merging a+b+c may give a different resulting configuration than c+b+a, specifically in the case where the same values exist in multiple profiles and the later profile dominates. The default profile is also always there but omitted in the path string.

It makes sense to have the values fit what we do for paths, in which case {{profile_string}} might be the best option?

@g-andrade
Copy link
Contributor

[...] in which case {{profile_string}} might be the best option?

Perfect! I'll give a go at a PR with the changes.

@g-andrade
Copy link
Contributor

PR opened in relx in order to make this possible.

@g-andrade
Copy link
Contributor

PR opened.

@g-andrade
Copy link
Contributor

g-andrade commented Oct 4, 2019

I suppose this issue can now be closed :)

@ferd ferd closed this as completed Oct 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependency issue resides in a rebar3 dependency enhancement new behaviour or additional functionality
Projects
None yet
Development

No branches or pull requests

3 participants