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

Expand variable interpolations in build-env #5352

Merged
merged 4 commits into from
Jan 23, 2023
Merged

Conversation

dra27
Copy link
Member

@dra27 dra27 commented Nov 15, 2022

Variable interpolations (%{lib}%, etc.) are expanded in setenv but weren't expanded in build-env.

I'd be willing to regard this as having been a bug, and don't expect that we'll find any instances of build-env being used where %{foo}% was supposed to be treated as a literal string (with this PR, such strange usage should now be written %%{foo}%%).

@kit-ty-kate
Copy link
Member

What would be the backward compatibility story with this change? Could we maybe detect that the package contains available: opam-version >= "2.2" when build-env contains variables?

@dra27
Copy link
Member Author

dra27 commented Nov 15, 2022

Hah, I was just preparing a long justification for why breaking backwards compatibility might be OK... but then I discovered that this is actually fixing a 1.2.2 -> 2.0 regression! build-env in OPAM 1.2.2 not only expanded variables, but the feature is also in use (and presently broken, therefore) in opam-repository - see sibylfs-lem.0.4.0!

Copy link
Collaborator

@rjbou rjbou left a comment

Choose a reason for hiding this comment

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

LGTM, missing api changelog & test

@rjbou rjbou added this to the 2.1.5 milestone Jan 6, 2023
@rjbou rjbou mentioned this pull request Jan 6, 2023
5 tasks
@dra27 dra27 merged commit c7662f4 into ocaml:master Jan 23, 2023
@rjbou rjbou mentioned this pull request Feb 15, 2023
kit-ty-kate pushed a commit to kit-ty-kate/opam that referenced this pull request Feb 17, 2023
Expand variable interpolations in `build-env`
rjbou pushed a commit to kit-ty-kate/opam that referenced this pull request May 12, 2023
Expand variable interpolations in `build-env`
@dra27 dra27 deleted the build-env branch May 23, 2024 21:16
@dra27 dra27 mentioned this pull request Jun 13, 2024
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.

3 participants