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

fix: enabled_if with env variable #10936

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

moyodiallo
Copy link
Collaborator

Fixes #10905.

Copy link
Collaborator

@Leonidas-from-XIV Leonidas-from-XIV left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice to get this fixed!

@@ -29,6 +30,7 @@ let common_vars ~since =
match var with
| "context_name" -> var, (2, 7)
| "arch_sixtyfour" -> var, (3, 11)
| "env" -> var, (1, 14)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this since version 1.14? Given it didn't work before, shouldn't it be 3.17 or as a bugfix to a feature in 3.15 be (3, 15)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is related to env itself. Like context_name start from 2.7.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

surely we need a backport on 3.15 after.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why this is 1.14 either

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad. I've got a misunderstanding here, reading the error message. I was thinking it was specific to the variable itself. The 1.14 is coming from the doc, when env is introduced.

Error: %{env:--} is only available since version <version> of the dune
  language. Please update your dune-project file to have (lang dune <version>).

Sorry @Leonidas-from-XIV you're right.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I add on 3.17.

@@ -53,12 +55,12 @@ let decode_value ~allowed_vars ?(is_error = true) () =
Blang.Ast.decode
~override_decode_bare_literal:None
(String_with_vars.decode_manually (fun env var ->
let name = Dune_lang.Template.Pform.name var in
match Dune_lang.Template.Pform.payload var with
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this pattern match at all?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, there's no need, I'll refactor. I just kept it because it was there before.

Signed-off-by: Alpha DIALLO <moyodiallo@gmail.com>
Signed-off-by: Alpha DIALLO <moyodiallo@gmail.com>
Signed-off-by: Alpha DIALLO <moyodiallo@gmail.com>
Signed-off-by: Alpha DIALLO <moyodiallo@gmail.com>
Signed-off-by: Alpha DIALLO <moyodiallo@gmail.com>
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

Successfully merging this pull request may close these issues.

enabled_if field does not support environment variables on executable stanza
3 participants