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
pkg: add cond statement for choosing lockdir #9750
Conversation
Opening this PR to get feedback on my approach. If there are no major issues with how this works then I'll add some comments for posterity. |
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.
Seems reasonable to have a mechanism to automatically assign the lockdir.
8be6c22
to
a32b309
Compare
Will hopefully review this tomorrow |
a32b309
to
849e50e
Compare
The implementation of the syntax looks good, but the data used to expand these pforms is suspicious. Using the compiler from the ambient environment to choose the lock directory is likely to cause unexpected behavior. For example, users aren't expected to have a compiler installed at all to use lock directory, and dune should install the compiler for them. Therefore, I suggest that we limit the pforms to whatever is computable without the compiler. See |
849e50e
to
9718646
Compare
I've updated this to implement the pform expander with sys_poll rather than |
5904683
to
7bf021b
Compare
;; | ||
|
||
let os = string_option_config "os" | ||
let arch = string_option_config "arch" |
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 wonder if we should just allow overriding these variables at build rime rather than just during solving. That would replace this config and and would likely be a useful feature in general.
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 should already be the case. The overrides are applied in functions in Sys_poll
such as Sys_poll.os
which are used to compute variables both at solve time and build time.
We expect projects with system-specific packages to include multiple lockdirs - one for each system. This change adds a dsl for selecting the appropriate lockdir for the current system. Signed-off-by: Stephen Sherratt <stephen@sherra.tt>
7bf021b
to
d2ecfc2
Compare
We expect projects with system-specific packages to include multiple lockdirs - one for each system. This change adds a dsl for selecting the appropriate lockdir for the current system.