-
Notifications
You must be signed in to change notification settings - Fork 238
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
Mirage time defunctorised #1529
base: main
Are you sure you want to change the base?
Conversation
c2ce2a3
to
b5752f5
Compare
| If { cond = _; branches; default } -> | ||
app_has_no_arguments default | ||
|| List.exists (fun (_, branch) -> app_has_no_arguments branch) branches | ||
|
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.
Why is this removal needed? Did the reason why this was added changed with that PR?
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.
From my comment above:
Another remark is about the "no argument check" -- I think this brief hack introduced by myself is not the right thing. We should ensure that main (and other jobs) have at least one argument -- but if we pass in one argument (of ()) for each "device" that doesn't need it, we'll add a lot of things for no good reason (and have again complexity, and it being hard to understand).
--> I think this "app_has_no_argument" check was a good first iteration, but what we actually want to check is that "start takes at least an argument" (to have it executed after a log reporter) -- but already with extra_deps and runtime_args we get arguments. So, indeed this removal is unrelated and should not be merged as is. It would be great to have a better check (esp. since e.g. noop
is already excluded from the check).
I like the direction of that one too. A few comments:
|
Thanks for your feedback. I will do (a) move the sleeper space to mirage-time. With (b) - passing a value of an abstract type around, I'm undecided: what is the value thereof? What is a real use case (or requirement)? At least since mirage-time 1.0 (2016), the interface is For other "devices" (such as a network stack, a network interface, block device, file system, ...) that have data attached to it, I for sure see the value. For time/clock/random, I don't. (c) indeed, the error is a bit mystic about "unix library hidden". (d) sure, we can have in mirage-time a ".mock" implementation, but I'm not sure what should it do? directly return? return earlier? If you've a suggestion or an actual test library, please let me know. |
0976ac9
to
a6bd5b1
Compare
When putting the sleeper storage into mirage-time, I ran into the dune issue again. That's fantastic since now there's a pretty small reproduction case https://github.com/hannesm/dune-variant (reported ocaml/dune#10460). Let's hope the dune developers will have some time and be able to fix the root cause of the issue. |
The context is #1513, and #1521. This is a first shot at the mirage-time package, to use dune variants. It builds on top of #1526 and is best read with mirage/mirage-skeleton#394.
I wrote some more text to our mailing list: https://lists.xenproject.org/archives/html/mirageos-devel/2024-05/msg00002.html
This is marked as draft, since I wouldn't want to merge this as-is, but would appreciate feedback first -- maybe the code in mirage can be further simplified: an
impl
that doesn't have aconnect
should maybe not exist inmain.ml
-- i.e. no need to generate anything, since there's nothing to initialize -- we can just use it inunikernel.ml
-- but my functoria/mirage knowledge is not sufficient to write up such a thing. The default value forconnect
is eventuallyreturn ()
-- while I'd like to haveconnect
being an option (but as mentioned, I'm not sure what else needs to change and what will break).Another remark is about the "no argument check" -- I think this brief hack introduced by myself is not the right thing. We should ensure that
main
(and other jobs) have at least one argument -- but if we pass in one argument (of()
) for each "device" that doesn't need it, we'll add a lot of things for no good reason (and have again complexity, and it being hard to understand).