test: variables of undefined packages#13465
Merged
Alizter merged 1 commit intoocaml:mainfrom Jan 27, 2026
Merged
Conversation
Signed-off-by: Ali Caglayan <alizter@gmail.com>
7c4bcbc to
70810f8
Compare
This was referenced Jan 27, 2026
Alizter
added a commit
that referenced
this pull request
Jan 28, 2026
This test isn't testing the correct thing in the end, so I wish to revert and try again. Reverts #13465
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
At the moment we have two kinds of undefined package variable.
We raise the same error on both of these at the moment, but these two cases are actually distinct. The second should really be an error, but according to opam semantics the first should evaluate to the empty string, at least in string interpolation.
An example of where this comes up in the wild is here:
https://github.com/dra27/opam-repository/blob/b4c092154b06471b3ed5886716ff45e4e8f58c17/packages/ocaml/ocaml.5.5.0/opam#L38
The
%{dkml-base-compiler:version}%variable's package doesn't exist unless the correct opam repository is available. Therefore in most cases opam evaluates this to the empty string.This test demonstrates that we error on this behaviour and a future fix should make it evaluate to the empty string.
Part of the work on