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
Start copying commands from opam files #8336
Start copying commands from opam files #8336
Conversation
0664d72
to
172569a
Compare
Updated to use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. A few more tests (with more forms) would be useful, but they can always be added later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have some small comments about this but overall I think its good and moving to the right direction. Good chances that even without resolving of the package variables this is enough to cover 80% of all OPAM packages.
Note that long-term we probably won't be able to use
Even though opam treats the first term of a command as the program and subsequent terms as arguments, filtering takes place before determining which term is first, so the program can be determined dynamically based on filters. In dune this filtering must happen at build time rather than solve time in order for single lockdirs to support multiple environments. I think we'll need a new construct to handle filters on terms. This doesn't affect this PR. Just an observation. |
172569a
to
138ebd1
Compare
src/dune_pkg/opam_solver.ml
Outdated
error messages without quotes. *) | ||
User_error.raise | ||
[ Pp.textf | ||
"Encountered unknown variable \"%s\" while processing commands for \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be %S
for automatic quoting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
woah surprising, in C it's for strings of wide characters right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure it is standard, I can only find %S
in Microsoft reference documents, not sure it also applies to POSIX.
Very early implementation of copying build and install commands from opam files into lockfiles meant to invite feedback on the general design of this feature before going deeper. Not yet supported: - filters on commands or arguments - string interpolation in commands - package-scoped variables other than `_` (the current package) - executing the actions Not all opam variables are supported yet. Signed-off-by: Stephen Sherratt <stephen@sherra.tt>
138ebd1
to
e7f8c96
Compare
Very early implementation of copying build and install commands from opam files into lockfiles meant to invite feedback on the general design of this feature before going deeper. Not yet supported: - filters on commands or arguments - string interpolation in commands - package-scoped variables other than `_` (the current package) - executing the actions Not all opam variables are supported yet. Signed-off-by: Stephen Sherratt <stephen@sherra.tt> Signed-off-by: Diana Kalinichenko <dkalinichenko@janestreet.com>
Very early implementation of copying build and install commands from opam files into lockfiles meant to invite feedback on the general design of this feature before going deeper.
Not yet supported:
_
(the current package)Not all opam variables are supported yet.